···91 params=("${rest[@]}")
92fi
9394+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+108if [[ "$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
···70fi
71720000000000000073# Add the flags for the GNAT compiler proper.
74extraAfter=($NIX_GNATFLAGS_COMPILE)
75extraBefore=()
···70fi
717273+# 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.
88extraAfter=($NIX_GNATFLAGS_COMPILE)
89extraBefore=()
···23 commonPreHook =
24 ''
25 export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
026 ${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=
019 '';
2021 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 '';
2122 prehookFreeBSD = ''