-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
llvmPackages_{15,16,17,git}.libcxx: use LIBCXX_CXX_ABI=libcxxabi link flags on darwin #278945
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
This change applies the upstream PR llvm/llvm-project#77218 so the same link flags on darwin are used as when LIBCXX_CXX_ABI=libcxxabi. Specifically, this adds "-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp" which prevents libcxx from segfaulting on darwin
Sorry for the low-signal comment, but I'd like to +1 this PR @RaitoBezarius1 - it's currently blocking me from updating an important project to LLVM 17 and I'd like to avoid waiting for @a-n-n-a-l-e-e's upstream fix to come in LLVM 18 (thanks for the fix, by the way!). Footnotes
|
Successfully created backport PR for |
Closes #269548 NixOS/nix#9640 by incorporating upstream fix: llvm/llvm-project#77218
This change fixes segfaults when multiple c++ libraries are loaded -- this happens on older macos release, eg: big sur, where the system libc++ is loaded as part of the framework, or newer macos, eg: monterey, when one libc++ library is loaded at init and some other libc++ is dlopened later.
The problem stems from not linking with the
-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp
flags which are defined only whenLIBCXX_CXX_ABI=libcxxabi
in the CMakeLists.txt. These link flags were defined in nixpkgs prior to llvmPackages_15. llvmPackages_15 started usingsystem-libcxxabi
, which was introduced https://reviews.llvm.org/D119539 and refined https://reviews.llvm.org/D120727, rather than justlibcxxabi
.The upstream fix llvm/llvm-project#77218 treats
libcxxabi
andsystem-libcxxabi
the same so both get the correct linker flags when built on darwin hosts.testing:
Description of changes
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.
this change is the result of contributions from:
@abathur @cormacrelf @reckenrode @veprbl