diff options
author | Vladimír Čunát <v@cunat.cz> | 2021-05-11 12:01:38 +0200 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2021-05-11 12:01:38 +0200 |
commit | 79762fcb4a536f947394bacd4de81acdf3707f38 (patch) | |
tree | bdced043960fc0cf7864fce2ab3825414907a5a9 | |
parent | 6d1287860d46af5e1857ea427c86192ddaff929d (diff) | |
parent | 99d0c004d1fdc7d74017f27e368a6f0bc1eb302e (diff) | |
download | nixpkgs-79762fcb4a536f947394bacd4de81acdf3707f38.tar nixpkgs-79762fcb4a536f947394bacd4de81acdf3707f38.tar.gz nixpkgs-79762fcb4a536f947394bacd4de81acdf3707f38.tar.bz2 nixpkgs-79762fcb4a536f947394bacd4de81acdf3707f38.tar.lz nixpkgs-79762fcb4a536f947394bacd4de81acdf3707f38.tar.xz nixpkgs-79762fcb4a536f947394bacd4de81acdf3707f38.tar.zst nixpkgs-79762fcb4a536f947394bacd4de81acdf3707f38.zip |
Merge #121772: gcc*: do not modify code in prePatch
-rw-r--r-- | pkgs/development/compilers/gcc/10/default.nix | 18 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/11/default.nix | 18 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/6/default.nix | 9 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/7/default.nix | 18 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/8/default.nix | 18 | ||||
-rw-r--r-- | pkgs/development/compilers/gcc/9/default.nix | 18 |
6 files changed, 49 insertions, 50 deletions
diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 2f7991a9212..93f8f278dc3 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -103,9 +103,15 @@ stdenv.mkDerivation ({ hardeningDisable = [ "format" "pie" ]; + postPatch = '' + configureScripts=$(find . -name configure) + for configureScript in $configureScripts; do + patchShebangs $configureScript + done + '' # This should kill all the stdinc frameworks that gcc and friends like to # insert into default search paths. - prePatch = lib.optionalString hostPlatform.isDarwin '' + + lib.optionalString hostPlatform.isDarwin '' substituteInPlace gcc/config/darwin-c.c \ --replace 'if (stdinc)' 'if (0)' @@ -114,14 +120,8 @@ stdenv.mkDerivation ({ substituteInPlace libgfortran/configure \ --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" - ''; - - postPatch = '' - configureScripts=$(find . -name configure) - for configureScript in $configureScripts; do - patchShebangs $configureScript - done - '' + ( + '' + + ( if targetPlatform != hostPlatform || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of # `/lib/ld*.so'. diff --git a/pkgs/development/compilers/gcc/11/default.nix b/pkgs/development/compilers/gcc/11/default.nix index 73f3d7b2a97..be058f357cd 100644 --- a/pkgs/development/compilers/gcc/11/default.nix +++ b/pkgs/development/compilers/gcc/11/default.nix @@ -103,9 +103,15 @@ stdenv.mkDerivation ({ hardeningDisable = [ "format" "pie" ]; + postPatch = '' + configureScripts=$(find . -name configure) + for configureScript in $configureScripts; do + patchShebangs $configureScript + done + '' # This should kill all the stdinc frameworks that gcc and friends like to # insert into default search paths. - prePatch = lib.optionalString hostPlatform.isDarwin '' + + lib.optionalString hostPlatform.isDarwin '' substituteInPlace gcc/config/darwin-c.c \ --replace 'if (stdinc)' 'if (0)' @@ -114,14 +120,8 @@ stdenv.mkDerivation ({ substituteInPlace libgfortran/configure \ --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" - ''; - - postPatch = '' - configureScripts=$(find . -name configure) - for configureScript in $configureScripts; do - patchShebangs $configureScript - done - '' + ( + '' + + ( if targetPlatform != hostPlatform || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of # `/lib/ld*.so'. diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 32a4ad0dd09..4e2a7d5e15f 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -154,7 +154,7 @@ stdenv.mkDerivation ({ hardeningDisable = [ "format" "pie" ]; - prePatch = + postPatch = # This should kill all the stdinc frameworks that gcc and friends like to # insert into default search paths. lib.optionalString hostPlatform.isDarwin '' @@ -166,9 +166,8 @@ stdenv.mkDerivation ({ substituteInPlace libgfortran/configure \ --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" - ''; - - postPatch = + '' + + ( if targetPlatform != hostPlatform || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of # `/lib/ld*.so'. @@ -191,7 +190,7 @@ stdenv.mkDerivation ({ sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR' '' ) - else null; + else ""); inherit noSysDirs staticCompiler langJava crossStageStatic libcCross crossMingw; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 33edc81ce53..28984887a95 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -114,9 +114,15 @@ stdenv.mkDerivation ({ hardeningDisable = [ "format" "pie" ]; + postPatch = '' + configureScripts=$(find . -name configure) + for configureScript in $configureScripts; do + patchShebangs $configureScript + done + '' # This should kill all the stdinc frameworks that gcc and friends like to # insert into default search paths. - prePatch = lib.optionalString hostPlatform.isDarwin '' + + lib.optionalString hostPlatform.isDarwin '' substituteInPlace gcc/config/darwin-c.c \ --replace 'if (stdinc)' 'if (0)' @@ -125,14 +131,8 @@ stdenv.mkDerivation ({ substituteInPlace libgfortran/configure \ --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" - ''; - - postPatch = '' - configureScripts=$(find . -name configure) - for configureScript in $configureScripts; do - patchShebangs $configureScript - done - '' + ( + '' + + ( if targetPlatform != hostPlatform || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of # `/lib/ld*.so'. diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index dae98afccb9..d811d1b3c73 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -101,9 +101,15 @@ stdenv.mkDerivation ({ hardeningDisable = [ "format" "pie" ]; + postPatch = '' + configureScripts=$(find . -name configure) + for configureScript in $configureScripts; do + patchShebangs $configureScript + done + '' # This should kill all the stdinc frameworks that gcc and friends like to # insert into default search paths. - prePatch = lib.optionalString hostPlatform.isDarwin '' + + lib.optionalString hostPlatform.isDarwin '' substituteInPlace gcc/config/darwin-c.c \ --replace 'if (stdinc)' 'if (0)' @@ -112,14 +118,8 @@ stdenv.mkDerivation ({ substituteInPlace libgfortran/configure \ --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" - ''; - - postPatch = '' - configureScripts=$(find . -name configure) - for configureScript in $configureScripts; do - patchShebangs $configureScript - done - '' + ( + '' + + ( if targetPlatform != hostPlatform || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of # `/lib/ld*.so'. diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index ebe20e0cba5..a0115b6f74e 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -117,9 +117,15 @@ stdenv.mkDerivation ({ hardeningDisable = [ "format" "pie" ]; + postPatch = '' + configureScripts=$(find . -name configure) + for configureScript in $configureScripts; do + patchShebangs $configureScript + done + '' # This should kill all the stdinc frameworks that gcc and friends like to # insert into default search paths. - prePatch = lib.optionalString hostPlatform.isDarwin '' + + lib.optionalString hostPlatform.isDarwin '' substituteInPlace gcc/config/darwin-c.c \ --replace 'if (stdinc)' 'if (0)' @@ -128,14 +134,8 @@ stdenv.mkDerivation ({ substituteInPlace libgfortran/configure \ --replace "-install_name \\\$rpath/\\\$soname" "-install_name ''${!outputLib}/lib/\\\$soname" - ''; - - postPatch = '' - configureScripts=$(find . -name configure) - for configureScript in $configureScripts; do - patchShebangs $configureScript - done - '' + ( + '' + + ( if targetPlatform != hostPlatform || stdenv.cc.libc != null then # On NixOS, use the right path to the dynamic linker instead of # `/lib/ld*.so'. |