-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
cross: regression with armv7 pkgsStatic (error: C compiler cannot create executables) #114953
Comments
Relevant
|
We could do something like gcc.hardeningUnsupportedFlags = optional (stdenv.hostPlatform.isAarch32 && stdenv.hostPlatform.isStatic) "pie"; |
@veprbl I'm not sure where |
@samueldr I agree with your assessment. We would need to apply it to all needed compilers individually. |
I don't feel this is the right solution. (I could be wrong.) Couldn't we work this into the conditional here instead? After all, this is where it is being set globally. |
@samueldr To my taste, the hardening flag logic doesn't belong to stdenv, but to cc/cc-wrapper. Especially given that we don't do any eval-time validation there. |
Though it is not the way it's done currently. The flag logic is in stdenv. I'm not interested into having to refactor something I don't really understand in depth, to get things back to a working state.
I see that there's already a conditional for musl to add pie, why not fix it there? After all, it's there that it's being globally added. nixpkgs/pkgs/stdenv/generic/make-derivation.nix Lines 109 to 111 in a6840c5
|
@samueldr Speaking of musl, shouldn't pkgsStatic set |
It does already:
And the conditional removes "pie" when it's not musl, so if I understand things right, it'd be rewritten
Though, non-static armv7 with musl should be verified too. |
@samueldr I got the condition wrong. This looks like a relevant bug |
Things may be more subtle than expected. I hadn't tested in depth with aarch64, only compiled to see if it was compiling still. (I'm working on tests to check things)
Still investigating, will open a PR with the changes that at least works around the regression, and maybe will be the solution. EDIT: |
4e9dc46 re-enabled hardening for Musl, which is good. Though static builds for ARM fail in various ways - cross armv7l static does not build - cross aarch64 static produces segfaulting dynamically linked binaries - native aarch64 static also produces segfaulting dynamically linked binaries It seems that for native x86_64-linux, static builds are fine though. This works around the issue by removing PIE from the hardening flags, keeping all other hardening flags. This is an improvement (I think) from before 4e9dc46. Fixes NixOS#114953
4e9dc46 re-enabled hardening for Musl, which is good. Though static builds for ARM fail in various ways - cross armv7l static does not build - cross aarch64 static produces segfaulting dynamically linked binaries - native aarch64 static also produces segfaulting dynamically linked binaries It seems that for native x86_64-linux, static builds are fine though. This works around the issue by removing PIE from the hardening flags, keeping all other hardening flags. This is an improvement (I think) from before 4e9dc46. Fixes #114953
Describe the bug
With #101606 many
pkgsCross.armv7l-hf-multiplatform.pkgsStatic.
attributes that were working stopped building.To Reproduce
Additional context
Reverting 4e9dc46 makes many thing work again.
I'm not sure what should be done here. On one hand I assume PIE is desired. But it definitely provably breaks things with cross-compilation.
It seems to be limited to armv7; the equivalent aarch64 builds work fine.
Notify maintainers
@Ericson2314 @matthewbauer as cross-compilation aficionados
@utsl42 author of the change
The text was updated successfully, but these errors were encountered: