gcc: place cross-compiled target libraries in lib output#81844
gcc: place cross-compiled target libraries in lib output#81844matthewbauer merged 2 commits intoNixOS:stagingfrom
Conversation
ae31bd2 to
d9feea5
Compare
|
I removed the sotruss commit because I didn't see any references to build time bash. If someone thinks it is still needed, it can be included in a different PR. |
|
Yeah, this is definitely an improvement over the multi part if statements. If @illegalprime and @eamsden are okay with it, I'll merge this one and close out the other two. |
|
I hope someday the location of thtings can be the same for native and cross, but if it solves a real problem it is fine for now. The GCC build system is too much of a mess to fight slowly, it has to be an all or nothing attack. |
|
@Ericson2314 Isn't your eventual goal to always cross-compile and use prefixed compilers (#44583 #21471), in which case this would be the correct solution and |
|
@lopsided98 Yes, but my goal is also to build (or at least have build outputs as if we built) standard libraries like regular libraries, which means everything goes in |
|
This probably broke i686 builds: https://hydra.nixos.org/build/114095842 |
|
#82510 should fix that. |
Motivation for this change
This is my take on an alternative, subjectively cleaner implementation of #58606 and #81781. The only functional difference is that the libraries are placed in $lib/$targetConfig/lib (which is the directory convention using by the GCC build scripts) rather than $lib/lib. This requires a minor change to cc-wrapper. Subjectively, I believe it is cleaner because it unifies the handling of the cross and non-cross cases and is therefore easier to reason about.
I have tested this change by building
pkgsCross.armv7l-hf-multiplatform.helloandpkgsCross.aarch64-multiplatform.hello.While searching for potential ramifications of this change, I found a patchelf invocation that is no longer needed. I have verified that the
liboutput of the native x86_64 builds of all supported GCC versions still contain no references to their correspondingoutoutput after this change.Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)cc @illegalprime @Floki @matthewbauer @eamsden