Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

cc-wrapper: add option to skip flags for native optimizations

+32 -21
+14
pkgs/build-support/cc-wrapper/cc-wrapper.sh
··· 91 params=("${rest[@]}") 92 fi 93 94 if [[ "$isCpp" = 1 ]]; then 95 NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}" 96 NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK"
··· 91 params=("${rest[@]}") 92 fi 93 94 + 95 + # Clear march/mtune=native -- they bring impurity. 96 + if [ "$NIX_ENFORCE_NO_NATIVE" = 1 ]; then 97 + rest=() 98 + for i in "${params[@]}"; do 99 + if [[ "$i" = -m*=native ]]; then 100 + skip $i 101 + else 102 + rest=("${rest[@]}" "$i") 103 + fi 104 + done 105 + params=("${rest[@]}") 106 + fi 107 + 108 if [[ "$isCpp" = 1 ]]; then 109 NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${NIX_CXXSTDLIB_COMPILE-@default_cxx_stdlib_compile@}" 110 NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK $NIX_CXXSTDLIB_LINK"
+14
pkgs/build-support/cc-wrapper/gnat-wrapper.sh
··· 70 fi 71 72 73 # Add the flags for the GNAT compiler proper. 74 extraAfter=($NIX_GNATFLAGS_COMPILE) 75 extraBefore=()
··· 70 fi 71 72 73 + # Clear march/mtune=native -- they bring impurity. 74 + if [ "$NIX_ENFORCE_NO_NATIVE" = 1 ]; then 75 + rest=() 76 + for i in "${params[@]}"; do 77 + if [[ "$i" = -m*=native ]]; then 78 + skip $i 79 + else 80 + rest=("${rest[@]}" "$i") 81 + fi 82 + done 83 + params=("${rest[@]}") 84 + fi 85 + 86 + 87 # Add the flags for the GNAT compiler proper. 88 extraAfter=($NIX_GNATFLAGS_COMPILE) 89 extraBefore=()
-1
pkgs/development/libraries/crypto++/default.nix
··· 25 '' 26 sed -i GNUmakefile \ 27 -e 's|-march=native|${marchflags} -fPIC|g' \ 28 - -e 's|-mtune=native||g' \ 29 -e '/^CXXFLAGS =/s|-g ||' 30 ''; 31
··· 25 '' 26 sed -i GNUmakefile \ 27 -e 's|-march=native|${marchflags} -fPIC|g' \ 28 -e '/^CXXFLAGS =/s|-g ||' 29 ''; 30
-9
pkgs/misc/emulators/higan/0001-change-flags.diff
··· 11 objects := libco 12 13 # profile-guided optimization mode 14 - @@ -43,7 +44,7 @@ ifeq ($(platform),windows) 15 - else ifeq ($(platform),macosx) 16 - flags += -march=native 17 - else ifeq ($(platform),linux) 18 - - flags += -march=native -fopenmp 19 - + flags += -fopenmp 20 - link += -fopenmp 21 - link += -Wl,-export-dynamic 22 - link += -lX11 -lXext -ldl 23 diff -rupN higan_v095-source.orig/icarus/GNUmakefile higan_v095-source/icarus/GNUmakefile 24 --- higan_v095-source.orig/icarus/GNUmakefile 2015-11-04 10:28:26.186486119 +0100 25 +++ higan_v095-source/icarus/GNUmakefile 2015-11-04 10:28:48.755059317 +0100
··· 11 objects := libco 12 13 # profile-guided optimization mode 14 diff -rupN higan_v095-source.orig/icarus/GNUmakefile higan_v095-source/icarus/GNUmakefile 15 --- higan_v095-source.orig/icarus/GNUmakefile 2015-11-04 10:28:26.186486119 +0100 16 +++ higan_v095-source/icarus/GNUmakefile 2015-11-04 10:28:48.755059317 +0100
+1
pkgs/stdenv/darwin/default.nix
··· 26 27 commonPreHook = '' 28 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" 29 export NIX_IGNORE_LD_THROUGH_GCC=1 30 stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" 31 export MACOSX_DEPLOYMENT_TARGET=10.7
··· 26 27 commonPreHook = '' 28 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" 29 + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" 30 export NIX_IGNORE_LD_THROUGH_GCC=1 31 stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" 32 export MACOSX_DEPLOYMENT_TARGET=10.7
+1
pkgs/stdenv/linux/default.nix
··· 23 commonPreHook = 24 '' 25 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" 26 ${if system == "x86_64-linux" then "NIX_LIB64_IN_SELF_RPATH=1" else ""} 27 ${if system == "mips64el-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""} 28 '';
··· 23 commonPreHook = 24 '' 25 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" 26 + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" 27 ${if system == "x86_64-linux" then "NIX_LIB64_IN_SELF_RPATH=1" else ""} 28 ${if system == "mips64el-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""} 29 '';
+1
pkgs/stdenv/native/default.nix
··· 16 # Disable purity tests; it's allowed (even needed) to link to 17 # libraries outside the Nix store (like the C library). 18 export NIX_ENFORCE_PURITY= 19 ''; 20 21 prehookFreeBSD = ''
··· 16 # Disable purity tests; it's allowed (even needed) to link to 17 # libraries outside the Nix store (like the C library). 18 export NIX_ENFORCE_PURITY= 19 + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" 20 ''; 21 22 prehookFreeBSD = ''
+1
pkgs/stdenv/nix/default.nix
··· 6 preHook = 7 '' 8 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" 9 export NIX_IGNORE_LD_THROUGH_GCC=1 10 ''; 11
··· 6 preHook = 7 '' 8 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" 9 + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" 10 export NIX_IGNORE_LD_THROUGH_GCC=1 11 ''; 12
-5
pkgs/tools/networking/pingtcp/default.nix
··· 13 14 nativeBuildInputs = [ cmake ]; 15 16 - postPatch = '' 17 - substituteInPlace {.,pfcquirks}/CMakeLists.txt \ 18 - --replace "-march=native" "" 19 - ''; 20 - 21 enableParallelBuilding = true; 22 23 doCheck = false;
··· 13 14 nativeBuildInputs = [ cmake ]; 15 16 enableParallelBuilding = true; 17 18 doCheck = false;
-6
pkgs/tools/security/crackxls/default.nix
··· 13 14 buildInputs = [ pkgconfig autoconf automake openssl libgsf gmp ]; 15 16 - patchPhase = '' 17 - substituteInPlace Makefile.in \ 18 - --replace '-march=native' "" \ 19 - --replace '-mtune=native' "" 20 - ''; 21 - 22 installPhase = 23 '' 24 mkdir -p $out/bin
··· 13 14 buildInputs = [ pkgconfig autoconf automake openssl libgsf gmp ]; 15 16 installPhase = 17 '' 18 mkdir -p $out/bin