gcc: install info files serially

installing info files in parallel is dangerous, because
`install-info` will write to a `dir-file` as a side-effect,
and it has no protection against multiple `install-info`
processes running in parallel and overwriting each others'
changes.

Local fix until we can fix the `Makefile.in` generation
upstream

Fixes #229470
This commit is contained in:
Arnout Engelen 2023-05-04 14:57:50 +02:00
parent da45bf6ec7
commit f3995cee01
No known key found for this signature in database
GPG key ID: 061107B0F74A6DAA
10 changed files with 24 additions and 0 deletions

View file

@ -59,6 +59,7 @@ let majorVersion = "10";
sha256 = "0sd52c898msqg7m316zp0ryyj7l326cjcn2y19dcxqp15r74qj0g";
})
../11/fix-struct-redefinition-on-glibc-2.36.patch
../install-info-files-serially.patch
] ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
++ optional (noSysDirs && hostPlatform.isRiscV) ../no-sys-dirs-riscv.patch

View file

@ -63,6 +63,7 @@ let majorVersion = "11";
sha256 = "0sd52c898msqg7m316zp0ryyj7l326cjcn2y19dcxqp15r74qj0g";
})
./fix-struct-redefinition-on-glibc-2.36.patch
../install-info-files-serially.patch
] ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
++ optional (noSysDirs && hostPlatform.isRiscV) ../no-sys-dirs-riscv.patch

View file

@ -68,6 +68,7 @@ let majorVersion = "12";
../gnat-cflags-11.patch
../gcc-12-gfortran-driving.patch
../ppc-musl.patch
../install-info-files-serially.patch
]
# We only apply this patch when building a native toolchain for aarch64-darwin, as it breaks building
# a foreign one: https://github.com/iains/gcc-12-branch/issues/18

View file

@ -74,6 +74,7 @@ let majorVersion = "4";
../struct-ucontext-4.8.patch
../sigsegv-not-declared.patch
../res_state-not-declared.patch
../install-info-files-serially.patch
# gcc-11 compatibility
(fetchpatch {
name = "gcc4-char-reload.patch";

View file

@ -63,6 +63,7 @@ let majorVersion = "4";
[ ../9/fix-struct-redefinition-on-glibc-2.36.patch ../use-source-date-epoch.patch
../parallel-bconfig.patch ./parallel-strsignal.patch
./libsanitizer.patch
../install-info-files-serially.patch
(fetchpatch {
name = "avoid-ustat-glibc-2.28.patch";
url = "https://gitweb.gentoo.org/proj/gcc-patches.git/plain/4.9.4/gentoo/100_all_avoid-ustat-glibc-2.28.patch?id=55fcb515620a8f7d3bb77eba938aa0fcf0d67c96";

View file

@ -72,6 +72,7 @@ let majorVersion = "6";
url = "https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=de31f5445b12fd9ab9969dc536d821fe6f0edad0";
sha256 = "0sd52c898msqg7m316zp0ryyj7l326cjcn2y19dcxqp15r74qj0g";
})
../install-info-files-serially.patch
] ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional noSysDirs ../no-sys-dirs.patch
++ optional langAda ../gnat-cflags.patch

View file

@ -65,6 +65,7 @@ let majorVersion = "7";
})
../9/fix-struct-redefinition-on-glibc-2.36.patch
../install-info-files-serially.patch
]
++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optionals targetPlatform.isNetBSD [

View file

@ -54,6 +54,7 @@ let majorVersion = "8";
sha256 = "0sd52c898msqg7m316zp0ryyj7l326cjcn2y19dcxqp15r74qj0g";
})
../9/fix-struct-redefinition-on-glibc-2.36.patch
../install-info-files-serially.patch
] ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional targetPlatform.isNetBSD ../libstdc++-netbsd-ctypes.patch
++ optional noSysDirs ../no-sys-dirs.patch

View file

@ -63,6 +63,7 @@ let majorVersion = "9";
url = "https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=de31f5445b12fd9ab9969dc536d821fe6f0edad0";
sha256 = "0sd52c898msqg7m316zp0ryyj7l326cjcn2y19dcxqp15r74qj0g";
})
../install-info-files-serially.patch
] ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch
++ optional targetPlatform.isNetBSD ../libstdc++-netbsd-ctypes.patch
++ optional noSysDirs ../no-sys-dirs.patch

View file

@ -0,0 +1,15 @@
diff -Naur gcc-12.2.0/gcc/Makefile.in gcc-12.2.0-new/gcc/Makefile.in
--- gcc-12.2.0/gcc/Makefile.in 2022-08-19 10:09:52.280658631 +0200
+++ gcc-12.2.0-new/gcc/Makefile.in 2023-05-04 14:35:44.401420184 +0200
@@ -3781,6 +3781,11 @@
fi; \
fi
+# We don't care about the order in which the info files are built, but
+# install-info doesn't support multiple parallel invocations writing to
+# the same `dir-file`, so we have to disable parallelism for that reason:
+.NOTPARALLEL: install-info
+
# Install the info files.
# $(INSTALL_DATA) might be a relative pathname, so we can't cd into srcdir
# to do the install.