about summary refs log tree commit diff
path: root/pkgs/test/cc-wrapper
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2020-12-14 20:53:00 +0100
committerJörg Thalheim <joerg@thalheim.io>2020-12-14 20:53:00 +0100
commitb39dd890acdef42e944a9cb9184fe63331dfbb3c (patch)
tree3c326f5066c5833ca6c6cecf72715f29e120a17b /pkgs/test/cc-wrapper
parent7a06f5dd59a0c05568621be3afb0f57df2f696f1 (diff)
tests.cc-wrapper: disable static compilation macOS
macOS does not support this
Diffstat (limited to 'pkgs/test/cc-wrapper')
-rw-r--r--pkgs/test/cc-wrapper/default.nix19
1 files changed, 11 insertions, 8 deletions
diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix
index 141a5320ef531..fae3448c44c6e 100644
--- a/pkgs/test/cc-wrapper/default.nix
+++ b/pkgs/test/cc-wrapper/default.nix
@@ -30,14 +30,17 @@ in stdenv.mkDerivation {
       ./core-foundation-check
     ''}
 
-    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.
-    ${optionalString (stdenv.hostPlatform.isMusl && stdenv.cc.isGNU) ''
-      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
+
+    ${optionalString (!stdenv.isDarwin) ''
+      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.
+      ${optionalString (stdenv.hostPlatform.isMusl && stdenv.cc.isGNU) ''
+        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
+      ''}
     ''}
 
     printf "checking whether compiler uses NIX_CFLAGS_COMPILE... " >&2