Subject: [bug#50174] [PATCH core-updates-frozen 1/2] gnu: make-bootstrap: Fix build of static gawk.

From: Thiago Jung Bauermann <[email-masked]>
Date: Tue, 28 Sep 2021 22:59:27 -0300

Hello Ludo,

Em terça-feira, 28 de setembro de 2021, às 19:19:04 -03, Ludovic Courtès 
escreveu:
> Thiago Jung Bauermann <[email-masked]> skribis:
> > Em segunda-feira, 27 de setembro de 2021, às 18:38:45 -03, Ludovic
> > Courtès> 
> > escreveu:
> >> Thiago Jung Bauermann <[email-masked]> skribis:
> >> > gawk for ‘static-binaries-tarball’ is failing to build natively, at
> >> > least for x86_64-linux¹ and powerpc64le-linux. On both of them, the
> >> > problem is the same:
> >> > 
> >> > ld: ext.o: in function `load_ext':
> >> > /tmp/guix-build-gawk-5.1.0.drv-0/gawk-5.1.0/ext.c:59: warning: Using
> >> > 'dlopen' in statically linked applications requires at runtime the
> >> > shared libraries from the glibc version used for linking ld:
> >> > /gnu/store/qmgsfxm3ad5n7bi947n7xw0wq86blqr9-glibc-2.33-static/lib/li
> >> > bc
> >> > .a(getopt.o): in function `_getopt_internal_r': (.text+0x6e0):
> >> > multiple
> >> > definition of `_getopt_internal_r';
> >> > support/libsupport.a(getopt.o):/tmp/guix-build-gawk-5.1.0.drv-0/gawk
> >> > -5
> >> > .1.0/support/getopt.c:404: first defined here
> >> 
> >> I don’t see that on x86_64/i686:
> >> 
> >> --8<---------------cut here---------------start------------->8---
> >> $ ./pre-inst-env  guix weather bootstrap-tarballs -s x86_64-linux -s
> >> i686-linux> 
> > I’m using the package ‘static-binaries-tarball’ to expose the issue.
> > IIUC, the static binaries (of which ‘gawk-static’ is one) aren’t used
> > for bootstrapping on i686-linux and x86_64-linux so you won’t see this
> > problem with ‘bootstrap-tarballs’ on those platforms.
> > 
> >> -s aarch64-linux -s armhf-linux
> > 
> > OTOH, these platforms do use the static binaries. For some reason which
> > TBH I didn’t try to investigate, ‘gawk-static’ cross-builds correctly
> > so you’ll only see this problem on native builds of
> > ‘bootstrap-tarballs’ or ‘static-binaries-tarball’.
> Oooh, my bad, sorry for the confusion.

No problem!
 
> >> Substitutes are missing for the following items:
> >>   /gnu/store/3c8gbn2gljj48wihs9h3nxmfwix55wrn-bootstrap-tarballs-0
> >>   
> >>        armhf-linux
> >> 
> >> /gnu/store/8b6rznm54l6drbs6qfca5bi8yjqbx51f-bootstrap-tarballs-0
> >> 
> >>       aarch64-linux
> > 
> > Doesn’t this mean that there is indeed a problem with
> > ‘bootstrap-tarballs’ on these platforms?
> 
> Yes, it does!  But I thought it might be “something else”.
> 
> I fixed it slightly differently in
> 7d30e6e5c21f5e0b79f73428414fef2dbf75e7a6, followed by the second patch
> you had here. 

Your solution is better indeed. Thanks!

> Let’s see how far that brings us towards ’static-binaries-tarball’.

According to the CI, x86_64-linux and i686-linux are fixed now. aarch64-
linux failed but that’s because of a bug in QEMU. powerpc64-linux is 
scheduled to build but there’s a backlog in the CI for some reason.

> Thank you & sorry for the delay!

No problem at all. Thank you for fixing this problem!

-- 
Thanks,
Thiago