Merge pull request #42175 from obsidiansystems/gcc-darwin-sanitizer-still-fail

tests.cc-wrapper: Fix sanitizer condition

authored by John Ericson and committed by GitHub 4627f071 e09c6e47

+4 -2
+4 -2
pkgs/test/cc-wrapper/default.nix
··· 3 3 let 4 4 # Sanitizers are not supported on Darwin. 5 5 # Sanitizer headers aren't available in older libc++ stdenvs due to a bug 6 - sanitizersBroken = stdenv.cc.isClang && versionOlder (getVersion stdenv.cc.name) "6.0.0"; 6 + sanitizersWorking = 7 + (stdenv.cc.isClang && versionAtLeast (getVersion stdenv.cc.name) "6.0.0") 8 + || (stdenv.cc.isGNU && stdenv.isLinux); 7 9 in stdenv.mkDerivation { 8 10 name = "cc-wrapper-test"; 9 11 ··· 43 45 NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c} 44 46 ./ldflags-check 45 47 46 - ${optionalString (!sanitizersBroken) '' 48 + ${optionalString sanitizersWorking '' 47 49 printf "checking whether sanitizers are fully functional... ">&2 48 50 $CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c} 49 51 ./sanitizers