-
-
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
gcc: Place target system libraries in a separate output #81716
Comments
@flokli I'm pretty sure this is the reason build-system paths are still making it into the closure for cross-compiled |
ccing @Synthetica9 as the gcc 9 maintainer |
#58606 should fix this |
@lopsided98 looks like it, though some libraries for GCC's host platform (i.e. the build platform for things built with that gcc) would still be in the |
This seems to be a dup of #58501 but that was closed...not sure why. |
Hello, I'm a bot and I thank you in the name of the community for opening this issue. To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them. Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel. |
This still should be desirable. @matthewbauer, was #59787 probably not enough? |
Right - that was not enough, but e1831eb#diff-c9fb175e04caebec67031e96e3dc5f20 should be. |
Yes, I can confirm that; I recently built a minimal cross-compiled NixOS system with no build arch references. |
Describe the bug
Cross-compiled gcc 9, used in cross-compiling stdenv in
master
, puts target libraries in itsout
output, forcing programs that link against the GCC runtime to depend on the GCC closure.For armv7l, this results in outputs built with the cross-compiling stdenv depending on the gcc
out
output, which comes to 748 MB not counting its own closure. The actual set of target-system libraries, in ``armv7l-unknown-linux-gnueabihf/lib`, comes to 35MB.To Reproduce
Steps to reproduce the behavior:
nix-build -A pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc-unwrapped
result/<system>/lib
and note libraries for target system are present in that path under theout
output.lib
outputnix-build -A pkgsCross.armv7l-hf-multiplatform.buildPackages.gcc-unwrapped.lib
.so
files with thefile
utility, note that they are only for the compiler's host platform, not its target platform.nix
cross-compiled:nix-build -A pkgsCross.armv7lhf-multiplatform.nix
nix-store -qR result | xargs du -d0 -h -c | sort -h
Expected behavior
Cross-compiling GCC should place target system libraries in a separate output, so programs which it dynamically links with those libraries do not pull all of GCC into their runtime closure.
Additional context
This is a continuation of the investigation in #81153, as to why cross-compiled nix has build-system dependencies in its runtime closure.
Metadata
Maintainer information:
The text was updated successfully, but these errors were encountered: