summary refs log tree commit diff
path: root/pkgs/test
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2021-05-25 06:32:25 +0100
committerGitHub <noreply@github.com>2021-05-25 06:32:25 +0100
commit5551a785784e839d68c65b3e2daf81916d165c29 (patch)
treed9d702511de64680a184f9275949fd5bddc6811d /pkgs/test
parent18d250069d6a23479ffea1682476dfb3888b40d4 (diff)
parent602b5f8747e63ff737d48e6f18c8fd35168a707c (diff)
downloadnixpkgs-5551a785784e839d68c65b3e2daf81916d165c29.tar
nixpkgs-5551a785784e839d68c65b3e2daf81916d165c29.tar.gz
nixpkgs-5551a785784e839d68c65b3e2daf81916d165c29.tar.bz2
nixpkgs-5551a785784e839d68c65b3e2daf81916d165c29.tar.lz
nixpkgs-5551a785784e839d68c65b3e2daf81916d165c29.tar.xz
nixpkgs-5551a785784e839d68c65b3e2daf81916d165c29.tar.zst
nixpkgs-5551a785784e839d68c65b3e2daf81916d165c29.zip
Merge pull request #123989 from Mic92/static-pie
glibc: allow to build position-independent static executable
Diffstat (limited to 'pkgs/test')
-rw-r--r--pkgs/test/cc-wrapper/default.nix3
1 files changed, 1 insertions, 2 deletions
diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix
index d82ba296e2f..b483372dea0 100644
--- a/pkgs/test/cc-wrapper/default.nix
+++ b/pkgs/test/cc-wrapper/default.nix
@@ -35,8 +35,7 @@ in stdenv.mkDerivation {
       printf "checking whether compiler builds valid static C binaries... " >&2
       $CC ${staticLibc} -static -o cc-static ${./cc-main.c}
       ./cc-static
-      # our glibc does not have pie enabled yet.
-      ${lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.cc.isGNU) ''
+      ${lib.optionalString (stdenv.cc.isGNU && lib.versionAtLeast (lib.getVersion stdenv.cc.name) "8.0.0") ''
         printf "checking whether compiler builds valid static pie C binaries... " >&2
         $CC ${staticLibc} -static-pie -o cc-static-pie ${./cc-main.c}
         ./cc-static-pie