Repository navigation
Description
What is the problem this feature will solve?
Summary
Node 25.0.0 requires the libatomic library, it's in the docs since 25.2.0.
I've tried some current official Ubuntu images (24.04, 25.10, 26.04) and Debian images (12.12, 13.12) and none comes with libatomic installed.
Consequently installing node on Debian or Ubuntu will work, but running any commands will fail.
Why should this be supported
I assume that having a seamless installation experience, at least on major linux distros, is something Node would like to provide. I'm thinking a) install nvm, b) install node via nvm, c) done, you can use node now.
This is also how, for example, the npm docs tell you to install npm. And it no longer works on Debian or Ubuntu based images unless you also install "libatomic".
Debian and Ubuntu are two of the major linux distros. Many projects are using one of their images as the basis for their official docker images. For example, the official Jenkins image is debian based and the latest version (jenkins/jenkins:2.538-jdk21) can not run node 25+, unless you first install "libatomic" into the container that is.
What is the feature you are proposing to solve the problem?
I am not familiar enough with linux or node to tell whether or not node could include libatomic. But if that was possible and practical then that would allow debian and ubuntu based images to run node again without having to install libatomic first.
What alternatives have you considered?
- nvm could plausibly install libatomic, that said, over at nvm the sentiment was that Node was the place to address this.
- debian / ubuntu could plausibly include libatomic in their images
- all projects that provide debian / ubuntu based images and imagine their image could be used to run node could plausibly provide libatomic
- the end user that wants to run node in any debian / ubuntu based image could plausibly install libatomic
Out of these I've only really considered 1 and 4 real possibilities, though with the folks at nvm saying it's not their job it's either on Node itself or the end user, probably.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsAwaiting Triage
Activity
richardlau commentedon Nov 20, 2025
Ref: #37219 (comment)
Upstream V8 avoids this by providing a custom libcxx which includes atomic functions. There is reference in an upstream V8 issue with a desire to retire the option to not use the custom libcxx (which Node.js is currently using), so we may need to switch eventually.
EricMCornelius commentedon Dec 5, 2025
This will absolutely break reasonable assumptions for single-executable-application deployments using the official node runtime binaries if not rectified.
linghengqian commentedon Jan 2, 2026
Should the documentation of NodeJS mention somewhere that in common Linux distributions, what command should be used to install
libatomic.so.1? In the amd64 architecture of Ubuntu 24.04, there are 57 system dependencies that contain this file. For reference, see https://packages.ubuntu.com/search?suite=noble&arch=amd64&searchon=contents&keywords=libatomic.so.1 .The current error logs of
node --versiondo not show this.node: error while loading shared libraries: libatomic.so.1: cannot open shared object file: No such file or directorypolarathene commentedon Feb 19, 2026
TL;DR: If building Node with
zig cc/zig c++this should remove the dependency IIRC, that compiler specifically special cases libatomic regardless of static/shared link request, as it builds it's own on-demand for the build target and bundles that in statically AFAIK.A similar dependency issue is with
python-build-standaloneproject's Python distribution, although they statically linklibatomicinto their binary instead of a dynamic link. The problem over there is some other project's like Nuitka read in build metadata to link the dep, even when it shouldn't be necessary as it was a static dep, not dynamic. That project has built their binaries for distribution on rather old build environments wherelibatomicwas needed for a dependency, and discusses if that's really still necessary.libatomicis it needed for modern hardware? If so how feasible is static linking?I'm not too familiar with using libatomic myself. I have heard that there might be a concern with not linking to a shared library at runtime? But that might depend on what else is running?:
Apparently it's also not likely to be needed on modern systems, but rather for hardware/architectures well over a decade old?
Clearly that's more of a difficult call for NodeJS, but such platforms could perhaps have alternative legacy build support? 🤷♂️
Zig via
zig cc/zig c++could solve this?With Zig building NodeJS you can avoid the hassle of building in a rather dated environment to reduce glibc (I see it's targeting glibc
2.28on the copy I have installed fromprotoCLI).Zig can specify a glibc version in it's
-gnutargets, whilst also providing the convenience of omittinglibatomicandlibgcc_slibraries (if you raise the glibc target up to2.34from around Aug 2021, you'd additionally have other glibc related libraries omitted which isn't zig specific but a change from glibc itself).This Dec 2024 commit for Zig
0.14.0onwards documents how Zig is handlinglibatomic:Which implies Clang doesn't need this either? I haven't checked, it may be an opt-in feature there for
compiler-rt?The associated Zig issue that was resolved by that referenced commit:
Related reference that covers gcc libs handled by Zig too:
linghengqian commentedon Feb 19, 2026
I personally think the current issue is actually a duplicate of nodejs/build#4091 . Will this bug automatically disappear once all builds are migrated to gcc 13.1+? I don't believe that switching to
zig cc/zig c++halfway through the Clang migration will enable support for platforms that clang doesn't support.polarathene commentedon Feb 20, 2026
I don't see how that's related? There isn't a discussion there about libatomic? Could you please clarify?
Your prior comment references Ubuntu and a package to install, but I don't think you're familiar with the convention (see the Fedora example below), you just need
apt-get install libatomic1in your runtime environment which will resolve to the correct package for your architecture.I've not looked into if Clang has the same behaviour as Zig to avoid an explicit
libatomiclink when it's not necessary for the platform target, is that something you can confirm?EDIT: I'm pretty sure you still have to explicitly link by default for Clang, and depending on distro, like with GCC you'd need
libatomic.apresent which may need a separate package installed.Is that a release that does the same as I described with Zig but with GCC?Nope.EDIT: See my next comment, I cover both Ubuntu and Fedora since they differ a tad. Short version is I don't think GCC or Clang provide the same convenience I described that Zig offers for
libatomic.polarathene commentedon Feb 20, 2026
I just checked in Fedora and it has GCC 15 with only a
libatomic.sobundled (as a linker script) for linking to/usr/lib64/libatomic.so.1(the runtime dep linked based onDT_SONAMEvalue, which should resolve a symlink to the full versioned lib in a runtime environment).libatomic.ayou'd need to installlibatomic-static. Ideal as drops the runtime requirement.libatomic.so.1you'd need to installlibatomic. This the current situation users have an issue with.Here's an example for Fedora
Clang (at least in Fedora) is configured to include the GCC paths, such that it gets the
libatomic.aavailable in the same manner as GCC.So I don't think anything has changed there from what I've said in my previous comment?
dnf install -yq zigyou do not need the separatelibatomic/libatomic-staticlibrary and can usezig ccorzig c++as the compiler and it'll handle thelibatomicfor you, no need to-l libatomiceither (although AFAIK that'd be expected for GCC/Clang).libatomicwith GCC/Clang with a separate package works too.For reference, here is GCC 13 on Ubuntu 24.04 with only the
libgcc-13-devpackage (dep ofgccpackage) installed, which includes the mentionedlibatomic1runtime package andlibatomic.a(_as part oflibgcc-13-dev):There's nothing special about GCC 13 in Ubuntu there, go back to Ubuntu 20.04 with GCC 9 and it's the same.
So in a build environment you'd have
libatomic.aalready with thegccpackage installed. You just need to indicate to static link thatlibatomic.aas a preference overlibatomic.so(dynamic is preferred by default when available), so that'd be handled by either:-Bstatic -l atomic -Bdynamic-Wl,-Bstatic -l atomic -Wl,-Bdynamic(there is also-l:libatomic.aas an alternative but Zig's C/C++ linker isn't compatible with it)The link you provided talked about RHEL, so I'd assume it's similar to Fedora more than Ubuntu, but I've not looked. Most likely scenario is the dependency is just
-l atomicinstead of advised above to ensure the static lib is linked instead.Hopefully that better clarifies why I suggested Zig.
libatomicissue withpython-build-standalone+ Nuitka + Zig due to-l:libatomic.a, so this topic is quite familiar for me 😅fix: statically link libatomic for linux node25+ builds
alexsch01 commentedon May 10, 2026
This would be a blocker for v26 LTS, right?
linghengqian commentedon May 10, 2026
I don't think this will hinder the release of the new LTS version, because I don't even know which git to put the PR that solves this problem into.
alexsch01 commentedon May 14, 2026
I made PR: #63270
it's more of a POC with compiling with clang on Linux
laverdet commentedon Jun 15, 2026
I'm a bit confused by this one. I'm seeing on the v8 lists that the node team is still supporting gcc compilation, since the v8 team officially dropped support for it. But it looks like the distributed nodejs binaries are now being built with clang.
There is a long-standing issue in clang where std::atomic generates runtime calls under libstdc++. gcc doesn't emit the same runtime calls.
You can get around it by statically linking against libatomic but the intrinsics that gcc emits are better. I've just been using gcc to avoid the runtime calls.
alexsch01 commentedon Aug 27, 2026
Any update on this? Are there plans to have a "custom libcxx which includes atomic functions"
aral commentedon Sep 12, 2026
This basically means that the standalone Node binaries are broken on major Linux distributions and this PR fixes it:
#63270
This should really be implemented before 26 hits LTS.
Norbiros commentedon Oct 20, 2026
@richardlau with Node 26 about to enter LTS (in ~8 days), this will start affecting a lot more people. You mentioned that moving to V8's custom
libcxxwould avoid this, but I'm not sure that migration is feasible before LTS, though. Would it make sense to merge #63270 (statically linking libatomic for Linux Clang builds) as a temporary fix, and track thelibcxxmigration separately as the long-term solution?EricMCornelius commentedon Oct 21, 2026
@richardlau - this really is critical - we just started running through an update cycle to try to mitigate the CA disclosures, and thought we would vet the new runtime builds. We package and ship deployments as SEAs, but even common
nvmruntime upgrades are going to fail.Failure on all ubuntu 24.x LTS and preceding infra when up to date - for any new node runtimes without explicit installation of the additional new dependencies is going to be a big, unexpected, runtime blast radius for people.
richardlau commentedon Oct 21, 2026
If collaborators are willing to review #63270 it can land (if it also passes a full Jenkins run covering all of the platforms we support) but it won't make the first LTS release as it would have needed to have been included in 26.12.0 to meet the "two weeks in a current release" threshold for inclusion into LTS.
Moving from 24 to 26 is a semver major bump, and people should not being doing that blindly (or be prepared for breakages if they do).
EricMCornelius commentedon Oct 21, 2026
@richardlau while true, it's also true that without explicit warning about extra nonstandard configuration steps, it's a major stretch to include Ubuntu 24.x LTS in the OS compatibility table for the 26.x LTS.
richardlau commentedon Oct 23, 2026
I've mentioned the requirement in the changelog (which will also form the basis for the blog post on the website) for 26.13.0.
Norbiros commentedon Oct 24, 2026
Thanks! Is there anything we can do to help move #63270 forward more quickly? Even if it doesn't make the first LTS release, I'd love to see it land as soon as possible. We can wait a few weeks, but I'd prefer not to wait much longer. I'd really like to avoid having to modify all my containers just to add
libatomictemporarily and then remove it once the fix is available.