GCC fails to cross-compile

  • Open
  • quality assurance status badge
Details
2 participants
  • Josselin Poiret
  • Pavel Shlyak
Owner
unassigned
Submitted by
Pavel Shlyak
Severity
normal
P
P
Pavel Shlyak wrote on 26 May 2022 19:21
(address . bug-guix@gnu.org)
3FE14B6E-5184-4DE2-AE0B-9CF068CCB1AD@pantherx.org
GCC fails to cross-compile. X86_64 host, aarch64 target.
Reproducer:
guix build gcc-toolchain --target=aarch64-linux-gnu
Log:
../../../gcc-12.1.0/libgcc/libgcc2.c: In function ‘__divsc3’:
../../../gcc-12.1.0/libgcc/libgcc2.c:1874:16: error: ‘__LIBGCC_SF_MAX__’ undeclared (first use in this function)
1874 | # define RBIG (__LIBGCC_SF_MAX__ / 2)
| ^~~~~~~~~~~~~~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:2063:23: note: in expansion of macro ‘RBIG’
2063 | if (FABS (d) >= RBIG)
| ^~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:1874:16: note: each undeclared identifier is reported only once for each function it appears in
1874 | # define RBIG (__LIBGCC_SF_MAX__ / 2)
| ^~~~~~~~~~~~~~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:2063:23: note: in expansion of macro ‘RBIG’
2063 | if (FABS (d) >= RBIG)
| ^~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:1876:17: error: ‘__LIBGCC_SF_EPSILON__’ undeclared (first use in this function)
1876 | # define RMIN2 (__LIBGCC_SF_EPSILON__)
| ^~~~~~~~~~~~~~~~~~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:2073:22: note: in expansion of macro ‘RMIN2’
2073 | if (FABS (d) < RMIN2)
| ^~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:1875:16: error: ‘__LIBGCC_SF_MIN__’ undeclared (first use in this function)
1875 | # define RMIN (__LIBGCC_SF_MIN__)
| ^~~~~~~~~~~~~~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:2082:21: note: in expansion of macro ‘RMIN’
2082 | if (((FABS (a) < RMIN) && (FABS (b) < RMAX2) && (FABS (d) < RMAX2))
| ^~~~
make[2]: *** [Makefile:501: _divsc3.o] Error 1
../../../gcc-12.1.0/libgcc/libgcc2.c: In function ‘__divdc3’:
make[2]: *** Waiting for unfinished jobs....
../../../gcc-12.1.0/libgcc/libgcc2.c:1885:16: error: ‘__LIBGCC_DF_MAX__’ undeclared (first use in this function)
1885 | # define RBIG (__LIBGCC_DF_MAX__ / 2)
| ^~~~~~~~~~~~~~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:2063:23: note: in expansion of macro ‘RBIG’
2063 | if (FABS (d) >= RBIG)
| ^~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:1885:16: note: each undeclared identifier is reported only once for each function it appears in
1885 | # define RBIG (__LIBGCC_DF_MAX__ / 2)
| ^~~~~~~~~~~~~~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:2063:23: note: in expansion of macro ‘RBIG’
2063 | if (FABS (d) >= RBIG)
| ^~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:1887:17: error: ‘__LIBGCC_DF_EPSILON__’ undeclared (first use in this function)
1887 | # define RMIN2 (__LIBGCC_DF_EPSILON__)
| ^~~~~~~~~~~~~~~~~~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:2073:22: note: in expansion of macro ‘RMIN2’
2073 | if (FABS (d) < RMIN2)
| ^~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:1886:16: error: ‘__LIBGCC_DF_MIN__’ undeclared (first use in this function)
1886 | # define RMIN (__LIBGCC_DF_MIN__)
| ^~~~~~~~~~~~~~~~~
../../../gcc-12.1.0/libgcc/libgcc2.c:2082:21: note: in expansion of macro ‘RMIN’
2082 | if (((FABS (a) < RMIN) && (FABS (b) < RMAX2) && (FABS (d) < RMAX2))
| ^~~~
make[2]: *** [Makefile:501: _divdc3.o] Error 1
make[2]: Leaving directory '/tmp/guix-build-gcc-12.1.0.drv-0/build/aarch64-linux-gnu/libgcc'
make[1]: *** [Makefile:14447: all-target-libgcc] Error 2
P
P
P
Pavel Shlyak wrote on 11 Aug 2022 20:57
(address . 55665@debbugs.gnu.org)
F2F3481B-8C63-4783-9DF3-39A42EBA6257@pantherx.org
It seems to be still there, even after dfda2cc5f6a57a0b89b98f389a2f28bf1e94eaa4
Attachment: file
J
J
Josselin Poiret wrote on 10 Mar 2023 21:17
87edpwbbub.fsf@jpoiret.xyz
Hi Pavel,

Pavel Shlyak <p.shlyak@pantherx.org> writes:

Toggle quote (2 lines)
> It seems to be still there, even after dfda2cc5f6a57a0b89b98f389a2f28bf1e94eaa4

Now that we're working on the core-updates branch, the issue is still
there. Roughly, libgcc relies on defines that were introduced in GCC
12, so libgcc has to be compiled with GCC 12, but we have no immediate
way of doing that since we have a GCC 11 cross-compiler that built a GCC
12 host compiler which isn't usable by the builder.

It seems like the proper (but annoying) option would instead be to build
a GCC 12 cross-compiler for the builder using the builder GCC 11, then
use that to build a host GCC 12 and libgcc. That is at odds with how
we do cross-compilation in general though :( We'll keep poking at it.

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCAAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmQLkEwQHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcaijTvC/4kuXl6/28UjyyKpC8u/oTFi7PBZ3JrT30q
zf/6IXr9edsAQSpxnJk99TSz63kRbQKYpugQjmm92Kpd2UQaOC92m6VigVe4x2+0
LZOsI7FngDMWb509W7sGnnX3nDZJS97dtLMxHX7nuUtUzPG9lULD4hUNlYuvYpvy
w07UcGo6ihy7ZFYTsTU3AxJWO5mVx8G43UEYxCR8XheLN4AccWe6V5cP818dtpkV
kbzA5KQvdqm52iNTrgUOgw7XzCZ4pUmpGlgbaXtwzxgWs/FawelE4UvAuH0QYpUI
O4ugAA3a8Mag4Ic4wvtqmA4ooZPI6caxTi/tr9OP5fe0ulajj6mLXNL5NyNEltPX
44fq7Vy3X0Ra1kuUKNTI7JKM4E/LKx0+/y8GfP2eTf1SgX5jB35EzutsZzylHRuw
BQ8QIH1UMRyvkIzcgPtqV/R8zamtaGPyaUN3GZa8shuc0SQPtMJPMJxEgeeIWwo1
yz4XJS48tnurRUzSjLvPI9X/kvFm/9Q=
=+yX1
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 55665@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 55665
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch