libcxx: link correct libcxxabi version#201268
Conversation
|
@stephank FYI I tried to pass in cctools to get an absolute path to |
3fc936d to
e496998
Compare
|
I'm still a bit unclear on the release model tbh, but as long as it goes into one of the cached nixpkgs branches I'm good. However if it can go in I think it should. Any packages built with a libcxxStenv, with any LLVM version apart from 11 will have runtime bugs. There may be others, but the bug I hit looks like:
This happens because the libcxxabi BSS segment gets loaded twice, once from each linked version, and the TLS references in the _cxa machinery resolve different addresses for the key/flag storage in throw code Vs catch code. |
|
Yeah, that's pretty bad. I was unable to get around to this sooner because of circumstances. Ping @vcunat. I believe the last staging-next merge is happening today (#200868). This is a darwin stdenv rebuild. How do you feel about merging this into staging-next before it lands? Devil's advocate: As mentioned, it only happens on non-default v11 LLVM, and only on Darwin I believe. It may be tempting to call this niche, also because it's gone under the radar for quite some time. |
|
Rebuilding all of There might be other motivation to do full |
|
IMO via staging and staging-22.11, once it exists later tonight. |
Yeah, directly including But this is about the I was able to get a shell for the failing derivation, and the issue is that I can make a PR for that, but would have to wait for this one to go through. You could also add it to this branch, if you want. |
|
It might make sense to switch to native bootstrapping instead. On Hydra side we don't even have native x86_64-darwin anymore but just rosetta emulation. |
I presume we're talking about the same Hydra failures after your PR #196909
I've made the change on this branch, running a test build locally before I push it. |
@vcunat I took as stab at this in #202347, but think it requires a little bit more work. Even if it worked first try, I think having both fixes doesn't hurt. 🙂 |
Same adjustment as made for libc++abi in NixOS#185766, for the same reason: the unamended dylib links to the libc++abi in the build stdenv, which is the wrong version. Tested on Darwin with LLVM 14 stdenv, but the phase is added to all versions, including 11 - so this will cause a mass rebuild. See: NixOS#185766
Apart from being a no-op, this seems to cause the install to make a copy, rather than keeping the symlinks intact.
This is to fix the stdenvBootstrapTools issue where otool & others are not available in PATH, but only under the targetPrefix.
e496998 to
2252245
Compare
|
I'm hitting this problem with dejagnu. Nothing to do with the targetPrefix though, it's the same without changes. I don't understand the issue, and my flake appears to still build OK against this version. Pushing anyway, assuming CI will stop if there's an issue. Edit: also rebased onto recent staging |
|
Successfully created backport PR #203425 for |
Description of changes
This is a follow-up to @stephank's PR here: #196909
Firstly, skip the dylib fixups introduced in that PR for symlinks. This is the same behaviour as the standard
fixDarwinDylibNameshook.The main change is to do the same fixup on libc++.dylib as done on libc++abi.dylib
Current behaviour emits a
/nix/store/$hash-libc++-$version/lib/libc++.dylibwhich loads libc++abi from the build stdenv, which on Darwin is/nix/store/$hash-libcxx-11.1.0/lib/libc++abi.dylib– not necessarily the correct version.Combined with the symlink breakage, using
llvmPackages_14.libcxxStdenvin my flake causes dyld to partially load 2 copies of libc++abi. It only seems to load the BSS segment twice, so most things work, apart from a very subtle bug insidestd::current_exception().Things done
sandbox = trueset 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.shto update generated release notes