From e3b1937baf008bea6bb60ff3f384a012e7c58531 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 18 Jun 2018 15:05:23 -0400 Subject: [PATCH] tests.cc-wrapper: Fix sanitizer condition fc9644d4c9c9d29958e9bcf1676d48d4b3026bb4 accidentally enabled the sanitizer tests for GCC on Darwin, when fixing that case was never attempted. Also inverted the condition from broken to working for clarity. --- pkgs/test/cc-wrapper/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix index dd41cd157cae..f9c6e9e77796 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