1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

top-level: Common subexpression elimination for cc-wrapper usage

- `ccWrapperFun` can be used in a few more places instead of
   duplicating its definition.

 - `ccWrapper` parameter on `wrapCC` is always substituted with
   `ccWrapperFun` so just get rid of that parameter.
This commit is contained in:
John Ericson 2017-02-14 21:50:36 -05:00
parent 863d79b364
commit bef5278664

View file

@ -1636,7 +1636,7 @@ with pkgs;
emscripten = callPackage ../development/compilers/emscripten { };
emscriptenfastcomp-unwrapped = callPackage ../development/compilers/emscripten-fastcomp { };
emscriptenfastcomp-wrapped = wrapCCWith ccWrapperFun stdenv.cc.libc ''
emscriptenfastcomp-wrapped = wrapCCWith stdenv.cc.libc ''
# hardening flags break WASM support
cat > $out/nix-support/add-hardening.sh
'' emscriptenfastcomp-unwrapped;
@ -4885,7 +4885,7 @@ with pkgs;
clangSelf = clangWrapSelf llvmPackagesSelf.clang;
clangWrapSelf = build: callPackage ../build-support/cc-wrapper {
clangWrapSelf = build: ccWrapperFun {
cc = build;
isClang = true;
stdenv = clangStdenv;
@ -4954,8 +4954,8 @@ with pkgs;
extraBuildCommands = ''
echo "dontMoveLib64=1" >> $out/nix-support/setup-hook
'';
in wrapCCWith (callPackage ../build-support/cc-wrapper) glibc_multi extraBuildCommands (cc.cc.override {
stdenv = overrideCC stdenv (wrapCCWith (callPackage ../build-support/cc-wrapper) glibc_multi "" cc.cc);
in wrapCCWith glibc_multi extraBuildCommands (cc.cc.override {
stdenv = overrideCC stdenv (wrapCCWith glibc_multi "" cc.cc);
profiledCompiler = false;
enableMultilib = true;
}))
@ -5713,7 +5713,7 @@ with pkgs;
wla-dx = callPackage ../development/compilers/wla-dx { };
wrapCCWith = ccWrapper: libc: extraBuildCommands: baseCC: ccWrapper {
wrapCCWith = libc: extraBuildCommands: baseCC: ccWrapperFun {
nativeTools = stdenv.cc.nativeTools or false;
nativeLibc = stdenv.cc.nativeLibc or false;
nativePrefix = stdenv.cc.nativePrefix or "";
@ -5726,7 +5726,7 @@ with pkgs;
ccWrapperFun = callPackage ../build-support/cc-wrapper;
wrapCC = wrapCCWith ccWrapperFun stdenv.cc.libc "";
wrapCC = wrapCCWith stdenv.cc.libc "";
# legacy version, used for gnat bootstrapping
wrapGCC-old = baseGCC: callPackage ../build-support/gcc-wrapper-old {
nativeTools = stdenv.cc.nativeTools or false;