-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
cc-wrapper: broaden explicit libc++abi linking for LLVM stdenv #181485
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently running these builds to verify this works on x86_64-darwin hardware.
Do we know what the rationale was to guard it behind isLinux
in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm the linking errors are fixed when always including libc++abi. I am still curious why it was guarded by isLinux
in the first place though?
@Itaros Do you happen to know why this issue crops up when using LLVM 11 (the default in our Darwin stdenv) to compile LLVM 13, as does in Zig? Since this issue only occurs with LLVM >= 12, and we're compiling LLVM 13 with LLVM 11, I'm a bit lost on how this issue would occur. |
There are some breakages apparently caused by this:
(also the same packages on aarch64-darwin) |
Something that may be worth nothing is that I cannot reproduce these failures (I tested |
I wonder if it's not finding libc++abi because it's one of the bootstrap stage clangs? |
This is causing breakage when using an alternate clang, because for example libcxxabi v13 now links against libcxxabi v11:
This is causing
When adding the I couldn't checkout and fetch I used |
Here is a potential fix with the Will be doing some more testing with this. |
Description of changes
This change ensures that libc++abi is linked on all platforms explicitly by cc-wrapper if stdenv is LLVM.
This is designed to address #166205
Rationale:
Currently, attempt to build c++ software which requires abi-realted features like exceptions using LLVM >=12 breaks link phase.
For example, boost build(fails):
For example, cmake(succeeds):
There is an attempt to introduce the same change as in #181143 which has proposed commit as focused on fixing zig instead of enforcing libc++abi link as a separate concern.
In conclusion: why enforcing libc++abi link?
Some random test runs after the change:
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes