-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
perl: fix configure phase for Aarch32 #76922
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
Conversation
In "perl: fuse configureFlags" [1] the effects of the preConfigure phase were merged into configureFlags. After this change values with spaces do not reach the configure script intact. The only flag this affects is `ldflags` for Aarch32 and Mips, and perl builds without it on armv7l-linux so it's probably no longer required on any platform. Fixes: configuring configure flags: -de -Dcc=cc <...> -Dldflags=\"-lm -lrt\" ./Configure: eval: line 1677: unexpected EOF while looking for matching `"' ./Configure: eval: line 1678: syntax error: unexpected end of file Configure: unknown option -lrt" [1] 3b50d04
Don't know why cross is broken. I turned off the warnings to test the changes in this PR. Without:
And with this PR, the build succeeds. Hacks to disable warningsdiff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix
index 98e579cb7a6..c80b85e05a0 100644
--- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -49,20 +49,25 @@ callPackage ./common.nix { inherit stdenv; } {
++ stdenv.lib.optional stdenv.hostPlatform.isMusl "pie";
NIX_CFLAGS_COMPILE =
- if !stdenv.hostPlatform.isMusl
- # TODO: This (returning a string or `null`, instead of a list) is to
- # not trigger a mass rebuild due to the introduction of the
- # musl-specific flags below.
- # At next change to non-musl glibc builds, remove this `then`
- # and the above condition, instead keeping only the `else` below.
- then (if withGd then gdCflags else null)
- else
- (builtins.concatLists [
- (stdenv.lib.optionals withGd gdCflags)
- # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
- # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
- (stdenv.lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
- ]);
+ let flags =
+ (builtins.concatLists [
+ (stdenv.lib.optionals withGd gdCflags)
+ # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
+ # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
+ (stdenv.lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
+ (stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isAarch32) [
+ # Ignore https://github.com/cirosantilli/linux-kernel-module-cheat/issues/97 -- new warning as of GCC 9.2.0
+ "-Wno-missing-attributes"
+ # Ignore https://sourceware.org/bugzilla/show_bug.cgi?id=23442 -- new warning as of GCC >= 8, fixed in glibc 2.28
+ "-Wno-array-bounds"
+ ])
+ ]);
+ # TODO: This (returning a string or `null`, instead of a list) is to
+ # not trigger a mass rebuild due to the introduction of the
+ # musl-specific flags.
+ # At next change to non-musl glibc builds, remove this `if`
+ # and the above let, instead keeping only the `concatLists` above.
+ in if (flags == [] && !stdenv.hostPlatform.isMusl) then null else flags;
# When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
# any program we run, because the gcc will have been placed at a new |
Building for my raspi2 (armv7), I was facing what looks like the same bug. Tested building with this PR, had success. +1 |
As a relevant note, there are more packages than I can count that don't properly cross compile with my build machines, unless your policy involves eventually fixing those too, I see no reason to hold off on merging this |
In "perl: fuse configureFlags" [1] the effects of the preConfigure
phase were merged into configureFlags. After this change values with
spaces do not reach the configure script intact.
The only flag this affects is
ldflags
for Aarch32 and Mips, and perlbuilds without it on armv7l-linux so it's probably no longer required
on any platform.
Fixes:
[1] 3b50d04
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @lopsided98 @globin