-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
linux/bootstrap-tools: move libstdc++ out of default library search path #209054
Conversation
This change allows building new gcc during bootstrap without fear of pulling in outdated libstdc++.so after g++ switched from bootstrapTools to freshly built g++. Noticed when tried to add early bootstrap stage to rebuild `gcc` before `glibc` is fully untangled from `bootstrapTools` as a failure to built `binutils`: ld: dwp.o: in function `__gnu_cxx::new_allocator<gold::Dwp_output_file::Contribution>::allocate(unsigned long, void const*)': /nix/store/...-gcc-11.3.0/include/c++/11.3.0/ext/new_allocator.h:116: undefined reference to `std::__throw_bad_array_new_length()' The change survives existing bootstrap and unblockes early `gcc` bootstrap.
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.
+2 Thank you for figuring this out! We should definitely merge this.
@@ -17,6 +17,15 @@ else | |||
LD_BINARY=$out/lib/ld-*so.? | |||
fi | |||
|
|||
# path to version-specific libraries, like libstdc++.so | |||
LIBSTDCXX_SO_DIR=$(echo $out/lib/gcc/*/*) |
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 checked that for all 16 of our existing bootstrap-files
tarballs there is only one subdirectory under lib/gcc
, and only one subdirectory beneath that (unpack-bootstrap-tools.sh
is a huge pain because every time we touch it we have to rebuild the whole universe).
This regressed tests for bootstrap tarball building:
I think it's a pure test issue. Test does not use any wrappers and assumes certain directory layout. Looking. |
After NixOS#209054 we started moving libstdc++.so out of default glibc's paths. This exposed bootstrap tools build failure as: $ nix build --no-link -f ./pkgs/stdenv/linux/make-bootstrap-tools.nix ... > .../bin/bar: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory Note that bootstrap itself did not break. The change only expands handcrafted `-rpath` entries.
Proposed the fix as #210752 |
This change allows building new gcc during bootstrap without fear of pulling in outdated libstdc++.so after g++ switched from bootstrapTools to freshly built g++.
Noticed when tried to add early bootstrap stage to rebuild
gcc
beforeglibc
is fully untangled frombootstrapTools
as a failure to builtbinutils
:The change survives existing bootstrap and unblockes early
gcc
bootstrap.Description of changes
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