From 33f09f4713490d075f043dfe6eb9f66464e29555 Mon Sep 17 00:00:00 2001 From: misuzu Date: Fri, 2 Jul 2021 18:08:09 +0300 Subject: [PATCH] glibc: use `--enable-static-pie` only on supported platforms glibc fails to build for armv7l without this change. --- pkgs/development/libraries/glibc/common.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 93f8f7a8641d1..7725a3e4bf2e4 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -153,10 +153,15 @@ stdenv.mkDerivation ({ "--enable-add-ons" "--sysconfdir=/etc" "--enable-stackguard-randomization" - "--enable-static-pie" "--enable-bind-now" (lib.withFeatureAs withLinuxHeaders "headers" "${linuxHeaders}/include") (lib.enableFeature profilingLibraries "profile") + ] ++ lib.optionals (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isAarch64) [ + # This feature is currently supported on + # i386, x86_64 and x32 with binutils 2.29 or later, + # and on aarch64 with binutils 2.30 or later. + # https://sourceware.org/glibc/wiki/PortStatus + "--enable-static-pie" ] ++ lib.optionals withLinuxHeaders [ "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26 ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [