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

gcc9: don't run patchELF on statically linked binaries #89030

Closed

Conversation

langston-barrett
Copy link
Contributor

This produces an error, at least when cross compiling statically for AArch32.

Motivation for this change

Fixes #88956

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

This produces an error, at least when cross compiling statically for AArch32.
@@ -241,7 +241,7 @@ postInstall() {
# More dependencies with the previous gcc or some libs (gccbug stores the build command line)
rm -rf $out/bin/gccbug

if type "patchelf"; then
if [ -n "${dontPatchELF}" ] && type "patchelf"; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be -z i think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point... that probably means that this isn't being set properly on the static builds! I'll look into it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this locally and am re-running the build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so adding assert staticCompiler; to this expression fails, I guess that isn't acutally set in static.nix. I could add an override for GCC, but there's the added complication of it being used in the stdenv, and being wrapped by wrapCC. @matthewbauer do you have any advice on how I could cause this variable to be set when building pkgsStatic.gcc?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think that will work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static.nix should only apply to the things in pkgsStatic, so I think it will actually be okay here

@langston-barrett
Copy link
Contributor Author

I'm unmotivated to figure this one out. Sorry!

Staging automation moved this from WIP to Done Aug 10, 2020
@langston-barrett langston-barrett deleted the lb/static-gdb-arm branch August 10, 2020 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

pkgsStatic.gcc fails to build for Raspberry Pi
2 participants