llvmPackages_{15,16,17,git}.libcxx: use LIBCXX_CXX_ABI=libcxxabi link flags on darwin#278945
Conversation
veprbl
reviewed
Jan 5, 2024
|
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
Contributor
|
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
|
1 task
Contributor
|
Successfully created backport PR for |
This was referenced Jan 12, 2024
This was referenced Jan 21, 2024
Closed
yelite
added a commit
to yelite/system-config
that referenced
this pull request
Jan 27, 2024
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.expflags which are defined only whenLIBCXX_CXX_ABI=libcxxabiin 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
libcxxabiandsystem-libcxxabithe same so both get the correct linker flags when built on darwin hosts.testing:
Details
following 2 tests can run without segfaultingDescription of changes
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-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