-
-
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
closure-size: Cross compiled simple C++ application depends on gcc & host libs #58981
Comments
I didn't manage to find it at the time, but it looks like this is probably the same issue as #58501. I'll test the PR linked to that one... |
After rebasing #58606 onto master post-#59787, this is the situation:
|
Looks like However, |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
this isn't stale for me, and I ran into this similar problem recently |
I marked this as stale due to inactivity. → More info |
can't repro with cppcheck |
Issue description
This is possibly an instance of this issue: #53424
With glibc
dontStrip = true
commented out as described in #35251, The dependencies of a simple C program, when cross compiled, are fairly minimal (Throughout this issue report, host architecture is aarch64, so armv7l target is cross compiled):However, if you cross compile a very simple C++ application (I created a trivial C++ hello world package, hello-cpp), it has a massive closure:
We can see that the actual dependencies of the hello-cpp binary are quite reasonable: It needs the linker, libc, libm from the cross-glibc package, but also needs libstdc++ and libgcc_s.
However, it appears, libstdc++ and libgcc are bundled up with lots of other libs and binaries in the *-armv7l-unknown-linux-gnueabihf-stage-final-gcc-7.4.0 output. Since these binaries include the cross compiler, they depend on various host packages such as glibc.
I notice that if I compile hello-cpp for the native platform, it instead depends on gcc-7.4.0-libs, which includes only the libraries. Is there a reason the cross-toolchain C++ libraries aren't split into their own output?
Technical details
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste theresults.
"aarch64-linux"
Linux 3.10.104, Ubuntu, 18.04.2 LTS (Bionic Beaver)
no
yes
nix-env (Nix) 2.2
/home/thrall/nixpkgs
The text was updated successfully, but these errors were encountered: