forked from mirrors/nixpkgs
Merge pull request #42175 from obsidiansystems/gcc-darwin-sanitizer-still-fail
tests.cc-wrapper: Fix sanitizer condition
This commit is contained in:
commit
4627f0719d
|
@ -3,7 +3,9 @@ with stdenv.lib;
|
||||||
let
|
let
|
||||||
# Sanitizers are not supported on Darwin.
|
# Sanitizers are not supported on Darwin.
|
||||||
# Sanitizer headers aren't available in older libc++ stdenvs due to a bug
|
# 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 {
|
in stdenv.mkDerivation {
|
||||||
name = "cc-wrapper-test";
|
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}
|
NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c}
|
||||||
./ldflags-check
|
./ldflags-check
|
||||||
|
|
||||||
${optionalString (!sanitizersBroken) ''
|
${optionalString sanitizersWorking ''
|
||||||
printf "checking whether sanitizers are fully functional... ">&2
|
printf "checking whether sanitizers are fully functional... ">&2
|
||||||
$CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c}
|
$CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c}
|
||||||
./sanitizers
|
./sanitizers
|
||||||
|
|
Loading…
Reference in a new issue