summary refs log tree commit diff
path: root/pkgs/development/libraries/glibc
diff options
context:
space:
mode:
authormisuzu <bakalolka@gmail.com>2021-07-02 18:08:09 +0300
committermisuzu <bakalolka@gmail.com>2021-07-02 18:08:26 +0300
commit33f09f4713490d075f043dfe6eb9f66464e29555 (patch)
treedff45246d225bfa2faca01c235dc459260e7acd5 /pkgs/development/libraries/glibc
parent59ef8087a3d95bf6c69767c126bbc0b7ced89e32 (diff)
downloadnixpkgs-33f09f4713490d075f043dfe6eb9f66464e29555.tar
nixpkgs-33f09f4713490d075f043dfe6eb9f66464e29555.tar.gz
nixpkgs-33f09f4713490d075f043dfe6eb9f66464e29555.tar.bz2
nixpkgs-33f09f4713490d075f043dfe6eb9f66464e29555.tar.lz
nixpkgs-33f09f4713490d075f043dfe6eb9f66464e29555.tar.xz
nixpkgs-33f09f4713490d075f043dfe6eb9f66464e29555.tar.zst
nixpkgs-33f09f4713490d075f043dfe6eb9f66464e29555.zip
glibc: use `--enable-static-pie` only on supported platforms
glibc fails to build for armv7l without this change.
Diffstat (limited to 'pkgs/development/libraries/glibc')
-rw-r--r--pkgs/development/libraries/glibc/common.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index 93f8f7a8641..7725a3e4bf2 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) [