Bug 104660 - Makefile.in has embedded dependencies of libatomic and libbacktrace for libgo, causing GNU/Hurd build to fail.
Summary: Makefile.in has embedded dependencies of libatomic and libbacktrace for libgo...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2022-02-23 10:44 UTC by Svante Signell
Modified: 2022-02-23 14:05 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-02-23 00:00:00


Attachments
Patch of src/Makefile.in (288 bytes, patch)
2022-02-23 10:44 UTC, Svante Signell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Svante Signell 2022-02-23 10:44:12 UTC
Created attachment 52497 [details]
Patch of src/Makefile.in

Hello,

The generated file Makefile.in has embedded dependencies on libatomic and libbacktrace preventing them to be built before libgo:

The dependency of libffi:
all-target-libgo: maybe-all-target-libffi
is outside any conditionals but libbacktrace and libatomic is not:
@unless gcc-bootstrap
...
all-target-libgo: maybe-all-target-libbacktrace
all-target-libgo: maybe-all-target-libatomic
...
@endunless gcc-bootstrap

Due to this condition the generated build/Makefile does not contain the dependencies on libatomic and libbacktrace, causing the build to fail on GNU/Hurd.

Generating a new version of Makefile.in by:
(cd source; autogen Makefile.def)
does not solve the problem: the same buggy build/Makefile is created.

Attached is a patch to move the dependencies outside of the conditional. However, since Makefile.in is generated the problem lies in Makefile.def/Makefile.tpl.

Unfortunately not much is documented on this conditional pair: @unless, @endunless

Thanks!
Comment 1 Richard Biener 2022-02-23 14:05:08 UTC
Well, that's because of

dependencies = { module=all-target-libgo; on=all-target-libbacktrace; };
dependencies = { module=all-target-libgo; on=all-target-libffi; };
dependencies = { module=all-target-libgo; on=all-target-libatomic; };

the reason the dependency is conditional is that libgo is not bootstrapped
(and so is libffi) but libbacktrace and libatomic are.

There might be an error in Makefile.tpl but maybe you can elaborate on the
exact issue that prevents you to build on GNU/Hurd?  How do you configure
there?  When I configure with --disable-bootstrap I do have all required
dependencies in the toplevel Makefile.  When I configure with bootstrapping
the the toplevel Makefile will not build libgo during stage1 but indeed
the all-target-libgo target seems to miss a dependency on maybe-all-stage3-target-libbacktrace.

IIRC the "usual" workaround is to build a non-bootstrapped target library
as well here.

I guess I've never run into this because when I'm building go I'm also
building other bootstrapped target libs that build libbacktrace and libatomic.