Skip to content

glibc: re-enable stripping in cross builds#59787

Merged
matthewbauer merged 1 commit intoNixOS:masterfrom
delroth:strip-glibc
Apr 17, 2019
Merged

glibc: re-enable stripping in cross builds#59787
matthewbauer merged 1 commit intoNixOS:masterfrom
delroth:strip-glibc

Conversation

@delroth
Copy link
Copy Markdown
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
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 17, 2019
@matthewbauer
Copy link
Copy Markdown
Member

Also should fix #58981 and and #35251

@matthewbauer
Copy link
Copy Markdown
Member

@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.hello

@delroth
Copy link
Copy Markdown
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
Copy Markdown
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

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

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