Hi, seems I am not the only one who runs Gentoo on a relatively memory-constrained machine with 2GB RAM virtual. I cannot bootstrap gcc-12 too, for a looong while. Manually I can get around by -O0 but I screwed up something and the resulting binries from step 2 and 3 differ: emerge -uN sys-devel/gcc [wait for error-exit] pushd /var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/gcc /var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/./prev-gcc/xg++ -B/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/./prev-gcc/ -B/usr/x86_64-pc-linux-gnu/bin/ -nostdinc++ -B/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -B/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -isystem /var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu -isystem /var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/include -isystem /var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/libstdc++-v3/libsupc++ -L/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs -fno-PIE -c -fno-PIE -m64 -pipe -march=x86-64 -O1 -fno-checking -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/gcc -I/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/gcc/. -I/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/gcc/../include -I/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/gcc/../libcpp/include -I/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/gcc/../libcody -I/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/gcc/../libdecnumber -I/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/gcc/../libdecnumber/bid -I../libdecnumber -I/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526/gcc/../libbacktrace -o insn-emit.o -MT insn-emit.o -MMD -MP -MF ./.deps/insn-emit.TPo insn-emit.cc make popd ebuild /usr/portage/sys-devel/gcc/gcc-12.3.1_p20230526.ebuild compile make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build' make "DESTDIR=" "RPATH_ENVVAR=LD_LIBRARY_PATH" "TARGET_SUBDIR=x86_64-pc-linux-gnu" "bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/12" "datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/12" "exec_prefix=/usr" "includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/12/include" "datarootdir=/usr/share" "docdir=/usr/share/doc/" "infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/12/info" "pdfdir=/usr/share/doc/" "htmldir=/usr/share/doc/" "libdir=/usr/lib" "libexecdir=/usr/libexec" "lispdir=" "localstatedir=/usr/var" "mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/12/man" "oldincludedir=/usr/include" "prefix=/usr" "sbindir=/usr/sbin" "sharedstatedir=/usr/com" "sysconfdir=/usr/etc" "tooldir=/usr/x86_64-pc-linux-gnu" "build_tooldir=/usr/x86_64-pc-linux-gnu" "target_alias=x86_64-pc-linux-gnu" "AWK=gawk" "BISON=bison" "CC_FOR_BUILD=x86_64-pc-linux-gnu-gcc" "CFLAGS_FOR_BUILD=-pipe -march=x86-64 -O2" "CXX_FOR_BUILD=x86_64-pc-linux-gnu-g++ -std=c++11" "CXXFLAGS_FOR_BUILD=-pipe -march=x86-64 -O2" "EXPECT=expect" "FLEX=flex" "INSTALL=/usr/lib/portage/python3.10/ebuild-helpers/xattr/install -c" "INSTALL_DATA=/usr/lib/portage/python3.10/ebuild-helpers/xattr/install -c -m 644" "INSTALL_PROGRAM=/usr/lib/portage/python3.10/ebuild-helpers/xattr/install -c" "INSTALL_SCRIPT=/usr/lib/portage/python3.10/ebuild-helpers/xattr/install -c" "LDFLAGS_FOR_BUILD=-Wl,-O1 -Wl,--as-needed" "LEX=flex" "M4=m4" "MAKE=make" "RUNTEST=runtest" "RUNTESTFLAGS=" "SED=/bin/sed" "SHELL=/bin/sh" "YACC=bison -y" "`echo 'ADAFLAGS=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "ADA_CFLAGS=" "AR_FLAGS=rc" "`echo 'BOOT_ADAFLAGS=-gnatpg' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "BOOT_CFLAGS=-m64 -pipe -march=x86-64 -O2" "BOOT_LDFLAGS=" "CFLAGS=-pipe -march=x86-64 -O2 " "CXXFLAGS=-pipe -march=x86-64 -O2 " "LDFLAGS=-Wl,-O1 -Wl,--as-needed" "LIBCFLAGS=-pipe -march=x86-64 -O2 " "LIBCXXFLAGS=-pipe -march=x86-64 -O2 -fno-implicit-templates" "STAGE1_CHECKING=--enable-checking=release,types" "STAGE1_LANGUAGES=c,c++,lto" "GNATBIND=no" "GNATMAKE=no" "GDC=no" "GDCFLAGS=-pipe -march=x86-64 -O2 " "AR_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/ar" "AS_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/as" "CC_FOR_TARGET=/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/./gcc/" "CFLAGS_FOR_TARGET=-g -pipe -march=x86-64 -O2" "CPPFLAGS_FOR_TARGET=" "CXXFLAGS_FOR_TARGET=-g -pipe -march=x86-64 -O2 -D_GNU_SOURCE" "DLLTOOL_FOR_TARGET=dlltool" "DSYMUTIL_FOR_TARGET=dsymutil" "FLAGS_FOR_TARGET=-B/usr/x86_64-pc-linux-gnu/bin/ -B/usr/x86_64-pc-linux-gnu/lib/ -isystem /usr/x86_64-pc-linux-gnu/include -isystem /usr/x86_64-pc-linux-gnu/sys-include" "GFORTRAN_FOR_TARGET=/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/./gcc/gfortran -B/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build/./gcc/" "GOC_FOR_TARGET=" "GOCFLAGS_FOR_TARGET=-O2 -g" "GDC_FOR_TARGET=no" "GDCFLAGS_FOR_TARGET=-O2 -g" "LD_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/ld" "LIPO_FOR_TARGET=lipo" "LDFLAGS_FOR_TARGET=" "LIBCFLAGS_FOR_TARGET=-g -pipe -march=x86-64 -O2" "LIBCXXFLAGS_FOR_TARGET=-g -pipe -march=x86-64 -O2 -D_GNU_SOURCE -fno-implicit-templates" "NM_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/nm" "OBJDUMP_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/objdump" "OBJCOPY_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/objcopy" "RANLIB_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/ranlib" "READELF_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/readelf" "STRIP_FOR_TARGET=/usr/x86_64-pc-linux-gnu/bin/strip" "WINDRES_FOR_TARGET=windres" "WINDMC_FOR_TARGET=windmc" "BUILD_CONFIG=bootstrap-debug" "`echo 'LANGUAGES=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "LEAN=:" "STAGE1_CFLAGS=" "STAGE1_CXXFLAGS=" "STAGE1_GENERATOR_CFLAGS=" "STAGE1_TFLAGS=-fno-checking" "STAGE2_CFLAGS=-m64 -pipe -march=x86-64 -O2 -fno-checking -gtoggle" "STAGE2_CXXFLAGS=-m64 -pipe -march=x86-64 -O2 -fno-checking -gtoggle" "STAGE2_GENERATOR_CFLAGS=" "STAGE2_TFLAGS=-fno-checking" "STAGE3_CFLAGS=-m64 -pipe -march=x86-64 -O2 -fchecking=1" "STAGE3_CXXFLAGS=-m64 -pipe -march=x86-64 -O2 -fchecking=1" "STAGE3_GENERATOR_CFLAGS=" "STAGE3_TFLAGS=-fchecking=1" "STAGE4_CFLAGS=-m64 -pipe -march=x86-64 -O2" "STAGE4_CXXFLAGS=-m64 -pipe -march=x86-64 -O2" "STAGE4_GENERATOR_CFLAGS=" "STAGE4_TFLAGS=" "STAGEprofile_CFLAGS=-m64 -pipe -march=x86-64 -O2 -fno-checking -gtoggle -fprofile-generate" "STAGEprofile_CXXFLAGS=-m64 -pipe -march=x86-64 -O2 -fno-checking -gtoggle -fprofile-generate" "STAGEprofile_GENERATOR_CFLAGS=" "STAGEprofile_TFLAGS=-fno-checking" "STAGEtrain_CFLAGS=-m64 -pipe -march=x86-64 -O2" "STAGEtrain_CXXFLAGS=-m64 -pipe -march=x86-64 -O2" "STAGEtrain_GENERATOR_CFLAGS=" "STAGEtrain_TFLAGS=" "STAGEfeedback_CFLAGS=-m64 -pipe -march=x86-64 -O2 -fprofile-use -fprofile-reproducible=parallel-runs" "STAGEfeedback_CXXFLAGS=-m64 -pipe -march=x86-64 -O2 -fprofile-use -fprofile-reproducible=parallel-runs" "STAGEfeedback_GENERATOR_CFLAGS=" "STAGEfeedback_TFLAGS=" "STAGEautoprofile_CFLAGS=-m64 -pipe -march=x86-64 -O2 -fno-checking -gtoggle -g" "STAGEautoprofile_CXXFLAGS=-m64 -pipe -march=x86-64 -O2 -fno-checking -gtoggle -g" "STAGEautoprofile_GENERATOR_CFLAGS=" "STAGEautoprofile_TFLAGS=-fno-checking" "STAGEautofeedback_CFLAGS=-m64 -pipe -march=x86-64 -O2 -fchecking=1" "STAGEautofeedback_CXXFLAGS=-m64 -pipe -march=x86-64 -O2 -fchecking=1" "STAGEautofeedback_GENERATOR_CFLAGS=" "STAGEautofeedback_TFLAGS=-fchecking=1" "CXX_FOR_TARGET= $r/./gcc/xg++ -B$r/./gcc/ -nostdinc++ `if test -f $r/x86_64-pc-linux-gnu/libstdc++-v3/scripts/testsuite_flags; then /bin/sh $r/x86_64-pc-linux-gnu/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$r/x86_64-pc-linux-gnu/libstdc++-v3/src -L$r/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs -L$r/x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs" "TFLAGS=" "CONFIG_SHELL=/bin/sh" "MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000" compare make[2]: Entering directory '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build' make[3]: Entering directory '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build' rm -f stage_current make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build' Comparing stages 2 and 3 Bootstrap comparison failure! gcc/insn-emit.o differs make[2]: *** [Makefile:24126: compare] Error 1 make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build' make[1]: *** [Makefile:24106: stage3-bubble] Error 2 make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build' make: *** [Makefile:24180: bootstrap-lean] Error 2 * ERROR: sys-devel/gcc-12.3.1_p20230526::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-devel/gcc-12.3.1_p20230526::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-12.3.1_p20230526::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/temp/environment'. * Working directory: '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/build' * S: '/var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-12-20230526' * * Please include /var/tmp/portage/sys-devel/gcc-12.3.1_p20230526/work/gcc-build-logs.tar.xz in your bug report. * See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54179
https://bugs.gentoo.org/901317 # emerge --info '=sys-devel/gcc-12.3.1_p20230526::gentoo' Portage 3.0.38.1 (python 3.10.12-final-0, default/linux/amd64/17.1/no-multilib, gcc-11.3.0, glibc-2.37-r3, 6.1.12 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.1.12-x86_64-Intel-R-_Xeon-R-_CPU_E5-2630_0_@_2.30GHz-with-glibc2.37 KiB Mem: 2037984 total, 277892 free KiB Swap: 1023996 total, 878428 free Timestamp of repository gentoo: Wed, 05 Jul 2023 15:00:01 +0000 Head commit of repository gentoo: 69c25b1fbb073e262c1da738894108ecba761ec9 sh bash 5.1_p16-r6 ld GNU ld (Gentoo 2.37_p1 p2) 2.37 app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r6::gentoo dev-java/java-config: 2.3.1::gentoo dev-lang/perl: 5.34.1-r3::gentoo dev-lang/python: 2.7.18_p13::gentoo, 3.9.13_p6::gentoo, 3.10.12::gentoo dev-lang/rust: 1.62.1::gentoo dev-util/cmake: 3.23.3::gentoo dev-util/meson: 0.62.2::gentoo sys-apps/baselayout: 2.13-r1::gentoo sys-apps/openrc: 0.45.2::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo, 2.71-r5::gentoo sys-devel/automake: 1.11.6-r3::gentoo, 1.12.6-r2::gentoo, 1.13.4-r2::gentoo, 1.14.1-r2::gentoo, 1.15.1-r2::gentoo, 1.16.5::gentoo sys-devel/binutils: 2.37_p1-r2::gentoo, 2.38-r2::gentoo, 2.39-r5::gentoo, 2.40-r5::gentoo sys-devel/binutils-config: 5.4.1::gentoo sys-devel/gcc: 9.3.0-r1::gentoo, 10.3.0-r2::gentoo, 11.3.0::gentoo sys-devel/gcc-config: 2.10::gentoo sys-devel/libtool: 2.4.7::gentoo sys-devel/make: 4.4.1-r1::gentoo sys-kernel/linux-headers: 5.15-r3::gentoo (virtual/os-headers) sys-libs/glibc: 2.37-r3::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-extra-opts: sync-rsync-verify-max-age: 24 sync-rsync-verify-metamanifest: yes sync-rsync-verify-jobs: 1 x-portage location: /usr/local/portage masters: gentoo priority: 0 science location: /var/lib/layman/science masters: gentoo priority: 50 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE dlj-1.1 sun-bcla-java-vm Oracle-BCLA-JavaSE IBM-J1.6 skype-eula Nero-EULA-US AdobeFlash-10.3 skype-4.0.0.7-copyright AdobeFlash-11.x intel-ucode unRAR linux-firmware freedist arj" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=x86-64" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /var/bind" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -march=x86-64" DISTDIR="/usr/portage/distfiles" 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 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nostrip parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.utf8" LC_ALL="en_US" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en en_US en_GB cs cz" MAKEOPTS="-j1" PKGDIR="/var/cache/binpkgs" 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="X amd64 apache apache2 berkdb blake2 bzip2 cairo cgi cifs cli cracklib crypt cryptlib dbus device-mapper dhcp dri elogind emboss fontconfig fortran gbm gd gdbm geoip gpm iconv innodb ipv6 java jce jpeg jpg keymap ladspa lapack lcms libnotify libtirpc lz4 lzma lzo mmx mysql mysqli ncurses nfs nls nptl nptlonly openssl pam pcre pdf perl php png python readline resolvconf samba seccomp server session smb2 smb3 spf split-usr sqlite sse sse2 ssl sslv2 sslv3 suexec svg syslog tcpd test-rust threads tiff truetype udev unicode usb vhosts vim-syntax x11 xattr xml zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="alias authz_host authz_user auth_basic auth_digest authn_core authz_core autoindex cgi cgid deflate dir env expires filter headers ident include info imagemap mem_cache mime mime_magic negotiation remoteip setenvif socache_shmcb status userdir vhost_alias rewrite usertrack cache file_cache disk_cache charset_lite log_config log_forensic unixd session session_cookie session_crypto xml2enc" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php-8.1" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_9 python3_10" RUBY_TARGETS="ruby31" VIDEO_CARDS="vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS # emerge -pqv '=sys-devel/gcc-12.3.1_p20230526::gentoo' [ebuild NS ] sys-devel/gcc-12.3.1_p20230526 [9.3.0-r1, 10.3.0-r2, 11.3.0] USE="(cxx) fortran nls nptl (pie) sanitize ssp -ada (-cet) (-custom-cflags) -d -debug -default-stack-clash-protection% -default-znow% -doc (-fixed-point) -go -graphite -hardened (-ieee-long-double) -jit (-libssp) -lto (-multilib) -objc -objc++ -objc-gc -openmp (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv -zstd"
Created attachment 865203 [details] work/gcc-build-logs.tar.xz
Does NOT happen on same host with (only last version for each SLOT shown): sys-devel/gcc-8.2.0-r6 sys-devel/gcc-8.3.0-r1 sys-devel/gcc-9.2.0-r2 sys-devel/gcc-10.2.0-r5 sys-devel/gcc-10.4.1_p20230426-r1 sys-devel/gcc-11.3.1_p20230427
You cannot manually run part of the build process with different flags because then the comparison will fail with when that file got built earlier. Anyway, I suggest, for now (until the GCC upstream change is made): 1. Drop -pipe from *FLAGS 2. Add -Wl,--no-keep-memory to LDFLAGS
(In reply to Sam James from comment #4) > You cannot manually run part of the build process with different flags > because then the comparison will fail with when that file got built earlier. I just tried hoping the Makefiles are are correctly and do not rely on env variables. I know it was not correct and hence I mentioned that explicitly. although it was not main problem itself. > Anyway, I suggest, for now (until the GCC upstream change is made): > 1. Drop -pipe from *FLAGS > 2. Add -Wl,--no-keep-memory to LDFLAGS Wow, works, thank you!
I don't plan on backporting this to 12, but: commit 1f1f22257a2af5095f008ed5e6d48330024a24c7 Author: Sam James <sam@gentoo.org> Date: Mon Oct 16 13:40:03 2023 +0100 sys-devel/gcc: "backport" insn-emit split patches to 14.x (14.0.0_pre20231015) Done for parity with 13.x. This is a continuation of 7a6b2d23ec02e75475a6123254ccd44d73827f39 ('13.2.0: backport split match.pd changes') in a sense - see that commit for rationale for backporting. Motivated here again by more reports of OOMs with insn-match.cc. Bug: https://gcc.gnu.org/PR54179 Bug: https://gcc.gnu.org/PR84402 Bug: https://gcc.gnu.org/PR111600 Signed-off-by: Sam James <sam@gentoo.org> commit f154c789c6f0a877b5487594119e7a5fa5af4f91 Author: Sam James <sam@gentoo.org> Date: Mon Oct 16 13:39:17 2023 +0100 sys-devel/gcc: backport insn-emit split patches to 13.x (13.2.1_p20231014) This is a continuation of 7a6b2d23ec02e75475a6123254ccd44d73827f39 ('13.2.0: backport split match.pd changes') in a sense - see that commit for rationale for backporting. Motivated here again by more reports of OOMs with insn-match.cc. Bug: https://gcc.gnu.org/PR54179 Bug: https://gcc.gnu.org/PR84402 Bug: https://gcc.gnu.org/PR111600 Signed-off-by: Sam James <sam@gentoo.org> so, given that + the workaround described above => WORKSFORME.