From 166948d4794be5c56c6279bf580ac416b1bcf022 Mon Sep 17 00:00:00 2001 From: Jörg Thalheim Date: Sat, 22 May 2021 13:55:47 +0200 Subject: cc-wrapper: don't set rpath on static-pie executables --- pkgs/test/cc-wrapper/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pkgs/test') 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 -- cgit 1.4.1