-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linker error for atomic functions on aarch64-linux #201254
Comments
BTW, this also makes building llvm fail on aarch64-linux:
|
…r-rt and clang This is required to workaround #201254.
It's a long-standing build problem in |
This change switches to using GCC 11 by default on aarch64-linux, as well as passing `-lgcc` to the linker, per NixOS#201485. See NixOS#201254 and NixOS#208412 for wider context on the issue.
This is required to workaround #201254
This change switches to using GCC 11 by default on aarch64-linux, as well as passing `-lgcc` to the linker, per NixOS#201485. See NixOS#201254 and NixOS#208412 for wider context on the issue. (cherry picked from commit 8442601)
This is required to workaround NixOS#201254 (cherry picked from commit ba3db3e)
PR #209870 was marked to close this issue. Since that PR is now merged, this can be closed? |
We should wait until it hits master, it's still in staging. |
Oh you're right |
Describe the bug
When using some atomic functions on aarch64 linux fails during the linking phase when using the
-z defs
linker option (as observed while trying to compile bobcat on aarch64-linux):Steps To Reproduce
Steps to reproduce the behavior:
fail.nix
nix-build -I nixpkgs=PATH_TO_NIXPKGS fail.nix
Expected behavior
Linking should succeed.
Additional context
According to https://bugzilla.redhat.com/show_bug.cgi?id=1830472
Indeed
libgcc_s.so
from gcc-lib is a linker script:Adding the
-v
flag to the invocation ofg++
one can observe this call to collect2:Removing the glibc lib directory from the library path (ie. removing
-L/nix/store/g14swv4f0rg83naqj87g1mjmyvrmrxmf-glibc-2.35-163/lib
), makes this call successful.The root cause is that glibc contains a
libgcc_so.1
library in itslib
folder:This is found before the right one from gcc, and this breaks linking when it would just work if
libgcc_so.1
would be the proper linker script.Why does glibc contain the libgcc_s.so library?
Notify maintainers
@edolstra @Ma27
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: