summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* toolchain.eclass: refactor common ada and d bootstrap codeAndrei Horodniceanu12 min.1-56/+112
| | | | | | | | | | | | Additionally, when cross compiling only look for a bootstrap gcc that matches the SLOT that is currently being built since both ada and d would fail with any other version. Also correct some CBUILD vs CHOST usage to support cross-compiling ada. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me> Closes: https://github.com/gentoo/gentoo/pull/39019 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add more mirrors to EGIT_REPO_URISam James3 hours1-1/+6
| | | | | | | | | | sourceware was down earlier, so add some mirrors. sourcehut is an official mirror (albeit an experiment IIRC) by sourceware and x86-gcc is run by H.J. Lu. gcc-mirror on github (which was in the list already) looks like an automatic one but let's leave it last. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: move more for nvptxSam James22 hours1-4/+4
| | | | | Bug: https://bugs.gentoo.org/945296 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: move nvptx files to accel/ subdirSam James23 hours1-0/+18
| | | | | | | | | | This is what Fedora does and it seems to have fixed the issue I was having with needing to manually move libgomp.{a,spec} and then after that, getting undefined references to gomp_nvptx_main (which I assume is because the plugin wasn't being loaded). Bug: https://bugs.gentoo.org/945296 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: filter -Werror=format-securitySam James31 hours1-0/+3
| | | | | Bug: https://gcc.gnu.org/PR100431 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: wire up offloading for nvptxSam James31 hours1-2/+30
| | | | | | | | | | | | 'crossdev -t nvptx-none' creates a standalone cross-compiler which is needed anyway, but by itself, it's less useful than offloading support within host gcc, where GCC can choose to offload into that cross-compiler as appropriate. This could include amdgcn-amdhsa support in the future. Bug: https://bugs.gentoo.org/945296 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: wire up nvptx moreSam James34 hours1-1/+2
| | | | | | | | | We need to handle nvptx* in CTARGET in a few more places so we propagate that we're using newlib (which is obviously right but also means we don't then fail when building libatomic b/c libg.a is missing). Bug: https://bugs.gentoo.org/945296 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: Throw an error if trying to disable time64Michał Górny7 days1-0/+13
| | | | | | | | | | | Throw an error if the user is trying to build a non-time64 version of GCC on a system featuring a time64 GCC already. Most of the time, this will mean that the user has accidentally switched to a non-time64 profile. Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/39384 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain.eclass: filter ↵Sam James9 days1-0/+1
| | | | | | -fdiagnostics-set-output=text:experimental-nesting=yes for < 15 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: revert Ada changes for nowSam James11 days1-4/+4
| | | | | | | | | I need to do some more. Revert my earlier changes for now. Reverts: 97069fd8721ea55980e548b9cf1d55e2a234a514 Reverts: 0a0b2fe6aadb9d0c3b41fdabb21535659c839bf5 Reverts: 1b5d47858780c700e706582aa370a69148552055 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: another Ada cross fixSam James11 days1-1/+1
| | | | | | | Followup followup to 0a0b2fe6aadb9d0c3b41fdabb21535659c839bf5 and 1b5d47858780c700e706582aa370a69148552055. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: followup Ada fixSam James11 days1-1/+1
| | | | | | Followup to 1b5d47858780c700e706582aa370a69148552055. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix Ada bootstrap paths for crossSam James11 days1-2/+2
| | | | | | | Same sort of thing as 434a6775ce93a15ef517478565a938aa73d1d528 although the paths are different as we're using something from libexec (gnat1). Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix libdiagnostics handling (more)Sam James12 days1-1/+1
| | | | | | | | | | I continue to mix up how tc_version_is_at_least works. One day I'll change it... Closes: https://bugs.gentoo.org/944007 Fixes: f6a974f8f2378c6c6a83345c101afce233fdf1d7 Fixes: b923a4c0d1a330e40f0a05f3bc94bb4f32ce1cbb Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix libdiagnostics handlingSam James12 days1-1/+4
| | | | | | | | | | Reported by ulm. This was introduced by a last-minute simplification I made, but USE=libdiagnostics only exists for 9999 and the *next* snapshot, not the current one, but even then, the code was wrong for < 15 as the use_enable part was run unconditionally w/ USE=jit. Fixes: b923a4c0d1a330e40f0a05f3bc94bb4f32ce1cbb Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: wire up libdiagonsticsSam James12 days1-2/+6
| | | | | | | See https://gcc.gnu.org/wiki/libdiagnostics. New shared library for diagnostics in GCC. Also provides the 'sarif-replay' tool. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: drop -g for src_testSam James13 days1-4/+0
| | | | | | | | | | | | | | | I was seriously mistaken on this: `1 file changed, 2228 deletions(-)` when testing dropping it. -g ultimately causes many more matches because of debug statements and it confuses so many tests. I must have just made an error when testing other big test flag changes around the time. This reverts commit 7200aecb3db3b2dd91129e1530bcb75ce096af91. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: only show checking warning w/ USE=-debugSam James13 days1-5/+7
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix time64 conditional for kgcc64Sam James2024-11-141-1/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: unconditionally pass --disable-cet on x86Andrei Horodniceanu2024-11-131-0/+1
| | | | | | | | | | | | | | | d6cb7a61dad7e9672a8448597835dbbf9b9e0ccf removed the check that passed --enable-cet or --disable-cet to configure making the script fallback to automagic. The goal was to prevent passing --enable-cet on x86 gnu triples as that would lead to gcc failing to build under crossdev. Note that this specific crossdev cet issue has been solved in crossdev by package.use.mask'ing the cet USE flag for gcc on x86 but targets configured before that can still have the cet USE flag enabled. Bug: https://bugs.gentoo.org/943332 Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me> Closes: https://github.com/gentoo/gentoo/pull/39300 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: Disable CET on x86Ian Jordan2024-11-121-1/+0
| | | | | | | | | | | | | Remove enable_cet_for 'i[34567]86' 'gnu' 'cet' from to prevent -fcf-protection on x86 systens where CET support will never be fully enabled anyway. This should help with bug #933772 also but I was unable to reproduce to confirm. Closes: https://bugs.gentoo.org/943332 Bug: https://bugs.gentoo.org/933772 Thanks-to: Sam James <sam@gentoo.org> Signed-off-by: Ian Jordan <immoloism@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add comment explaining --with-newlibSam James2024-11-111-1/+4
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: Check for gnu environment when enabling cet on x86Andrei Horodniceanu2024-11-101-1/+1
| | | | | | | | | | Like we do for arm64 and amd64, diverge from the upstream check for linux and only enable it for gnu triples. Closes: https://bugs.gentoo.org/942951 Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me> Closes: https://github.com/gentoo/gentoo/pull/39228 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: call rust_pkg_setup for USE=rustSam James2024-11-091-0/+2
| | | | | | Followup to 583a1a9ac556d01e1b0df6fe64e67cb646fa4118. Noticed by inspection. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain: inherit rust eclass for `RUST_DEPEND`Matt Jolly2024-11-091-2/+4
| | | | | | | `RUST_OPTIONAL` is set so that ebuilds must explicitly consume Rust features. Signed-off-by: Matt Jolly <kangie@gentoo.org>
* toolchain.eclass: further death hook fixesSam James2024-11-061-3/+3
| | | | | Fixes: d82f81cd65b9a668bd7940151e3fa876d4b0ce92 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix death hooks for JIT buildSam James2024-11-031-12/+15
| | | | | | | | We want to recover logs from that too. Bug: https://bugs.gentoo.org/942769 Fixes: 5bed0c77a1c54ac9297db4bb54af2e45c0558ec7 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: Add USE=time64 to 14.2.1_p20241026 and newerMichał Górny2024-11-011-0/+4
| | | | | Acked-by: Sam James <sam@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain.eclass: filter -fdiagnostics-details tooSam James2024-10-301-1/+1
| | | | | | Same as 72d5ea56d41b7d5aac351854b7479f5c2c430c83, the flag got renamed. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: filter -Warray-bounds if building DSam James2024-10-301-0/+5
| | | | | | Bug: https://gcc.gnu.org/PR116975 Closes: https://bugs.gentoo.org/940750 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: filter -fdiagnostics-explain-harderSam James2024-10-211-0/+4
| | | | | | | | This is an experimental flag not yet merged upstream but filtering it makes it easier to test with so it doesn't confuse older unpatched (locally) GCCs. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: drop support for EAPI 6David Seifert2024-10-081-4/+4
| | | | Signed-off-by: David Seifert <soap@gentoo.org>
* toolchain.eclass: Print an error message and die if GDC isn't foundAndrei Horodniceanu2024-10-071-2/+17
| | | | | | | | | | | When cross compiling sys-devel/gcc[d] one would need cross-${CHOST}/gcc[d] installed. We can't enforce this dependency so defer to printing an error message if it can't be found prompting the user to install the package. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me> Closes: https://github.com/gentoo/gentoo/pull/38894 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: Only search for a D installation if D bootstrapping is neededAndrei Horodniceanu2024-10-071-1/+4
| | | | | | | | <=gcc-11 doesn't need another gdc to build so don't search for one during the setup. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me> Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: Support cross GDCAndrei Horodniceanu2024-10-071-6/+15
| | | | | | | | | | | | | | | | | | | | While the D use flags is masked by crossdev the build used to work, on my limited number of machines, up until recently with the D code refactors. When building sys-devel/gcc or cross-${TARGET}/gcc natively the appropriate gdc compiler is installed under /usr/${CHOST}/gcc-bin and is provided by sys-devel/gcc[d]. When building sys-devel/gcc or cross-${CTARGET}/gcc for another system the appropriate gdc binary is under /usr/${CBUILD}/${CHOST}/gcc-bin and is provided by cross-${CHOST}/gcc[d]. Also use the full ${CHOST}-gdc executable names since plain gdc is only present on native builds. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me> Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: also clear GDCFLAGS when cross-compilingAndrei Horodniceanu2024-10-071-0/+1
| | | | | | | | | | | | | | sys-devel/gcc[d] uses GDCFLAGS when compiling the D parts. GDCFLAGS is also used by ::dlang in a similar manner. The overlay suggests putting in the variable similar values to CFLAGS so it's possible that it will contain -march=native. Because of this, add GDCFLAGS to the list of *FLAGS that are reset to something that is understood by both the build and the host system when cross-compiling. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me> Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add ewarns to explain USE=-debug behaviour w/ unreleased GCCSam James2024-10-041-1/+9
| | | | | | | | | | | | | | | | We sometimes have people surprised by the behaviour with USE=-debug for unreleased versions of GCC. For more detail on that & context, see: * 564b130fd1bc8a35ac4d673d5211654c49af3fda * 85db50a7c626a1844c8eb2d03051c8c5d320c205 * 3f9a5248fb796417d63ae1c1234b534a88f22f14 Add some ewarns to explain the situation to users so they understand their options and also don't wrongly think GCC will be slow when released. Bug: https://bugs.gentoo.org/904481 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix seq paramsSam James2024-10-031-2/+2
| | | | | | | I didn't notice as I tested on a machine with ${SLOT} available. Fixes: c9f79ed713758a95abea32d9c41f4f2a49f999b2 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: change iteration strategy for GNAT and GDCSam James2024-10-031-8/+10
| | | | | | | | | | | | | | | This improves upon the strategy from 9bb87839a6ad66ee7c89837a546fbf2e7f69b577 and d1aa56b6e39f07490021e594920f4a965a968c07. Earlier, I saw building GCC 15's gdc fail w/ bootstrap from 10, even though we had 11/12/13/14 installed. The new logic is as follows, with descending order of preference: 1) Match the version being built; 2) Iterate downwards from the version being built; 3) Iterate upwards from the version being built to the greatest version installed. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: print all relevant flags, not just C{,XX}FLAGS + LDFLAGSSam James2024-10-021-3/+4
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: restrict *FLAGS for stage1 compiler when bootstrappingEli Schwartz2024-10-011-0/+7
| | | | | | | | | | | e.g. if gnat1 from a bootstrap compiler is older than the host compiler itself, we are going to end up passing flags that the host compiler does understand, but gnat1 does not. This is trivially broken with -march=native (passes loads of flags) and also more plebeian things such as -march=x86-64-v3 which is sadly too new for gnat-10 Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> Reviewed-by: Sam James <sam@gentoo.org>
* toolchain.eclass: also reset STAGE1_CXXFLAGS for old compilersEli Schwartz2024-10-011-0/+1
| | | | | | | | | | Since commit a9156e205ca667cf40f43329b5bc22749f166501 we pass CXXFLAGS as well, but it didn't include the existing logic we have for checking if you have a really old compiler and taking precautions to avoid garbage codegen breaking the stage1 compiler. Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> Reviewed-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix typo that prevented configuring with USE=adaEli Schwartz2024-10-011-1/+1
| | | | | | | | | | | | | | | We need a bootstrap (version) and a bootstrap_type (value irrelevant for now except to flag whether it is ada-bootstrap). Due to a typo, we set the former first to the detected slot and then immediately to the value "gcc", which made no sense since "gcc" isn't a valid SLOT version of gcc. Hence we tried to run ${triplet}-gcc-gcc instead of running ${triplet}-gcc-${SLOT}. Only reproducible when using gnat-gpl itself as the gcc edition. Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> Reviewed-by: Sam James <sam@gentoo.org>
* toolchain.eclass: conditionally pass -Wno-complain-wrong-lang for >= GCC 13Sam James2024-10-011-4/+8
| | | | | | | | ... ditto for -Wno-format-security and so on. It causes far more noise than test cases it helps with. Of course, when we have -Wno-complain-wrong-lang available (in >= GCC 13), then it's worth it. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: don't pass --specs= to gnat* toolsSam James2024-10-011-1/+1
| | | | | | | | | The gnat* tools don't understand --specs=* and we only need to do that to ensure the compiler driver (gcc) calls the right things anyway. What we might have to do in future however is force --gcc and --link... Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: Try harder to disable cet automagicAndrei Horodniceanu2024-10-011-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On arches that support USE=cet (those being amd64, arm64, and, x86) always pass --enable-cet or --disable-cet (or aarch64 standard-branch-protection equivalent) to prevent any configure automagic from happening. Preserve the same CTARGET logic so only pass --enable-cet if the target environment supports it and if `use cet`. Also fix the regex `i[[34567]]86` as that matches an i, followed by any of the digits from 3 to 7 or the [ character, followed by ], followed by 8, followed by 6. The regex originated in config/cet.m4 which uses [] for quotes. The automatic specifically breaks gcc[d] on musl because it prevents the code from using an internal assembly implementation for a function and deferring to using an implementation that would be provided by sys-libs/libucontext which results in undefined symbol errors: ``` /usr/lib/gcc/x86_64-pc-linux-musl/11/../../../../x86_64-pc-linux-musl/bin/ld: /usr/lib/gcc/x86_64-pc-linux-musl/11/libgphobos.a(fiber.o): in function `_D4core6thread5fiber5Fiber9initStackMFNbNiZv': (.text._D4core6thread5fiber5Fiber9initStackMFNbNiZv+0x2e): undefined reference to `getcontext' /usr/lib/gcc/x86_64-pc-linux-musl/11/../../../../x86_64-pc-linux-musl/bin/ld: (.text._D4core6thread5fiber5Fiber9initStackMFNbNiZv+0x5f): undefined reference to `makecontext' /usr/lib/gcc/x86_64-pc-linux-musl/11/../../../../x86_64-pc-linux-musl/bin/ld: /usr/lib/gcc/x86_64-pc-linux-musl/11/libgphobos.a(fiber.o): in function `_D4core6thread5fiber5Fiber12_staticCtor1FZv': (.text._D4core6thread5fiber5Fiber12_staticCtor1FZv+0x1c): undefined reference to `getcontext' ``` Bug: https://bugs.gentoo.org/939874 Closes: https://bugs.gentoo.org/918692 Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me> Closes: https://github.com/gentoo/gentoo/pull/38830 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: reflow comments slightlySam James2024-10-011-7/+7
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: further special-case dropping for ada-bootstrapSam James2024-10-011-19/+12
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: go back to PATH lookup for Ada wrappersSam James2024-10-011-1/+1
| | | | | | | This should work now that we install gcc-config-style symlinks in ada-bootstrap. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: small ada-bootstrap tweaksSam James2024-10-011-5/+6
| | | | | | | | * Don't try to do a PATH lookup for the wrappers for now; need to install more symlinks in ada-bootstrap, I think * Style tweaks Signed-off-by: Sam James <sam@gentoo.org>