Skip to content
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

glibc: re-enable stripping in cross builds #59787

Merged
merged 1 commit into from Apr 17, 2019

Conversation

delroth
Copy link
Contributor

@delroth delroth commented Apr 17, 2019

Motivation for this change

References to the host toolchain are leaking through debug symbols in glibc, causing gnu cross-builds to always depend on the host toolchain. The decision to not strip was made in 2009 (c6b5264), and I suspect the reasons that justified it back then do not apply anymore in 2019.

Closure size before:
/nix/store/v5pxj0bgg627hic2khk4d43z6cjp5v7d-hello-2.10-armv7l-unknown-linux-gnueabihf 596.8M

After:
/nix/store/llp1ncmpar406rc2vhj7g5ix4yqwna3n-hello-2.10-armv7l-unknown-linux-gnueabihf 23.6M

Fixes #58501 (as far as I can tell). @illegalprime @Thra11 @matthewbauer

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

References to the host toolchain are leaking through debug symbols in
glibc, causing gnu cross-builds to always depend on the host toolchain.
The decision to not strip was made in 2012 in order to improve GNU/Hurd
support, and I suspect the reasons that justified it back then do not
apply anymore in 2019.

Closure size before:
/nix/store/v5pxj0bgg627hic2khk4d43z6cjp5v7d-hello-2.10-armv7l-unknown-linux-gnueabihf                            596.8M

After:
/nix/store/llp1ncmpar406rc2vhj7g5ix4yqwna3n-hello-2.10-armv7l-unknown-linux-gnueabihf     23.6M
@matthewbauer
Copy link
Member

Also should fix #58981 and and #35251

@matthewbauer
Copy link
Member

@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.hello

@delroth
Copy link
Contributor Author

delroth commented Apr 17, 2019

I don't think it will fix #58981. That one will likely require #58606 to be merged as well to split libgcc_s.

@Ericson2314
Copy link
Member

Yes please! Virtually any cross hack pre-2016 is probably obsoleted and we should try getting rid of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x86 runtime deps in ARM glibc (and most other binaries)
4 participants