Hi, When I tried to emerge --sync on my Via C3 Samuel 2, I have this error : make[2]: *** [Makefile:13472: configure-stage1-lto-plugin] Error 1 make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/build' make[1]: *** [Makefile:22557: stage1-bubble] Error 2 make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/build' make: *** [Makefile:22889: bootstrap-lean] Error 2 * ERROR: sys-devel/gcc-10.2.0-r5::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-devel/gcc-10.2.0-r5::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-10.2.0-r5::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/temp/environment'. * Working directory: '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/build' * S: '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/gcc-10.2.0' * * Please include /var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/gcc-build-logs.tar.bz2 in your bug report. I had the same issue with Binutils : https://bugs.gentoo.org/771765 Reproducible: Always Steps to Reproduce: 1.emerge --ask --verbose --newuse --update --deep @world Actual Results: make[2]: *** [Makefile:13472: configure-stage1-lto-plugin] Error 1 make[2]: Leaving directory '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/build' make[1]: *** [Makefile:22557: stage1-bubble] Error 2 make[1]: Leaving directory '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/build' make: *** [Makefile:22889: bootstrap-lean] Error 2 * ERROR: sys-devel/gcc-10.2.0-r5::gentoo failed (compile phase): * emake failed * * If you need support, post the output of `emerge --info '=sys-devel/gcc-10.2.0-r5::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-devel/gcc-10.2.0-r5::gentoo'`. * The complete build log is located at '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/temp/environment'. * Working directory: '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/build' * S: '/var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/gcc-10.2.0' * * Please include /var/tmp/portage/sys-devel/gcc-10.2.0-r5/work/gcc-build-logs.tar.bz2 in your bug report. I had the same issue with Binutils : https://bugs.gentoo.org/771765
Created attachment 692322 [details] emerge --info
Created attachment 692325 [details] emerge pqv
Created attachment 692328 [details] gcc build logs
Yeah, cet.m4 will need to be synced ti gcc's upstream as well.
Patch proposed upstream as http://gcc.1065356.n8.nabble.com/PATCH-GCC-CET-HOST-FLAGS-Check-if-host-supports-multi-byte-NOPs-td1836828.html
Created attachment 692367 [details, diff] 0002-GCC_CET_HOST_FLAGS-Check-if-host-supports-multi-byte.patch Can you give 0002-GCC_CET_HOST_FLAGS-Check-if-host-supports-multi-byte.patch a try?
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5600e4343f36e2a4925b09388d3ffe7400143b9f commit 5600e4343f36e2a4925b09388d3ffe7400143b9f Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2021-03-19 08:01:22 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2021-03-19 08:01:22 +0000 10.2.0: port binutils fix for CET detection on i486 Reported-by: Worx Bug: https://bugs.gentoo.org/777117 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> 10.2.0/gentoo/44_all_cet-i486.patch | 109 ++++++++++++++++++++++++++++++++++++ 10.2.0/gentoo/README.history | 1 + 2 files changed, 110 insertions(+)
I applied the patch, but still the same error
Created attachment 692421 [details] Build Logs with the patch.
I applied manually the patch after ebuild configure, and before ebuild compile. Let me know, If i have done something bad.
I think its common practice to drop a patch into /etc/portage/patches/sys-devel/gcc-10.2.0/ ; could be worth a try for you?
Ok, same issue with the previous approach. And i see the patch application in the logs.
Created attachment 692460 [details] Build logs with the patch 44 in /etc/portage/patches/sys-devel/gcc-10.2.0/
If you try to build gcc with EXTRA_ECONF=--disable-cet does it help?
Same issue with gcc 10.2.0 compilation : checking for CET support... configure: error: Intel CET must be enabled on Intel CET enabled host make[2]: *** [Makefile:14350 : configure-stage1-lto-plugin] Erreur 1 make[2] : on quitte le répertoire « /opt/gcc-10.2.0 » make[1]: *** [Makefile:24483 : stage1-bubble] Erreur 2 make[1] : on quitte le répertoire « /opt/gcc-10.2.0 » make: *** [Makefile:24820 : bootstrap] Erreur 2 Could you confirme my make command: make BOOT_CFLAGS='-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer' CHOST="i586-pc-linux-gnu" CFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer" EXTRA_ECONF=--disable-cet bootstrap Cmdline : c3eden# wget https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz c3eden# tar xvzf gcc-10.2.0.tar.gz c3eden# cd gcc-10.2.0 c3eden# ./configure c3eden# make BOOT_CFLAGS='-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer' CHOST="i586-pc-linux-gnu" CFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer" EXTRA_ECONF=--disable-cet bootstrap
Portage 3.0.13 (python 3.8.8-final-0, default/linux/x86/17.0, gcc-9.3.0, glibc-2.32-r7, 5.4.97-gentoo-x86 i686) ================================================================= System uname: Linux-5.4.97-gentoo-x86-i686-VIA_Samuel_2-with-glibc2.1.3 KiB Mem: 890504 total, 37404 free KiB Swap: 2097148 total, 2096884 free Timestamp of repository gentoo: Thu, 18 Mar 2021 08:30:01 +0000 Head commit of repository gentoo: b65ee261731f99a2601ac71395d0fe4068b64a70 sh bash 5.0_p18 ld GNU ld (Gentoo 2.35.1 p2) 2.35.1 app-shells/bash: 5.0_p18::gentoo dev-lang/perl: 5.30.3::gentoo dev-lang/python: 3.8.8::gentoo, 3.9.2::gentoo sys-apps/baselayout: 2.7::gentoo sys-apps/openrc: 0.42.1-r1::gentoo sys-apps/sandbox: 2.20::gentoo sys-devel/autoconf: 2.69-r5::gentoo sys-devel/automake: 1.16.2-r1::gentoo sys-devel/binutils: 2.35.1-r1::gentoo sys-devel/gcc: 9.3.0-r2::gentoo sys-devel/gcc-config: 2.3.3::gentoo sys-devel/libtool: 2.4.6-r6::gentoo sys-devel/make: 4.3::gentoo sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.32-r7::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-max-age: 24 sync-rsync-extra-opts: sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes ACCEPT_KEYWORDS="x86" ACCEPT_LICENSE="* -@EULA" CBUILD="i586-pc-linux-gnu" CFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer" CHOST="i586-pc-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/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer" DISTDIR="/var/cache/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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" FCFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-march=c3 -m3dnow -O2 -pipe -fomit-frame-pointer" GENTOO_MIRRORS="http://gentoo.mirrors.ovh.net/gentoo-distfiles/" LANG="fr_FR.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" 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" USE="acl berkdb bzip2 cet cli crypt dri fortran gdbm iconv ipv6 libglvnd libtirpc ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd unicode x86 xattr zlib" ABI_X86="32" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache 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="3dnow mmx" 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="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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: CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
It should be a ./configure-time option: $ EXTRA_ECONF=--disable-cet bootstrap emerge -v1 gcc
(In reply to Sergei Trofimovich from comment #17) > It should be a ./configure-time option: > $ EXTRA_ECONF=--disable-cet bootstrap emerge -v1 gcc Sorry, trying again: $ EXTRA_ECONF=--disable-cet emerge -v1 gcc
(In reply to Sergei Trofimovich from comment #18) > (In reply to Sergei Trofimovich from comment #17) > > It should be a ./configure-time option: > > $ EXTRA_ECONF=--disable-cet bootstrap emerge -v1 gcc > > Sorry, trying again: > $ EXTRA_ECONF=--disable-cet emerge -v1 gcc Thanks. Same issue ...
I created a GCC bug : https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99703
Thank you! Yeah, it will help understanding why gcc is different from binutils (I still got no time to look at it in more detail, sorry).
They add a patch in my gcc case, and it fix the CET detection issue. I was able to apply it to the GCC master branch.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=50322c7c5fb8f869f45f8dd23a89f4a7c4b8ba2d commit 50322c7c5fb8f869f45f8dd23a89f4a7c4b8ba2d Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2021-04-08 19:36:03 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2021-04-08 19:36:03 +0000 10.2.0: revert "port binutils fix for CET detection on i486" The patch is not ready for prime time. Le't pull newer upstream version a bit later. This reverts commit 5600e4343f36e2a4925b09388d3ffe7400143b9f. Reported-by: Worx Bug: https://bugs.gentoo.org/777117 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> 10.2.0/gentoo/44_all_cet-i486.patch | 109 ------------------------------------ 10.2.0/gentoo/README.history | 1 - 2 files changed, 110 deletions(-)
Fixed in GCC 12 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99703
Let's mark it as resolved upsrtream. We'd prefer not to backport big ./configure changes to avoid future patch conflicts.
Would you accept an upstream backport from gcc-10.x or gcc-11.x branch for the patchset, given that there will be one?
I'd prefer pulling it in along with gcc release and not as a separate patch.
That means waiting for months before being able to update gcc on via targets ? gcc 12 is still not released.
For the record, i tried the patch on https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=fd7eb4bc94cafa745eba75c64fa483a1689a5aad (put it in /etc/portage/patches/sys-devel/gcc/fix-cet-detection-on-via.patch) It applies cleanly, but i still got the error. ... [ ok ] * Applying fix-cet-detection-on-via.patch ... [ ok ] ... checking for CET support... configure: error: Intel CET must be enabled on Intel CET enabled host make[2]: *** [Makefile:14842: configure-stage1-lto-plugin] Error 1 make[2]: Leaving directory '/tmp/portage/sys-devel/gcc-11.2.0/work/build' ...
Created attachment 757621 [details, diff] Backport of upstream CET configure check fix to gcc 11 I've been using the attached patch (a backport of the upstream fix) for gcc 11.1.0 and 11.2.0 successfully, but although it still applies against gcc 11.2.1_p20211127 I'm getting a new build error with that version: /var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/build/./gcc/ -B/usr/i586-pc-linux-gnu/bin/ -B/usr/i586-pc-linux-gnu/lib/ -isystem /usr/i586-pc-linux-gnu/include -isystem /usr/i586-pc-linux-gnu/sys-include -fno-checking -g -O2 -march=pentium-mmx -mtune=k6-3 -pipe -O2 -g -O2 -march=pentium-mmx -mtune=k6-3 -pipe -DIN_GCC -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wno-error=format-diag -Wold-style-definition -isystem ./include -fpic -mlong-double-80 -DUSE_ELF_SYMVER -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fno-stack-clash-protection -fpic -mlong-double-80 -DUSE_ELF_SYMVER -I. -I. -I../.././gcc -I/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgcc -I/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgcc/. -I/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgcc/../gcc -I/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgcc/../include -I/var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS -DUSE_TLS -o crtfastmath.o -MT crtfastmath.o -MD -MP -MF crtfastmath.dep -c /var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgcc/config/i386/crtfastmath.c /var/tmp/portage/sys-devel/gcc-11.2.1_p20211127/work/gcc-11-20211127/libgcc/config/i386/crtfastmath.c:40:1: error: ‘-fcf-protection’ is not compatible with this target From what I've read, the "-fcf-protection" option is related to CET, so there must be some new changes introduced in the 11.2.1_p20211127 version which aren't accounted for in my patch. It's not failing in configure any more, so the problem *isn't* the outdated config/cet.m4 file, must be something else…
(In reply to Calvin Walton from comment #30) > Created attachment 757621 [details, diff] [details, diff] > Backport of upstream CET configure check fix to gcc 11 > > I've been using the attached patch (a backport of the upstream fix) for gcc > 11.1.0 and 11.2.0 successfully, but although it still applies against gcc > 11.2.1_p20211127 I'm getting a new build error with that version: > likely related to the e.g memtest bug (bug 828081). Can you include the build.log and emerge --info? I think I know the issue.
Reverting the gentoo patch 26_all_enable-cet.patch gets me past the "-fcf-protection" build error that I was seeing. That patch says it's "Only supported on amd64." - is it not supposed to be applied on 32-bit machines?
(In reply to Calvin Walton from comment #32) > Reverting the gentoo patch 26_all_enable-cet.patch gets me past the > "-fcf-protection" build error that I was seeing. > > That patch says it's "Only supported on amd64." - is it not supposed to be > applied on 32-bit machines? Yeah, adjusting it already. It needs to just noop some of it out for 32-bit / lacking CMOV.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=10c0905feadc59bdd449f189df75c9093a27e038 commit 10c0905feadc59bdd449f189df75c9093a27e038 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-12-07 19:22:40 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-07 20:06:20 +0000 11.3.0: update CET patch to disable on 32-bit / missing CMOV Bug: https://bugs.gentoo.org/828081 Bug: https://bugs.gentoo.org/827880 Bug: https://bugs.gentoo.org/827905 Bug: https://bugs.gentoo.org/777117 Signed-off-by: Sam James <sam@gentoo.org> 11.3.0/gentoo/26_all_enable-cet.patch | 19 ++++++++++--------- 11.3.0/gentoo/README.history | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06ea13f0cc404136e28f91943ee06a9187b0b939 commit 06ea13f0cc404136e28f91943ee06a9187b0b939 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-12-07 20:07:02 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-07 20:08:27 +0000 sys-devel/gcc: fix (disable) CET for x86 / no CMOV Opting not to revbump for now as the number of people with USE=hardened && USE=cet on < i686 seems quite small; we can revisit this if necessary though. This also fixes build failures in some cases on < i686 in the same environment aforementioned. Bug: https://bugs.gentoo.org/828081 Bug: https://bugs.gentoo.org/827880 Bug: https://bugs.gentoo.org/827905 Bug: https://bugs.gentoo.org/777117 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/Manifest | 2 +- sys-devel/gcc/gcc-11.2.1_p20211127.ebuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
(In reply to Calvin Walton from comment #32) > Reverting the gentoo patch 26_all_enable-cet.patch gets me past the > "-fcf-protection" build error that I was seeing. > > That patch says it's "Only supported on amd64." - is it not supposed to be > applied on 32-bit machines? I still would've been interested in seeing the log because it should've only happened with USE=cet *and* USE=hardened. If you didn't have both of those set, I may need to fix another issue. The original bug should be fixed with 11.2.1_p20211127 anyway. Could you give that log if possible?
Created attachment 757642 [details] GCC build log (11.2.1_p20211127 with CET configure patch added) Here's the gcc build log with the "error: ‘-fcf-protection’ is not compatible with this target" problem.
Please note that *this* issue is not fixed - the gentoo patch set doesn't include the patch to fix the configure script CET detection - see attachment 757621 [details, diff]
Created attachment 757656 [details] emerge --info
Created attachment 757769 [details] gcc build logs (updated gcc-11.2.1_p20211127 with user CET configure patch) The updated version of the 26_all_enable-cet.patch *still* doesn't fix the build on my i586 system. Here's the new gcc build logs - it now fails with the same error in a different place in the build. (Also, please re-open this issue, since the original configure: error: Intel CET must be enabled on Intel CET enabled host is not fixed)
have you considered to run configure with the gcc-12 live ebuild? the linked upstream bug claims to be solved in that branch.
(In reply to Calvin Walton from comment #40) > Created attachment 757769 [details] > gcc build logs (updated gcc-11.2.1_p20211127 with user CET configure patch) > > The updated version of the 26_all_enable-cet.patch *still* doesn't fix the > build on my i586 system. Here's the new gcc build logs - it now fails with > the same error in a different place in the build. > > (Also, please re-open this issue, since the original configure: error: Intel > CET must be enabled on Intel CET enabled host is not fixed) yes, because I had to revert it for a moment (which version do you mean?)
The first build log I posted has this version of the "all_enable-cet" patch: https://gitweb.gentoo.org/proj/gcc-patches.git/tree/11.3.0/gentoo/26_all_enable-cet.patch?id=51a7ace358097005038a0d31350b0c6d3da34e00 The second build log that I posted has this version of the "all_enable-cet" patch: https://gitweb.gentoo.org/proj/gcc-patches.git/tree/11.3.0/gentoo/26_all_enable-cet.patch?id=10c0905feadc59bdd449f189df75c9093a27e038
(In reply to Calvin Walton from comment #43) > The first build log I posted has this version of the "all_enable-cet" patch: > https://gitweb.gentoo.org/proj/gcc-patches.git/tree/11.3.0/gentoo/ > 26_all_enable-cet.patch?id=51a7ace358097005038a0d31350b0c6d3da34e00 > > The second build log that I posted has this version of the "all_enable-cet" > patch: > https://gitweb.gentoo.org/proj/gcc-patches.git/tree/11.3.0/gentoo/ > 26_all_enable-cet.patch?id=10c0905feadc59bdd449f189df75c9093a27e038 Thanks a lot -- I was pretty tired last night/this morning, so I wanted to yank to the old patch (which broke the build again for you). I'm first going to fix the general x86/<i686 issue, then I'm going to see if we can use your backported patch from 12.
(In reply to Sam James from comment #44) > (In reply to Calvin Walton from comment #43) > > The first build log I posted has this version of the "all_enable-cet" patch: > > https://gitweb.gentoo.org/proj/gcc-patches.git/tree/11.3.0/gentoo/ > > 26_all_enable-cet.patch?id=51a7ace358097005038a0d31350b0c6d3da34e00 > > > > The second build log that I posted has this version of the "all_enable-cet" > > patch: > > https://gitweb.gentoo.org/proj/gcc-patches.git/tree/11.3.0/gentoo/ > > 26_all_enable-cet.patch?id=10c0905feadc59bdd449f189df75c9093a27e038 > > Thanks a lot -- I was pretty tired last night/this morning, so I wanted to > yank to the old patch (which broke the build again for you). > > I'm first going to fix the general x86/<i686 issue, then I'm going to see if > we can use your backported patch from 12. Would you mind trying PATCH_VER="2" in gcc-11.2.1_p20211127.ebuild and let me know if it helps? I've tried to exclude the irrelevant configure change hunks.
The configure patch you've included with PATCH_VER="2" is incomplete, it's missing the chunk for 'libiberty' at the very least. (It looks like you used Sergei's patch from March, which several people have reported as not working) The patch that I made in attachment 757621 [details, diff] is tested and working. I generated it by applying the upstream fixes from gcc 12, then regenerating only the 'configure' scripts for subprojects that were affected by the cet changes, so it's already nearly minimal. (There are some *apparently* irrelevant changes, but that's actually because they'd neglected to regenerate the configure scripts before releasing gcc 11. Be careful if you attempt to manually edit the patch to remove the extra changes; there's some nested if statements that are easy to get wrong. I'd suggest just taking the entire patch as-is rather than editing it.)
(In reply to Calvin Walton from comment #46) > The configure patch you've included with PATCH_VER="2" is incomplete, it's > missing the chunk for 'libiberty' at the very least. (It looks like you used > Sergei's patch from March, which several people have reported as not working) > I obviously didn't intend to pick one that didn't work :) That said, it's not slyfox's, nor is it the one which got added before. It has more hunks, but indeed misses libiberty. > The patch that I made in attachment 757621 [details, diff] [details, diff] is tested and > working. I generated it by applying the upstream fixes from gcc 12, then > regenerating only the 'configure' scripts for subprojects that were affected > by the cet changes, so it's already nearly minimal. > > (There are some *apparently* irrelevant changes, but that's actually because > they'd neglected to regenerate the configure scripts before releasing gcc > 11. Be careful if you attempt to manually edit the patch to remove the extra > changes; there's some nested if statements that are easy to get wrong. I'd > suggest just taking the entire patch as-is rather than editing it.) Well, to be fair, they _are_ irrelevant (they're to do with macOS libtool changes), hence why I was trying to exclude them. But yeah, I'm inclined to just take it as-is then. The reason I wanted to avoid that is because it complicates matters for Prefix where patches are applied for exactly that issue.
(In reply to Sam James from comment #47) > > The reason I wanted to avoid that is because it complicates matters for > Prefix where patches are applied for exactly that issue. anyway, it is what it is, it lets us drop some of the Prefix patches which is always a good thing. Please try the newer verison of the PATCH_VER=2 tarball.
Hmm. It might be possible to make a more minimal patch for this issue by rebuilding the gcc 11 configure scripts (A), applying the cet.m4 changes (I've included references to the two commits needed in my patch header), rebuilding the configure scripts again (B), and then using the diff between (A) and (B). I can look into that, but it'll probably be a day or two to get around to it. If you can beat me to it, all the better :) Note that my patch might be missing some of the MacOS-related changes, because (IIRC) I only included configure scripts that were affected by the cet changes. Some of the configure scripts that only had libtool-related changes might not be included.
(In reply to Calvin Walton from comment #49) > Hmm. It might be possible to make a more minimal patch for this issue by > rebuilding the gcc 11 configure scripts (A), applying the cet.m4 changes > (I've included references to the two commits needed in my patch header), > rebuilding the configure scripts again (B), and then using the diff between > (A) and (B). > Either that or try revert the macOS changes to get a cleaner diff maybe. > I can look into that, but it'll probably be a day or two to get around to > it. If you can beat me to it, all the better :) I suspect I'm going to have to spend a fair bit more time making sure the default-CET stuff is okay to avoid any more issues, so if you do end up being able, it's very much appreciated. Thanks a lot for your efforts here.
Created attachment 757789 [details, diff] Backport of upstream CET configure check fix to gcc 11 (minimal) I found some time (and used a computer that's not 20 years old...) to create a minimal CET configure patch as I had previously described. In my testing the behaviour in regards to the CET fix is the same as my previous patch, just in a more compact & easier to digest form.
Created attachment 757790 [details, diff] Regenerate-all-configure-files-for-GCC-11.patch As a side-effect of the method I used to generate the CET configure patch, I also made this patch, which comprehensively regenerates all of the configure files in gcc 11. It's not directly applicable to this issue, but I suppose you might find it useful in some way? This updates a bunch of configure files which changes that had been committed to the gcc 11 branch, but for which the configure file regeneration had been missed. This patch is *completely independent* from the CET configure patch; you can apply either one or both of them, in any order.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=95b03a54532e0a0a925e6d93deb7a66ea8c6f4be commit 95b03a54532e0a0a925e6d93deb7a66ea8c6f4be Author: Calvin Walton <calvin.walton@kepstin.ca> AuthorDate: 2021-12-16 08:28:50 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-18 22:00:28 +0000 11.3.0: refine backported PR99703 fix (allow disabling CET on i486) Minimise configure patch to ease future patching. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27397 Bug: https://bugs.gentoo.org/777117 Signed-off-by: Sam James <sam@gentoo.org> ...=> 75_all_x86_PR99703_12_no-cet-for-i486.patch} | 168 +++------------------ 11.3.0/gentoo/README.history | 2 +- 2 files changed, 25 insertions(+), 145 deletions(-) https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=f233b7cc729cc0c29da815c8e102f889c1ffe8ea commit f233b7cc729cc0c29da815c8e102f889c1ffe8ea Author: Calvin Walton <calvin.walton@kepstin.ca> AuthorDate: 2021-12-09 02:58:04 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-18 22:00:28 +0000 11.3.0: backport PR99703 fix (allow disabling CET on i486) Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27397 Bug: https://bugs.gentoo.org/777117 Signed-off-by: Sam James <sam@gentoo.org> .../75_all_x86_PR99703_12_no-cet-for-i586.patch | 509 +++++++++++++++++++++ 11.3.0/gentoo/README.history | 3 +- 2 files changed, 511 insertions(+), 1 deletion(-) https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=34cc4c2a7c835b5787ab1cd5d22ed72e3be2132b commit 34cc4c2a7c835b5787ab1cd5d22ed72e3be2132b Author: Sam James <sam@gentoo.org> AuthorDate: 2021-12-09 02:40:05 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-18 22:00:28 +0000 11.3.0: update CET patch to disable on 32-bit / missing CMOV, deux Bug: https://bugs.gentoo.org/828546 Bug: https://bugs.gentoo.org/828549 Bug: https://bugs.gentoo.org/828081 Bug: https://bugs.gentoo.org/827880 Bug: https://bugs.gentoo.org/827905 Bug: https://bugs.gentoo.org/777117 Signed-off-by: Sam James <sam@gentoo.org> 11.3.0/gentoo/26_all_enable-cet.patch | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58c2f6c4fb228ddc7b17698673fbf80400a452e9 commit 58c2f6c4fb228ddc7b17698673fbf80400a452e9 Author: Sam James <sam@gentoo.org> AuthorDate: 2021-12-18 22:01:34 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2021-12-18 22:03:06 +0000 sys-devel/gcc: switch patchset version for 11.2.1_p20211127 for CET fixes If hitting related issues before this, please try emerge -v1 sys-devel/gcc. Doesn't seem to have affected many people at all (just tinderbox?) so not worth a revbump (at this point, anyway). Also includes fix for i486 CET (unrelated). Closes: https://bugs.gentoo.org/828546 Closes: https://bugs.gentoo.org/828549 Closes: https://bugs.gentoo.org/828081 Closes: https://bugs.gentoo.org/827880 Closes: https://bugs.gentoo.org/827905 Closes: https://bugs.gentoo.org/777117 Signed-off-by: Sam James <sam@gentoo.org> sys-devel/gcc/Manifest | 2 +- sys-devel/gcc/gcc-11.2.1_p20211127.ebuild | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)