I've tried to migrate to the new profile "default/linux/amd64/23.0/split-usr/desktop" and wasn't able to do it because gcc compilation was failed. I've found that the reason is that I have USE="graphite" enabled for gcc. On 17.1 profile it compiles fine, but on 23.0 it fails on stage2 and stage3 comparison. Looks like the problem in enabling graphite together with one of the new flags enabled in the new profile by default. Reproducible: Always Steps to Reproduce: 1. Switch to 23.0 profile 2. Enable USE=graphite for gcc 3. emerge -1 gcc Actual Results: Emerge fails Expected Results: Emerged successfully
Please share the full build.log, the gcc-build-logs tarball the GCC ebuild creates, and emerge --info.
Created attachment 888394 [details] build.log
$ emerge --info Portage 3.0.61 (python 3.11.8-final-0, default/linux/amd64/23.0/split-usr/desktop, gcc-13, glibc-2.38-r10, 6.6.21-gentoo x86_64) ================================================================= System uname: Linux-6.6.21-gentoo-x86_64-12th_Gen_Intel-R-_Core-TM-_i7-12700F-with-glibc2.38 KiB Mem: 32740932 total, 23295476 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Sun, 24 Mar 2024 08:30:00 +0000 Head commit of repository gentoo: f4f260fbb7738de5bce902cd54f86cd3a8395561 Timestamp of repository haskell: Thu, 21 Mar 2024 22:34:11 +0000 Head commit of repository haskell: 0d8ef265e98c1619d04baff0247c37891fcdd700 sh bash 5.1_p16-r6 ld GNU ld (Gentoo 2.41 p5) 2.41.0 app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.1_p16-r6::gentoo dev-build/autoconf: 2.13-r8::gentoo, 2.71-r6::gentoo dev-build/automake: 1.16.5-r2::gentoo dev-build/cmake: 3.28.3::gentoo dev-build/libtool: 2.4.7-r2::gentoo dev-build/make: 4.4.1-r1::gentoo dev-build/meson: 1.3.2::gentoo dev-java/java-config: 2.3.3-r1::gentoo dev-lang/perl: 5.38.2-r2::gentoo dev-lang/python: 3.11.8_p1::gentoo, 3.12.2_p1::gentoo dev-lang/rust: 1.76.0-r1::gentoo sys-apps/baselayout: 2.14-r2::gentoo sys-apps/openrc: 0.53::gentoo sys-apps/sandbox: 2.38::gentoo sys-devel/binutils: 2.41-r5::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 17.0.6::gentoo sys-devel/gcc: 13.2.1_p20240210::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/lld: 17.0.6::gentoo sys-devel/llvm: 17.0.6::gentoo sys-kernel/linux-headers: 6.6::gentoo (virtual/os-headers) sys-libs/glibc: 2.38-r10::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 volatile: True sync-rsync-extra-opts: -4 sync-rsync-verify-metamanifest: yes sync-rsync-verify-max-age: 3 sync-rsync-verify-jobs: 1 haskell location: /var/db/repos/haskell sync-type: git sync-uri: https://github.com/gentoo-mirror/haskell.git masters: gentoo volatile: False x-portage location: /usr/local/portage masters: gentoo priority: 0 volatile: True Binary Repositories: binhost priority: 9999 sync-uri: https://mirror.bytemark.co.uk/gentoo/releases/amd64/binpackages/23.0/x86-64-v3 ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.9/conf /var/lib/i2pd/certificates" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -O2 -pipe" 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 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 -pipe" GENTOO_MIRRORS="https://mirror.yandex.ru/gentoo-distfiles http://distfiles.gentoo.org" LANG="ru_RU.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs" LEX="flex" LINGUAS="en ru" MAKEOPTS="-j12" PKGDIR="/usr/portage/packages" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="-4" 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 a52 aac acl acpi alsa amd64 branding bzip2 cairo cdda cdr cet crypt cups dbus dri dts dvd dvdr elogind encode exif flac gdbm gif gtk gtk3 gui iconv icu ipv6 jpeg lcms libnotify libtirpc lzma mad mng mp3 mp4 mpeg multilib ncurses networkmanager nls ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline sdl seccomp sound spell split-usr ssl startup-notification svg test-rust tiff truetype udev udisks unicode upower usb vdpau vorbis vulkan wxwidgets x264 xattr xcb xft xml xv xvid zlib zstd" ABI_X86="64" ADA_TARGET="gcc_12" ALSA_CARDS="hda-intel" 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_X86="mmx mmxext sse sse2 sse3 ssse3 sse4_1 sse4_2 popcnt avx avx2 aes fma3 f16c pclmul popcnt rdrand sha" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en ru" 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-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="nvidia" 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, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Your CPU is big.little. I added a workaround in the eclass for that yesterday -- please emerge --sync and try again?
*** This bug has been marked as a duplicate of bug 927641 ***
I've synced and tried to compile gcc again. And it still fails. It looks like it doesn't related to USE=graphite as I initially thought. It fails with USE=-graphite as well. Should I provide more info?
(In reply to Mike Limansky from comment #6) > I've synced and tried to compile gcc again. And it still fails. It looks > like it doesn't related to USE=graphite as I initially thought. It fails > with USE=-graphite as well. > > Should I provide more info? Thanks Mike -- sorry, it turns out the workaround isn't sufficient. We're currently talking out an alternative now.
(In reply to Sam James from comment #7) > (In reply to Mike Limansky from comment #6) > > I've synced and tried to compile gcc again. And it still fails. It looks > > like it doesn't related to USE=graphite as I initially thought. It fails > > with USE=-graphite as well. > > > > Should I provide more info? > > Thanks Mike -- sorry, it turns out the workaround isn't sufficient. We're > currently talking out an alternative now. Ok, just let me know if you want me to test it when it will be ready, or any other help.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e897f91e8e81b8168e7045db2f6d8dd9ebdb9ddf commit e897f91e8e81b8168e7045db2f6d8dd9ebdb9ddf Author: Sam James <sam@gentoo.org> AuthorDate: 2024-03-24 17:19:46 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-03-24 17:47:08 +0000 toolchain.eclass: abort if hybrid CPU detected w/ -march=native Unfortunately, the previous approach can't work. --param doesn't fully wipe out the previous value added by -march=native, so we still get a failed comparison. Users hitting this should install app-misc/resolve-march-native, run resolve-march-native, and use that in their *FLAGS instead of -march=native - at least for sys-devel/gcc via package.env, if not in make.conf. Therefore, our only real option is to just abort when we detect a problematic situation and tell users what to do. The only other idea I had was to try taskset in src_compile which feels super brittle and not sure it'd even work at all. Thanks to Andrei for testing and debugging with us on IRC & the bug. Bug: https://bugs.gentoo.org/904426 Bug: https://bugs.gentoo.org/908523 Bug: https://bugs.gentoo.org/915389 Bug: https://bugs.gentoo.org/927688 Thanks-to: Andrei Liavonchykau <andreil499@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> eclass/toolchain.eclass | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
(In reply to Mike Limansky from comment #8) > (In reply to Sam James from comment #7) > > (In reply to Mike Limansky from comment #6) > > > I've synced and tried to compile gcc again. And it still fails. It looks > > > like it doesn't related to USE=graphite as I initially thought. It fails > > > with USE=-graphite as well. > > > > > > Should I provide more info? > > > > Thanks Mike -- sorry, it turns out the workaround isn't sufficient. We're > > currently talking out an alternative now. > > Ok, just let me know if you want me to test it when it will be ready, or any > other help. Thanks! Could you try out that bit I just pushed? (Either wait until it hits your mirror or manually apply it to the eclass?)
(In reply to Sam James from comment #10) > Thanks! Could you try out that bit I just pushed? (Either wait until it hits > your mirror or manually apply it to the eclass?) $ resolve-march-native -march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=25600 Is it better to put all of these flags to CFLAGS, or -march=alderlake is enough?
Ok, after changing CFLAGS to resolve-march-native output gcc compiled successfully with USE=graphite. BTW, shouldn't this page be updated as well? https://wiki.gentoo.org/wiki/Safe_CFLAGS