From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A1DFA3858C66; Sun, 21 Apr 2024 04:08:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1DFA3858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713672515; bh=f0VjhHsUhDes627JKM7iy8KMhOZ+NonmnTkC//ciOOI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RyhxCooji+XPow/dB1YFP7k64sAnU9iAOGYAeUMvODqZ2CESUOe8KkK7qsDh4rEvh zF1CHiefmTL7r5e1Cyuy0fnSsksC1DeDBotBFNrpjdC111X7kQgYsfaDwO1qYSpbhn tAu2EJnaqnhK8fnk6SVPFx1iPUL0OdDGpn1+1ceM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/106472] No rule to make target '../libbacktrace/libbacktrace.la', needed by 'libgo.la'. Date: Sun, 21 Apr 2024 04:08:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106472 --- Comment #39 from GCC Commits --- The releases/gcc-13 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:cb277dea557aaa25fdced201f7c45c753c709dfa commit r13-8623-gcb277dea557aaa25fdced201f7c45c753c709dfa Author: Jakub Jelinek Date: Tue Apr 2 13:40:27 2024 +0200 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 accou= nt 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 bloc= k, while for @if gcc-bootstrap it just emits configure-target-whatever: stage_last dependencies which ensure those postbootstrap target modules are only b= uilt after everything that is bootstrapped has been. Now, the libbacktrace/libatomic target modules have bootstrap=3Dtrue target_modules =3D { module=3D libbacktrace; bootstrap=3Dtrue; }; target_modules =3D { module=3D libatomic; bootstrap=3Dtrue; lib_path=3D= .libs; }; because those modules are dependencies of libphobos target module, so when d is included among bootstrapped languages, those are all bootstra= pped and everything works correctly. While if d is not included, libphobos target module is disabled, libbacktrace/libatomic target modules aren't bootstrapped, nothing duri= ng 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 depe= nds 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=3Dc,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=3Ddefault,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 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. (cherry picked from commit 9a5e4aade2b847c5262577a1490ce6f3df9a9841)=