When building sys-devel/gcc-14.2.1_p20241221 on aarch64_be, the build fails during stage2 with the following error message (very long because C++, so I had to truncate the beginning, please see full log in attachment): [...] /var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/build/aarch64_be-unknown-linux-gnu/libstdc++-v3/include/bits/locale_classes.tcc:145:14: error: ‘dynamic_cast’ not permitted with ‘-fno-rtti’ 145 | return dynamic_cast<const _Facet*>(__facets[__i]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ make[6]: *** [Makefile:562: stacktrace.lo] Error 1 make[6]: Leaving directory '/var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/build/aarch64_be-unknown-linux-gnu/libstdc++-v3/src/c++23' make[6]: *** Waiting for unfinished jobs.... Reproducible: Always Steps to Reproduce: 1.USE=-fortran emerge -1a =sys-devel/gcc-14.2.1_p20241221 2. 3. Actual Results: Build fails during stage2 Expected Results: Build succeeds Portage 3.0.65 (python 3.12.7-final-0, default/linux/arm64/23.0/split-usr/big-endian, gcc-13, glibc-2.40-r5, 6.6.47 aarch64_be) ================================================================= System uname: Linux-6.6.47-aarch64_be-with-glibc2.40 KiB Mem: 6081348 total, 872316 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Fri, 03 Jan 2025 14:30:00 +0000 Head commit of repository gentoo: 0a25b84cd8517260ec57b6d985f980775f2ee342 sh bash 5.2_p37 ld GNU ld (Gentoo 2.42 p3) 2.42.0 app-misc/pax-utils: 1.3.8::gentoo app-shells/bash: 5.2_p37::gentoo dev-build/autoconf: 2.71-r7::gentoo, 2.72-r1::gentoo dev-build/automake: 1.16.5-r2::gentoo dev-build/cmake: 3.30.2::gentoo dev-build/libtool: 2.4.7-r4::gentoo dev-build/make: 4.4.1-r100::gentoo dev-build/meson: 1.5.1::gentoo dev-lang/perl: 5.40.0::gentoo dev-lang/python: 3.11.10_p1::gentoo, 3.12.7_p1::gentoo, 3.13.0::gentoo sys-apps/baselayout: 2.17::gentoo sys-apps/openrc: 0.55.1::gentoo sys-apps/sandbox: 2.39::gentoo sys-devel/binutils: 2.42-r1::gentoo, 2.43-r2::gentoo sys-devel/binutils-config: 5.5.2::gentoo sys-devel/gcc: 13.3.1_p20240614::gentoo sys-devel/gcc-config: 2.11::gentoo sys-kernel/linux-headers: 6.6-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.40-r5::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 volatile: True sync-rsync-verify-max-age: 3 sync-rsync-verify-jobs: 1 sync-rsync-extra-opts: sync-rsync-verify-metamanifest: yes crossdev location: /usr/local/portage-crossdev masters: gentoo priority: 10 volatile: True ACCEPT_KEYWORDS="arm64" ACCEPT_LICENSE="@FREE" CBUILD="aarch64_be-unknown-linux-gnu" CFLAGS="-O2 -pipe -fomit-frame-pointer" CHOST="aarch64_be-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -fomit-frame-pointer" DISTDIR="/tmp/distfiles" EMERGE_DEFAULT_OPTS="--autounmask" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="sv_SE.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LEX="flex" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" SHELL="/bin/bash" USE="acl arm64 big-endian bzip2 crypt gdbm iconv ipv6 libtirpc ncurses nls openmp pam pcre readline seccomp split-usr ssl test-rust unicode xattr zlib" ADA_TARGET="gcc_13" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_ARM="edsp v8 vfp vfp-d32 vfpv3 vfpv4" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="fbdev dummy" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, MAKEOPTS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Created attachment 916434 [details] Complete build log
This looks a lot like bug 943303 where the GCC versions got mixed with cross. But I know you're not doing cross here. Weird?
Please include the tarball too: [31;01m*[0m Please include /var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/gcc-build-logs.tar.xz in your bug report.
Created attachment 916437 [details] gcc build logs Speaking of weird, gcc-build-logs.tar.xz was actually a plain tar (not compressed) despite the filename. I renamed it and xz:ed it for reals...
Doubly weird: that tarball is supposed to have loads of config.logs in it too. Maybe I broke it when refactoring a while ago for jit?
I can search for logs and make a manual tar later. Regarding cross compilation, I may have bootstrapped this installation using cross-compilation some time during the stone ages, but I have updated gcc natively many times since then, and this build was also native of course.
Created attachment 916468 [details] All the logs, hopefully... Here's every file named *.log from /var/tmp/portage/sys-devel/gcc-14.2.1_p20241221 :-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f38cc077c1d26004a130b6f92de3351402514ec9 commit f38cc077c1d26004a130b6f92de3351402514ec9 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-14 04:33:16 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-14 04:51:32 +0000 toolchain.eclass: fix toolchain_death_notice * Actually include config.logs again * Really compress (add 'a' to auto-compress based on suffix) Bug: https://bugs.gentoo.org/948045 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
So I tried to build gcc on another aarch64_be system, where I know no cross compilation has been involved. It failed in the same way, but I also noticed that the gcc-build-logs.tar.xz fix seems to have made things worse; this time I didn't get any gcc-build-logs at all, only the following error message: * S: '/var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/gcc-14-20241221' tar: You may not specify more than one '-Acdtrux', '--delete' or '--test-label' option Try 'tar --help' or 'tar --usage' for more information.
Looking at the commit, you didn't actually "add a" like the comment said ("a" was already there). Instead you added "c", so now there is both "c" (create) and "r" (append)...
You probably meant to change "-arf" into "-acf". (Appending to a compressed archive obviously will not work...)
(In reply to Marcus Comstedt from comment #11) > You probably meant to change "-arf" into "-acf". > (Appending to a compressed archive obviously will not work...) Yes -- although this won't work as-is (with correct behaviour) given we're iterating over 2 dirs. Thank you!
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae18c5b4149e30064751e7cea79cc830076b0292 commit ae18c5b4149e30064751e7cea79cc830076b0292 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-15 19:37:40 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-15 19:37:40 +0000 toolchain.eclass: fix toolchain_death_notice more * Go back to -arf. As Marcus points out, it doesn't make sense to append there. * Compress afterwards given we want to handle both directories. Bug: https://bugs.gentoo.org/948045 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c73b4acbae2ef7475471d1869b509d77ee980da commit 6c73b4acbae2ef7475471d1869b509d77ee980da Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-16 08:20:53 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-16 08:21:17 +0000 toolchain.eclass: another death_hooks fix Hopefully the last. Bug: https://bugs.gentoo.org/948045 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
> Hopefully the last. Well, sorry, but still no cigar: ---8<--- * Working directory: '/var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/build' * S: '/var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/gcc-14-20241221' * * Please include /var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/gcc-build-logs.tar.xz in your bug report. * xz: /var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/gcc-build-logs.tar.xz: No such file or directory ---8<--- /var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/gcc-build-logs.tar does exist (uncompressed), but only has two files in it: # tar tvf /var/tmp/portage/sys-devel/gcc-14.2.1_p20241221/work/gcc-build-logs.tar -rw-r--r-- root/root 3195 2025-01-16 19:52 build/gccinfo.log -rw-r----- root/root 8805679 2025-01-16 19:52 build/build.log # Also, it seems the "-a" flag to tar is not really needed when autocompression is not expected to happen anyway...
Oh well. Next time. I'll look again tonight.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ca5e513fa45a32fbf03b130ca8d1ec5e3e73641 commit 2ca5e513fa45a32fbf03b130ca8d1ec5e3e73641 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-18 23:47:31 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-18 23:51:22 +0000 toolchain.eclass: fix finding config.logs in death hooks Bug: https://bugs.gentoo.org/948045 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f69535668852a6c83b03d1e09f0a23f6d645a29 commit 5f69535668852a6c83b03d1e09f0a23f6d645a29 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-18 23:43:32 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-18 23:51:22 +0000 toolchain.eclass: drop redundant 'a' flag from tar invocation .. for death hooks. We're not compressing yet, hence we certainly don't need autodetection of compression based on suffix... Bug: https://bugs.gentoo.org/948045 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=71d7f80e14968cb219e40700721f1c50f6052705 commit 71d7f80e14968cb219e40700721f1c50f6052705 Author: Sam James <sam@gentoo.org> AuthorDate: 2025-01-18 23:42:34 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-01-18 23:51:21 +0000 toolchain.eclass: don't try to compress a (non-existent) compress file ... in death hook. Pointed out by Eli. Bug: https://bugs.gentoo.org/948045 Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Okay, now I get: ``` $ tar tvf /var/tmp/portage/sys-devel/gcc-14.2.1_p20250118/work/gcc-build-logs.tar.xz -rw-r--r-- root/root 3878 2025-01-18 23:51 build/gccinfo.log -rw-r----- root/root 81394 2025-01-18 23:51 build/build.log -rw-r--r-- portage/portage 60918 2025-01-18 23:50 build/config.log -rw-r--r-- portage/portage 87314 2025-01-18 23:51 build/libbacktrace/config.log -rw-r--r-- portage/portage 21329 2025-01-18 23:50 build/libcody/config.log -rw-r--r-- portage/portage 47736 2025-01-18 23:50 build/libdecnumber/config.log -rw-r--r-- portage/portage 54411 2025-01-18 23:50 build/lto-plugin/config.log -rw-r--r-- portage/portage 60608 2025-01-18 23:50 build/libgrust/config.log -rw-r--r-- portage/portage 58534 2025-01-18 23:51 build/build-x86_64-pc-linux-gnu/libcpp/config.log -rw-r--r-- portage/portage 68546 2025-01-18 23:51 build/build-x86_64-pc-linux-gnu/libiberty/config.log ``` ... when killing a few seconds in. Looks much better. Now, back to the actual bug! Sorry and thanks for the patience.
Created attachment 917105 [details] gcc build logs Yes, log gathering looks fine now. I replaced the gcc-build-logs.tar.xz attachment with a fresh one, which is from a different system but shows the same result. :-)
For reference, I tried sys-devel/gcc-14.2.1_p20250125 and it has the same issue.
Could you try with STAGE1_CFLAGS="-O0" STAGE1_CXXFLAGS="-O0" emerge -v1 sys-devel/gcc:14? (It'll use -O0 only for using the stage1 compiler.) Does building GCC 13 work still?
Ok, I'll test. > Does building GCC 13 work still? Yes. I built gcc-13.3.1_p20241220 (using gcc-13.3.1_p20240614) successfully on 2025-01-19, which is after I failed to build gcc-14.2.1_p20241221 (also using gcc-13.3.1_p20240614) and before I failed to build gcc-14.2.1_p20250125 (now using gcc-13.3.1_p20241220).
(In reply to Sam James from comment #21) > Could you try with STAGE1_CFLAGS="-O0" STAGE1_CXXFLAGS="-O0" emerge -v1 > sys-devel/gcc:14? (It'll use -O0 only for using the stage1 compiler.) Still exactly the same build failure.
Tried gcc-14.3.9999, same error. I also tried gcc-15.0.1_pre20250119 but got an ICE during build instead...
Tried gcc-14.2.1_p20250208. Same issue.
I'm nursing a bug post-FOSDEM and not really at 100%. Mind trying to reproduce it manually and then reporting upstream?
I created an upstreams bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118891 The issue occurs with USE=vanilla, so the problem should likely exist upstreams as well.
Thanks.
*** Bug 952960 has been marked as a duplicate of this bug. ***
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27b00d0bf62eaff1372caca0be30e237282adbb3 commit 27b00d0bf62eaff1372caca0be30e237282adbb3 Author: Andreas K. Hüttel <dilfridge@gentoo.org> AuthorDate: 2025-03-31 16:47:21 +0000 Commit: Andreas K. Hüttel <dilfridge@gentoo.org> CommitDate: 2025-03-31 16:48:17 +0000 profiles: mask >=gcc-14 for aarch64_be Bug: https://bugs.gentoo.org/948045 Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118891 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> profiles/arch/arm64/big-endian/package.mask | 9 +++++++++ 1 file changed, 9 insertions(+)