summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* toolchain.eclass: abort if hybrid CPU detected w/ -march=nativeSam James2024-03-241-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* toolchain.eclass: improve hybrid checkSam James2024-03-241-2/+2
| | | | | | | | | Thanks to stikonas for debugging on IRC. Bug: https://bugs.gentoo.org/904426 Bug: https://bugs.gentoo.org/908523 Bug: https://bugs.gentoo.org/915389 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fortify hybrid workaroundSam James2024-03-231-1/+2
| | | | | | | | | | | | | * Make sure the result is non-empty before trying to use it as an index * Make sure the result is an integer before trying to use it as an index * Don't try to set --param ... if we had no result at all These are good ideas anyway but they happen with gnat-gpl as apparently older GCC didn't actually have the l1-cache-size thing (I thought it was a bit older than 10). Whatever. Closes: https://bugs.gentoo.org/927646 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: another error handling fixSam James2024-03-231-2/+3
| | | | | Fixes: f81ec884754b3f3d3720d40b212e12ef364821c5 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: another error handling fixSam James2024-03-231-2/+2
| | | | | | | | This one seems to be part of the previous block and was missing a comment / had misleading whitespace. Fixes: f81ec884754b3f3d3720d40b212e12ef364821c5 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: prettify gcc bz linksSam James2024-03-231-8/+8
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: drop stale autoconf 2.13 handlingSam James2024-03-231-10/+0
| | | | | | | | I knew I was meant to do something before pushing the tests branch.. (retry with the extra error handling). Fixes: f81ec884754b3f3d3720d40b212e12ef364821c5 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add various missing error handlingSam James2024-03-231-17/+17
| | | | | | Prompted by Ionen. Signed-off-by: Sam James <sam@gentoo.org>
* Revert "toolchain.eclass: default to just running the (execute) torture tests"Sam James2024-03-231-2/+2
| | | | | | This reverts commit 97b5abe929550453932060bbf078bb4352b400c1. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: default to just running the (execute) torture testsSam James2024-03-231-2/+2
| | | | | | | | | The (execute) torture tests are a nice subset we can run to make sure things aren't totally hosed. Can be overridden by setting GCC_TESTS_CHECK_TARGET=check, GCC_TESTS_RUNTESTFLAGS="". Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: don't install all .sum filesSam James2024-03-231-3/+2
| | | | | | | | | | Just rely on the validate_failures.py manifests instead. These logs get real big real fast. People can save build logs if they want to look at the tests otherwise. Bug: https://bugs.gentoo.org/214345 Bug: https://bugs.gentoo.org/253926 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: rework tests moreSam James2024-03-231-38/+110
| | | | | | | | | | | | | | Rework src_test around contrib/testsuite-management/validate_failures.py in gcc.git. This script is being used by the new Linaro CI effort and it appears well-suited to us, as it allows marking expected failures easily. Followup to 9ac3f1cf62b522236ba9efd7e923071c37df1e6d. Bug: https://bugs.gentoo.org/214345 Bug: https://bugs.gentoo.org/253926 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: install test results as orphaned files in /var/cache/gccSam James2024-03-231-11/+21
| | | | | | | | | | | | This allows comparison across versions even after they get upgraded, which is useful in itself (and across series), but also for looking into when regressions started if they're reported but started a while ago. Followup to 9ac3f1cf62b522236ba9efd7e923071c37df1e6d. Bug: https://bugs.gentoo.org/214345 Bug: https://bugs.gentoo.org/253926 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add CHOST to test data pathSam James2024-03-231-8/+8
| | | | | | | We get collisions for cross-compilers otherwise. Closes: https://bugs.gentoo.org/925037 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: use extglob for hybrid hackSam James2024-03-231-1/+1
| | | | | | Thanks Ionen! Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: split condition for readabilitySam James2024-03-231-1/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add workaround for hybrid CPUsSam James2024-03-231-0/+18
| | | | | | | | | | | | | | Hybrid/big.little/PE CPUs may report an inconsistent cache size across cores which can cause GCC's bootstrapping to fail its self-comparison. When CBUILD is amd64 or x86 and -march=native is in CFLAGS, iterate over all cores and record l1-cache-size. If any differ, use the first one we found. Bug: https://gcc.gnu.org/PR111768 Closes: https://bugs.gentoo.org/904426 Closes: https://bugs.gentoo.org/908523 Closes: https://bugs.gentoo.org/915389 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix whitespaceSam James2024-03-231-1/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: More selectively enable cet per archKyle Elbert2024-03-181-1/+1
| | | | | | | | | | | This block enables the x86_64 specific -fcf-protection during bootstrap. Added check to ensure its only enabled there. Bug: https://bugs.gentoo.org/916381 Fixes: b6bf005b843e3d6ee10aa1f088d93c4f89055cc6 Signed-off-by: Kyle Elbert <kcelbert@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/35816 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: Make CET auto-apply x86-64 flags also outside hardenedAndreas K. Hüttel2024-03-171-4/+5
| | | | Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* toolchain.eclass: handle quoted whitespace in EXTRA_ECONFMike Gilbert2024-03-111-1/+2
| | | | | | Code taken from econf in Portage. Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* toolchain.eclass: Selectively enable cet options per archAndreas K. Hüttel2024-03-121-4/+2
| | | | | Bug: https://bugs.gentoo.org/916381 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* toolchain.eclass: pass --enable-standard-branch-detection if USE=cetSam James2024-03-111-1/+4
| | | | | | | | | This enables BTI and PAC if supported for arm64. We decided to overload USE=cet to avoid adding yet-another-USE flag to GCC, given it's the same thing. Bug: https://bugs.gentoo.org/916381 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: enable LTO for libgccjit buildSam James2024-03-071-1/+1
| | | | | | | | Note that this is just about LTO support, not building it with LTO. See https://inbox.sourceware.org/jit/dd6f69da-757b-49ba-864a-377a8dc393cf@zoho.com/T/#t. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: allow fixincludes for mingw & special MIPS targetSam James2024-02-231-0/+16
| | | | | | | | | | | | | config/i386/t-cygming always sets STMP_FIXINC regardless of the configure arg for fixincludes, so don't disable it there. The only other case is config/mips/t-sdemtk which I've handled too. Exposed by 0b75d3ce0bae8240c28c6a8f191f5130548f8475. Bug: https://bugs.gentoo.org/905118 Closes: https://bugs.gentoo.org/925204 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: explicitly disable fixincludes for cross tooSam James2024-02-191-2/+2
| | | | | | | Just in case, although the condition is unlikely there now. Bug: https://bugs.gentoo.org/905118 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: rework fixincludes againSam James2024-02-191-3/+20
| | | | | | | | | | | | | | | | | | | | | * Only run fixincludes for >= GCC 13 with <sys-libs/glibc-2.38. * Refactor the logic while at it to make it easier to control (as we do some bits depending on it in src_install). Doing this after getting for cross: ``` The directory (BUILD_SYSTEM_HEADER_DIR) that should contain system headers does not exist: /usr/lib/gcc/aarch64_be-unknown-linux-gnu/14/include make[2]: *** [Makefile:3448: stmp-fixinc] Error 1 make[2]: *** Waiting for unfinished jobs.... ``` This should also let us drop the patch for bug #905118 now. Bug: https://bugs.gentoo.org/905118 Bug: https://gcc.gnu.org/PR107128 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: ignore GCC version mismatch for live ebuildsSam James2024-02-051-1/+1
| | | | | | | | | | | We want to have live ebuilds use e.g. 14.0.9999. not 14.0.1.9999 which is inconsistent and requires a rename/adjustment to package.accept_keywords files when going from stage3->stage4 (.0 -> .1). We can do this now because we use --with-major-version-only nowadays, so SLOT matches the installed path of just '14'. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: don't take shortcut for non-GCC bootstrap compilerSam James2024-02-031-1/+1
| | | | | | | | | We're fragile for stage0 so if we're not building using GCC, use -O0. The use of regular CFLAGS/CXXFLAGS there should be seen as a bonus as it has some caveats. Best to play it safe to avoid confusing hard-to-diagnose differences later on. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: delete libstdc++exp.la tooSam James2024-02-011-0/+1
| | | | | | Reported by negril. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: compress slotted man pages & info pagesSam James2024-01-231-0/+2
| | | | | | | | | | As noted in the bug, we install to a different location to accommodate slotting and hence do not benefit from the automagic compression for /usr/share/doc. Explicitly opt-in for the man pages & info pages we install. Bug: https://bugs.gentoo.org/922729 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: require >=sys-devel/gcc-config-2.11 for portageq fixesSam James2024-01-231-1/+1
| | | | | Bug: https://bugs.gentoo.org/906329 Signed-off-by: Sam James <sam@gentoo.org>
* Move {dev-util → dev-debug}/systemtapMichał Górny2024-01-191-1/+1
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Move {dev-util → dev-debug}/valgrindMichał Górny2024-01-131-1/+1
| | | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/34786 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain.eclass: don't enable PCH by default in IUSE (but effective noop)Sam James2024-01-121-1/+1
| | | | | | It's already masked in use.mask, even. PCH has been proven to be unreliable. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: drop USE="cilk mpx" debrisSam James2024-01-121-13/+0
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: drop noop USE=nptlSam James2024-01-121-1/+1
| | | | | | | | | | | | This doesn't make sense to toggle nowadays anyway given linuxthreads is long gone, but it's not even wired up to do anything in the eclass. The last remaining consumer was for uclibc which was dropped in 4d33143e5b807af00d29ec59d9512ac05ab0e131. Bug: https://bugs.gentoo.org/642932 Bug: https://bugs.gentoo.org/820905 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: go back to flexSam James2024-01-081-1/+1
| | | | | | | We should really tighten this so it's only for snapshots though... Closes: https://bugs.gentoo.org/921620 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix lex, yacc versionsSam James2024-01-081-2/+2
| | | | | | Fixes: b8300e99e7137925c73f1d067caed8af4f77dc1b Fixes: 4c621abb2923e1085cc4aaf67c30901510d8b3c0 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: sys-devel/bison -> app-alternatives/yaccSam James2024-01-081-1/+1
| | | | | | | | | All of these will be using app-alternatives/yacc anyway as they're not unsetting YACC or LEX, so make the dep reflect reality. (Included both YACC and LEX out of conservatism.) Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: sys-devel/flex -> app-alternatives/lexSam James2024-01-081-2/+2
| | | | | | | | | All of these will be using app-alternatives/lex anyway as they're not unsetting YACC or LEX, so make the dep reflect reality. (Included both YACC and LEX out of conservatism.) Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: restore graphite for USE=jit minimal buildSam James2023-11-091-1/+4
| | | | | | | | | | | | | | graphite (isl) might be used for the just-built GCC. It's easier to just respect USE=graphite for the USE=jit minimal build in case the user passes some graphite flags rather than try strip them out. (The build would fail otherwise as the just-built GCC, even with --disable-bootstrap for the JIT build, would be invoked as ./xgcc ... -fgraphite-identity ... and error out in configure.) Reported by ano on IRC. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: filter -Walloc-size for < GCC 14Sam James2023-11-081-0/+3
| | | | | | New in GCC 14. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: only pass -fno-harden-control-flow-redundancy for new ↵Sam James2023-10-271-3/+3
| | | | | | | | enough GCC too Even if it's OK for the stage1 compiler, it may not be later. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add -fno-harden-control-flow-redundancy to old-compiler ↵Sam James2023-10-271-3/+3
| | | | | | filter too Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: pass -fno-control-flow-redundancy, filter flags for older ↵Sam James2023-10-261-0/+12
| | | | | | | | | | | | | compilers too If we're *building* an older GCC, then these flags won't be supported later on during the boostrap process, so filter them out. Also, pass -fno-control-flow-redundancy given it makes the compiler unbearably slow (on a 3950x, it went from 2.5hours for pgo+lto+checking to 6+ hours) and it doesn't really benefit us there anyway. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: handle ABIs with no multilib flagsSam James2023-09-301-1/+3
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: tidy up USE=jit buildSam James2023-09-301-16/+36
| | | | | | | | | | | | | | * Pass --disable-fixincludes for newer GCCs for USE=jit (still need to try disable it in general when we can, but we had to turn it on for a bit because of newer glibc) as it's pointless there. * Disable a bunch of other options for the JIT build, imported from my local script for bisecting GCC. * While at it, use an array for the configure args for the JIT build and just use emake -C. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: support bootstrap-O3Sam James2023-09-301-7/+15
| | | | | | | Upstream are fine with bootstrapping with -O3, so don't strip it out if the user set it, even with USE=-custom-cflags. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: rework bootstrapping logicSam James2023-09-301-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Build stage1 compiler with user's CFLAGS. This consistently ends up saving at least 15 minutes for me on a fast amd64 machine and should save more on slower machines and architectures. There's only any risk here if the host compiler is ancient/very buggy and even then, you get a failed bootstrap later on. The GCC developers, per the linked bug, end up using STAGE1_CFLAGS="-O2" anyway to speed up the process so it's not like this is untested at all. mattst88 actually brought this up.. 10 years ago (bug #477548). Let's try make that right now. * Respect LDFLAGS for target libraries for native builds. Not touching this for cross builds, at least for now, as it's a bit more delicate. (Unfortunately, we have to put a hack in here for now until we can fix multilib.eclass - see bug #914881). Bug: https://gcc.gnu.org/PR111619 Bug: https://bugs.gentoo.org/914881 Closes: https://bugs.gentoo.org/477548 Closes: https://bugs.gentoo.org/831423 Closes: https://bugs.gentoo.org/840392 Apologies-to: Matt Turner <mattst88@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>