lol

tests.cc-wrapper: verify building with sanitizers

authored by

Benjamin Saunders and committed by
John Ericson
46eeef18 16da44b5

+16 -2
+2 -2
pkgs/build-support/cc-wrapper/default.nix
··· 9 9 , stdenvNoCC, nativeTools, propagateDoc ? !nativeTools, noLibc ? false, nativeLibc, nativePrefix ? "" 10 10 , cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell 11 11 , extraPackages ? [], extraBuildCommands ? "" 12 - , isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null 12 + , isGNU ? false, isClang ? cc.isClang or false, isCompilerRT ? false, gnugrep ? null 13 13 , buildPackages ? {} 14 14 }: 15 15 ··· 90 90 # Binutils, and Apple's "cctools"; "bintools" as an attempt to find an 91 91 # unused middle-ground name that evokes both. 92 92 inherit bintools; 93 - inherit libc nativeTools nativeLibc nativePrefix isGNU isClang default_cxx_stdlib_compile; 93 + inherit libc nativeTools nativeLibc nativePrefix isGNU isClang isCompilerRT default_cxx_stdlib_compile; 94 94 95 95 emacsBufferSetup = pkgs: '' 96 96 ; We should handle propagation here too
+1
pkgs/development/compilers/llvm/6/default.nix
··· 53 53 targetLlvmLibraries.libcxxabi 54 54 targetLlvmLibraries.compiler-rt 55 55 ]; 56 + isCompilerRT = true; 56 57 extraBuildCommands = '' 57 58 rsrc="$out/resource-root" 58 59 mkdir "$rsrc"
+5
pkgs/test/cc-wrapper/default.nix
··· 38 38 39 39 NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c} 40 40 ./ldflags-check 41 + '' + stdenv.lib.optionalString (stdenv.cc.isCompilerRT or false) '' 42 + 43 + $CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c} 44 + ./sanitizers 45 + '' + '' 41 46 42 47 touch $out 43 48 '';
+8
pkgs/test/cc-wrapper/sanitizers.c
··· 1 + #include <sanitizer/asan_interface.h> 2 + #include <stdio.h> 3 + 4 + int main(int argc, char **argv) 5 + { 6 + fprintf(stderr, "ok\n"); 7 + return 0; 8 + }