Closed
Description
Version
v16.5.0
Platform
Linux desert 5.12.6 #14 SMP Thu Jul 8 23:57:15 EEST 2021 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
- Attempt to build nodejs in an environment without libatomic (where libatomic is provided by compiler-rt).
- Build fails due to missing libatomic.
In this environment, no linker flags are needed as compiler-rt provides libatomic implicitly.
The following workaround is used to get builds working:
# When libatomic does not exist, remove the linker argument which tries to use it.
[ -r /usr/lib/libatomic.so ] || {
sed 's/-latomic//' node.gyp > _
mv -f _ node.gyp
}
How often does it reproduce? Is there a required condition?
This is always reproducible in an environment without libatomic (where libatomic is provided by compiler-rt).
What is the expected behavior?
The build succeeds and libatomic is not linked when unneeded.
What do you see instead?
The build attempts to link to libatomic and fails due to the library not existing in the filesystem. The library is provided by compiler-rt in this environment.
Additional information
No response