|
|
|
@ -72,6 +72,11 @@ let majorVersion = "11"; |
|
|
|
|
++ optional langFortran ../gfortran-driving.patch |
|
|
|
|
++ optional (targetPlatform.libc == "musl" && targetPlatform.isPower) ../ppc-musl.patch |
|
|
|
|
|
|
|
|
|
++ optional (stdenv.isDarwin && stdenv.isAarch64) (fetchpatch { |
|
|
|
|
url = "https://github.com/fxcoudert/gcc/compare/releases/gcc-11.1.0...gcc-11.1.0-arm-20210504.diff"; |
|
|
|
|
sha256 = "sha256-JqCGJAfbOxSmkNyq49aFHteK/RFsCSLQrL9mzUCnaD0="; |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
# Obtain latest patch with ../update-mcfgthread-patches.sh |
|
|
|
|
++ optional (!crossStageStatic && targetPlatform.isMinGW) ./Added-mcf-thread-model-support-from-mcfgthread.patch; |
|
|
|
|
|
|
|
|
@ -103,9 +108,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 +125,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'. |
|
|
|
|