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