Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6d1287860d46
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79762fcb4a53
Choose a head ref
  • 2 commits
  • 6 files changed
  • 2 contributors

Commits on May 5, 2021

  1. gcc6, gcc7, gcc8, gcc9, gcc10, gcc11: do not modify code in prePatch

    Doing any modifications before patching risks invalidating patch base.
    bobrik committed May 5, 2021
    Copy the full SHA
    99d0c00 View commit details

Commits on May 11, 2021

  1. Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    79762fc View commit details
18 changes: 9 additions & 9 deletions pkgs/development/compilers/gcc/10/default.nix
Original file line number Diff line number Diff line change
@@ -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'.
18 changes: 9 additions & 9 deletions pkgs/development/compilers/gcc/11/default.nix
Original file line number Diff line number Diff line change
@@ -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'.
9 changes: 4 additions & 5 deletions pkgs/development/compilers/gcc/6/default.nix
Original file line number Diff line number Diff line change
@@ -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;
18 changes: 9 additions & 9 deletions pkgs/development/compilers/gcc/7/default.nix
Original file line number Diff line number Diff line change
@@ -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'.
18 changes: 9 additions & 9 deletions pkgs/development/compilers/gcc/8/default.nix
Original file line number Diff line number Diff line change
@@ -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'.
18 changes: 9 additions & 9 deletions pkgs/development/compilers/gcc/9/default.nix
Original file line number Diff line number Diff line change
@@ -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'.