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