summary refs log tree commit diff
path: root/pkgs/test
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2018-06-18 15:24:37 -0400
committerGitHub <noreply@github.com>2018-06-18 15:24:37 -0400
commit4627f0719dcc73ccd10d421b05af35170324971d (patch)
tree9cc247ad2c5b2c6f08dedac9f171d999ae1d6bb1 /pkgs/test
parente09c6e47f1a526f185f2e3318d0da4cc97c36129 (diff)
parente3b1937baf008bea6bb60ff3f384a012e7c58531 (diff)
downloadnixpkgs-4627f0719dcc73ccd10d421b05af35170324971d.tar
nixpkgs-4627f0719dcc73ccd10d421b05af35170324971d.tar.gz
nixpkgs-4627f0719dcc73ccd10d421b05af35170324971d.tar.bz2
nixpkgs-4627f0719dcc73ccd10d421b05af35170324971d.tar.lz
nixpkgs-4627f0719dcc73ccd10d421b05af35170324971d.tar.xz
nixpkgs-4627f0719dcc73ccd10d421b05af35170324971d.tar.zst
nixpkgs-4627f0719dcc73ccd10d421b05af35170324971d.zip
Merge pull request #42175 from obsidiansystems/gcc-darwin-sanitizer-still-fail
tests.cc-wrapper: Fix sanitizer condition
Diffstat (limited to 'pkgs/test')
-rw-r--r--pkgs/test/cc-wrapper/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix
index dd41cd157ca..f9c6e9e7779 100644
--- a/pkgs/test/cc-wrapper/default.nix
+++ b/pkgs/test/cc-wrapper/default.nix
@@ -3,7 +3,9 @@ with stdenv.lib;
 let
   # Sanitizers are not supported on Darwin.
   # Sanitizer headers aren't available in older libc++ stdenvs due to a bug
-  sanitizersBroken = stdenv.cc.isClang && versionOlder (getVersion stdenv.cc.name) "6.0.0";
+  sanitizersWorking =
+       (stdenv.cc.isClang && versionAtLeast (getVersion stdenv.cc.name) "6.0.0")
+    || (stdenv.cc.isGNU && stdenv.isLinux);
 in stdenv.mkDerivation {
   name = "cc-wrapper-test";
 
@@ -43,7 +45,7 @@ in stdenv.mkDerivation {
     NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c}
     ./ldflags-check
 
-    ${optionalString (!sanitizersBroken) ''
+    ${optionalString sanitizersWorking ''
       printf "checking whether sanitizers are fully functional... ">&2
       $CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c}
       ./sanitizers