build-support/cc-wrapper: add libstdc++fs into default library path for clang#213021
build-support/cc-wrapper: add libstdc++fs into default library path for clang#213021vcunat merged 1 commit intoNixOS:staging-nextfrom
Conversation
|
15k rebuilds, more than I expected, but maybe ~ok for I expected only affect the only packages that use |
|
Yeah, it's most of graphical stack. |
There was a problem hiding this comment.
LGTM but could you mention in the commit message (maybe even in the title) that the extra flags are added only for clang?
Rebuilt full workstation on:
-
x86_64-linux(except chromium+firefox, still building) -
powerpc64le-linux(except ghc, chromium+firefox, still building)
There was a problem hiding this comment.
I agree, libraries belong in lib.
Unfortunately a ton of packages that have a $lib output are putting their .a files in $out. I think autotools even does this by default when you build both static and dynamic libraries (i.e. it doesn't use --libdir for the .a files). On my system, when scanning /nix/store/*-lib/ for .a files, the only hits are things that don't use autotools. Or it might be the way nixpkgs invokes ./configure. Anyways, the problem affects a lot more than just gcc.
This should probably be fixed nixpkgs-wide in setup.sh someday.
There was a problem hiding this comment.
Unfortunately a ton of packages that have a $lib output are putting their .a files in $out.
From what I understand how library lookup works splitting .a and .so into different directories will effectively cause only one of them to be used as ld will use first found. I would expect most of the packages to put both together in a single directory.
I think autotools even does this by default when you build both static and dynamic libraries (i.e. it doesn't use --libdir for the .a files). On my system, when scanning /nix/store/*-lib/ for .a files, the only hits are things that don't use autotools. Or it might be the way nixpkgs invokes ./configure.
My understanding is that nixpkgs tries hard not to build both if possible (--enable-shared --disable-static / --disable-shared --enable-static). autotools should put both into --libdir. Even FHS distributions rely a lot on --libdir correct handling to put 32-vs-64 bit code into a correct location to make -m32/-m64 just work.
Anyways, the problem affects a lot more than just gcc.
Sure. Though most programs don't implement the split between host/target libraries. For simpler programs it should be only a matter of fixing build system to put results into a correct directory (--libdir or equivalent). gcc case is slightly more complicated than that. Otherwise we would not need this huge driver-wrapper that incorrectly reimplements gcc's assumed library search.
…or clang After NixOS#210004 `usbmuxd2` started failing to build as: usbmuxd2-unstable> .../ld: cannot find -lstdc++fs: No such file or directory usbmuxd2-unstable> clang-11: error: linker command failed with exit code 1 (use -v to see invocation) This started happening because NixOS#210004 exposed a long-standing bug in `gcc` derivation: `cc.lib` is missing `libstdc++fs` library: $ find $(nix-build --no-link -A stdenv.cc.cc.lib) | fgrep libstdc | unnix /<<NIX>>/gcc-11.3.0-lib/lib/libstdc++fs.la /<<NIX>>/gcc-11.3.0-lib/lib/libstdc++.la /<<NIX>>/gcc-11.3.0-lib/lib/libstdc++.so.6.0.29 /<<NIX>>/gcc-11.3.0-lib/lib/libstdc++.so /<<NIX>>/gcc-11.3.0-lib/lib/libstdc++.so.6 It was not moved from `cc.out` output: $ find $(nix-build --no-link -A stdenv.cc.cc) | fgrep libstdc | unnix /<<NIX>>/gcc-11.3.0/lib/libstdc++.a /<<NIX>>/gcc-11.3.0/lib/libstdc++fs.a This change adds `cc` library lookup path back to `staging-next` until `gcc` is fixed.`
d563435 to
4763533
Compare
Added |
After #210004
usbmuxd2started failing to build as:This started happening because #210004 exposed a long-standing bug in
gccderivation:cc.libis missinglibstdc++fslibrary:It was not moved from
cc.outoutput:This change adds
cclibrary lookup path back tostaging-nextuntilgccis fixed.`Description of changes
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