Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 883769

Summary: sys-devel/gcc: failed to cross-compile for aarch64-unknown-linux-gnu (libgcc2.c:1874:18: error: '__LIBGCC_SF_MAX__' undeclared (first use in this function))
Product: Gentoo Linux Reporter: zen <dev>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: UNCONFIRMED ---    
Severity: normal CC: immoloism
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: gcc build log, emerge info

Description zen 2022-11-30 18:24:40 UTC
Created attachment 838585 [details]
gcc build log, emerge info

I'm following this guide: /wiki/Cross_build_environment and the build fails with the default make.conf which contains ~{ARCH} in the ACCEPT_KEYWORDS field.  Additionally, the following use change was needed to build @system: sys-apps/util-linux -su.

The attached emerge info was from after I made the changes, so it may not be totally relevant, but the build log is from the failed build.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-12-01 06:54:48 UTC
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c: In function '__divsc3':
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c:1874:18: error: '__LIBGCC_SF_MAX__' undeclared (first use in this function)
 1874 | # define RBIG   (__LIBGCC_SF_MAX__ / 2)
      |                  ^~~~~~~~~~~~~~~~~
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c:2063:23: note: in expansion of macro 'RBIG'
 2063 |       if (FABS (d) >= RBIG)
      |                       ^~~~
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c:1874:18: note: each undeclared identifier is reported only once for each function it appears in
 1874 | # define RBIG   (__LIBGCC_SF_MAX__ / 2)
      |                  ^~~~~~~~~~~~~~~~~
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c:2063:23: note: in expansion of macro 'RBIG'
 2063 |       if (FABS (d) >= RBIG)
      |                       ^~~~
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c:1876:18: error: '__LIBGCC_SF_EPSILON__' undeclared (first use in this function)
 1876 | # define RMIN2  (__LIBGCC_SF_EPSILON__)
      |                  ^~~~~~~~~~~~~~~~~~~~~
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c:2073:22: note: in expansion of macro 'RMIN2'
 2073 |       if (FABS (d) < RMIN2)
      |                      ^~~~~
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c:1875:18: error: '__LIBGCC_SF_MIN__' undeclared (first use in this function)
 1875 | # define RMIN   (__LIBGCC_SF_MIN__)
      |                  ^~~~~~~~~~~~~~~~~
/usr/aarch64-unknown-linux-gnu/tmp/portage/sys-devel/gcc-12.2.1_p20221008/work/gcc-12-20221008/libgcc/libgcc2.c:2082:28: 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