Go to file
Jakub Jelinek 9a5e4aade2 Fix up postboot dependencies [PR106472]
On Wed, Mar 13, 2024 at 10:13:37AM +0100, Jakub Jelinek wrote:
> While the first Makefile.tpl hunk looks obviously ok, the others look
> completely wrong to me.
> There is nothing special about libgo vs. libbacktrace/libatomic
> compared to any other target library which is not bootstrapped vs. any
> of its dependencies which are in the bootstrapped set.
> So, Makefile.tpl shouldn't hardcode such dependencies.

Here is my version of the fix.
The dependencies in the toplevel Makefile simply didn't take into account
that some target modules could be in a bootstrapped build built in some
configurations as bootstrap modules (typically as dependencies of other
target bootstrap modules), while in other configurations just as
dependencies of non-bootstrap target modules and so not built during the
bootstrap, but after it.
Makefile.tpl arranges for those postboot target module -> target module
dependencies to be emitted only inside of an @unless gcc-bootstrap block,
while for @if gcc-bootstrap it just emits
configure-target-whatever: stage_last
dependencies which ensure those postbootstrap target modules are only built
after everything that is bootstrapped has been.

Now, the libbacktrace/libatomic target modules have bootstrap=true
target_modules = { module= libbacktrace; bootstrap=true; };
target_modules = { module= libatomic; bootstrap=true; lib_path=.libs; };
because those modules are dependencies of libphobos target module, so
when d is included among bootstrapped languages, those are all bootstrapped
and everything works correctly.
While if d is not included, libphobos target module is disabled,
libbacktrace/libatomic target modules aren't bootstrapped, nothing during
bootstrap needs them, but post bootstrap libgo target module depends on
the libatomic and libbacktrace target modules, libgfortran target module
depends on the libbacktrace target module and libgm2 target module depends
on the libatomic target module, but those dependencies were emitted only
@unless gcc-bootstrap.  There is a similar theoretical problem for zlib
target module if GCJ would be ressurected, libphobos as bootstrap target
module depends on the zlib target module, but if d is not configured,
fastjar also depends on it.

The following patch arranges for the @if gcc-bootstrap case to emit also
target module -> target module dependencies, but conditionally on the
on dependency not being bootstrapped.

In the generated Makefile.in you can see what the Makefile.tpl change
produces and that it just adds extra dependencies which weren't there
before in the @if gcc-bootstrap case.

I've bootstrapped without this patch with
../configure --enable-languages=c,c++,go; make
on x86_64-linux (note, make -j2 or higher usually worked) which failed
as described in the PR, then with this patch with the same command which
built fine and the Makefile difference between the two builds being
diff -up obj40{a,b}/Makefile
--- obj40a/Makefile     2024-03-31 00:35:22.243791499 +0100
+++ obj40b/Makefile     2024-03-31 22:40:38.143299144 +0200
@@ -29376,6 +29376,14 @@ configure-bison: stage_last
 configure-flex: stage_last
 configure-m4: stage_last

+configure-target-fastjar: maybe-configure-target-zlib
+all-target-fastjar: maybe-all-target-zlib
+all-target-libgo: maybe-all-target-libbacktrace
+all-target-libgo: maybe-all-target-libatomic
+all-target-libgm2: maybe-all-target-libatomic
+configure-target-libgfortran: maybe-all-target-libbacktrace
+configure-target-libgo: maybe-all-target-libbacktrace
+

 # Dependencies for target modules on other target modules are
 # described by lang_env_dependencies; the defaults apply to anything

which I believe are exactly the extra dependencies we want.
Plus I've done normal x86_64-linux and i686-linux bootstraps/regtests
which in my case include --enable-languages=default,ada,obj-c++,lto,go,d,rust,m2
for x86_64 and the same except ada for i686; those with my usual make -j32.
The Makefile difference in those builds vs. unpatched case
is just an extra empty line.

2024-04-02  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/106472
	* Makefile.tpl (make-postboot-target-dep): New lambda.
	Use it to add --enable-bootstrap dependencies of target modules
	on other target modules if the latter aren't bootstrapped.
	* Makefile.in: Regenerate.
2024-04-02 13:40:27 +02:00
.github Minor formatting fix for newly-added file from previous commit 2023-11-01 19:28:56 -04:00
INSTALL
c++tools Update copyright years. 2024-01-03 12:19:35 +01:00
config Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
contrib Daily bump. 2024-03-20 00:18:09 +00:00
fixincludes Daily bump. 2023-11-23 00:18:14 +00:00
gcc jit, Darwin: Implement library exports list. 2024-04-02 12:33:56 +01:00
gnattools Update Copyright year in ChangeLog files 2024-01-03 11:35:18 +01:00
gotools Daily bump. 2023-11-04 00:16:45 +00:00
include Daily bump. 2024-03-01 00:16:41 +00:00
libada Update copyright years. 2024-01-03 12:19:35 +01:00
libatomic Daily bump. 2024-02-15 00:17:50 +00:00
libbacktrace Daily bump. 2024-03-09 00:17:14 +00:00
libcc1 Daily bump. 2024-03-17 00:17:21 +00:00
libcody Update Copyright year in ChangeLog files 2024-01-03 11:35:18 +01:00
libcpp Daily bump. 2024-03-15 00:17:52 +00:00
libdecnumber Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libffi Daily bump. 2023-10-27 00:17:12 +00:00
libgcc Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libgfortran Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libgm2 Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libgo libgo: bump libgo version for GCC 14 release 2024-02-05 11:28:30 -08:00
libgomp Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libgrust Update copyright years. 2024-02-21 13:51:26 +01:00
libiberty Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libitm Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libobjc Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libphobos Daily bump. 2024-03-18 00:16:48 +00:00
libquadmath Daily bump. 2024-01-04 00:18:45 +00:00
libsanitizer Daily bump. 2024-02-17 00:17:08 +00:00
libssp Daily bump. 2024-02-07 00:18:31 +00:00
libstdc++-v3 Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
libvtv Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
lto-plugin Update copyright years. 2024-01-03 12:19:35 +01:00
maintainer-scripts Daily bump. 2023-11-14 12:23:39 +00:00
zlib Daily bump. 2023-10-23 00:16:43 +00:00
.dir-locals.el
.gitattributes
.gitignore *: add modern gettext 2023-11-14 00:47:11 +01:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Daily bump. 2024-03-09 00:17:14 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS: Fix order in Write After Aproval 2024-03-08 09:14:44 +01:00
Makefile.def gccrs: Fix missing build dependency 2024-01-16 16:23:02 +01:00
Makefile.in Fix up postboot dependencies [PR106472] 2024-04-02 13:40:27 +02:00
Makefile.tpl Fix up postboot dependencies [PR106472] 2024-04-02 13:40:27 +02:00
README
SECURITY.txt SECURITY.txt: Drop "exploitable" in reference to hardening issues 2024-01-09 10:49:01 -05:00
ar-lib
compile
config-ml.in LoongArch: Reimplement multilib build option handling. 2023-09-15 10:42:12 +08:00
config.guess
config.rpath
config.sub config.sub: change mode to 755. 2021-12-21 09:10:57 +01:00
configure LoongArch: Don't falsely claim gold supported in toplevel configure 2024-02-23 18:13:25 +08:00
configure.ac LoongArch: Don't falsely claim gold supported in toplevel configure 2024-02-23 18:13:25 +08:00
depcomp
install-sh
libtool-ldflags
libtool.m4 Build: fix error in fixinclude configure 2023-11-22 11:54:33 +01:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
symlink-tree
test-driver
ylwrap

README

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.