summaryrefslogtreecommitdiff
path: root/eclass
Commit message (Collapse)AuthorAgeFilesLines
...
* toolchain.eclass: add comment re GCC_TEST_RUN_EXPENSIVESam James2024-08-121-0/+2
| | | | | | | | Make clear it's not a typo as it comes from gcc's testsuite (could look like an accidental 'TEST' instead of 'TESTS' like the eclassvars we use for tests.) Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: style tweakSam James2024-08-111-1/+1
| | | | | | For consistency. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: disable multilib tests for nowSam James2024-08-101-2/+3
| | | | | | | | ... until validate_failures.py can handle them properly, to avoid trashing our test manifests. Bug: https://gcc.gnu.org/PR116260 Signed-off-by: Sam James <sam@gentoo.org>
* eclass/toolchain-funcs: add support for Prefix targetsFabian Groffen2024-08-101-2/+13
| | | | | | | | - support Darwin - support arm64 (Apple Silicon) Darwin - skip gen_usr_ldscript on Prefix targets Signed-off-by: Fabian Groffen <grobian@gentoo.org>
* kernel-install.eclass: run depmod after compressing modulesAndrew Ammerlaan2024-08-091-0/+3
| | | | | | | | | | | | (de)compressing modules changes the path of the module files so we need to run depmod to ensure that tools such as modprobe/modinfo work. Note that depmod is often, but *not* always, run by sys-kernel/installkernel. Systemd installs a hook to do this, but there is no equivalent on openrc systems. So instead just ensure that the tree of modules we install is consistent here in the eclass. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* toolchain.eclass: tidy up src_test a bit more, another tweakSam James2024-08-091-11/+8
| | | | | | | | | * Disable -fno-semantic-interposition for tests as ASAN + contract violation checks rely on it * Consolidate the appends vs. filters Signed-off-by: Sam James <sam@gentoo.org>
* Revert "toolchain.eclass: drop *_FOR_TARGET in src_test"Sam James2024-08-091-0/+6
| | | | | | | | This reverts commit c87ab053be64e6c9f7b9e4ab1cca3099e37471f0. I think I was wrong. Gah. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: drop *_FOR_TARGET in src_testSam James2024-08-091-6/+0
| | | | | | | We seem to fail way more tests like the gcov ones for this, I guess it overrides the flags it adds somehow. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: filter more flags in src_testSam James2024-08-091-0/+7
| | | | | | | | * Drop diagnostic flags (colour, URLs) which may break tests * Drop QA flags to check if *FLAGS are respected; not necessary for tests and may confuse e.g. export checks (as with mesa). Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add another TODO for tests wrt ABIsSam James2024-08-091-0/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* llvm.org.eclass: Add 20.0.0_pre20240808 snapshotMichał Górny2024-08-081-0/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* (dist-)kernel-{install,utils}.eclass: fix finding config during cleanupAndrew Ammerlaan2024-08-082-4/+16
| | | | | | | | | | | | The source symlink does not exist on all systems. If we can't find any config at all then there will be no preferred suffix which means we fall back to the old '-nt' based cleaning. Closes: https://bugs.gentoo.org/937569 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/38016 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* cargo.eclass: Fix cargo_target_dir helper following recent changesJames Le Cuirot2024-08-081-3/+1
| | | | | | | | We used to only set the Rust target when cross-compiling, but now we do it unconditionally, which changes the target directory. Closes: https://bugs.gentoo.org/937574 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* toolchain.eclass: add -g for testsSam James2024-08-081-0/+4
| | | | | | | | I haven't looked closely yet but I think this is the same as the binutils issue from before. Bug: https://bugs.gentoo.org/934149 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: try to silence remaining flag vs FE issuesSam James2024-08-081-0/+4
| | | | | | This is the Fortran issue I mentioned in 6df977928704e77d2f672d3890ceadc8ba837ab5. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add note re (intended) duplication of CFLAGS et. alSam James2024-08-081-0/+3
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: more src_test flag fixesSam James2024-08-081-15/+26
| | | | | | | | | | | | We ended up not running many tests because it got interpreted as '--Werror' with the braces/splitting (e.g. rust and such got skipped entirely). With this change, we seem to be nearly there although we have issues with Fortran tests that have C for interop because we get the unsupported arg warnings... Fixes: 5ca076594ad47b8347ebc9fd69b467a95846d005 Signed-off-by: Sam James <sam@gentoo.org>
* cargo.eclass: Change RUSTFLAGS approach following recent build failuresJames Le Cuirot2024-08-081-26/+39
| | | | | | | | | | | | | | | | | | | | Cargo turned out to be even worse at handling flags than I thought. Target-specific flags set by projects were overriding our own, and Cargo was bailing out when faced with merging a string of flags with an array of flags. After weighing up the poor set of options, I've found that it is better to always set flags via a target-specific environment variable for reasons set out in comments added here. This approach was previously just used for cross-compiling, but now we do it unconditionally. It has the downside of overriding generic [build] flags set by projects, but these were already being overridden by users and ebuilds setting RUSTFLAGS themselves. Closes: https://bugs.gentoo.org/937453 Closes: https://bugs.gentoo.org/937470 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* toolchain.eclass: another attempt at flag filtering for testsSam James2024-08-071-13/+14
| | | | | | | | | | | | | The previous method ends up confusing D because those flags don't work there... Try passing *FLAGS into RUNTESTFLAGS this time, like in https://gcc.gnu.org/wiki/Testing_GCC#Testing_a_different_target_from_the_current_host. This reverts commit 7eab20a224f411ef2660f4fecae22e28cad711e7 and commit f66787897a590b8c949d257e3a9107f8995f62ae. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: fix typos w/ RUNTESTFLAGSSam James2024-08-071-3/+3
| | | | | Fixes: 7eab20a224f411ef2660f4fecae22e28cad711e7 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: add link to upstream bug for manifests vs ABIsSam James2024-08-071-0/+1
| | | | | Bug: https://gcc.gnu.org/PR116260 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: try harder to suppress -Wformat and friendsSam James2024-08-071-1/+4
| | | | | | | | | * Followup to f66787897a590b8c949d257e3a9107f8995f62ae * See https://inbox.sourceware.org/gcc-patches/87v80cn24t.fsf@gentoo.org/ Still not quite right though per link above. Signed-off-by: Sam James <sam@gentoo.org>
* eclass/tests/dist-kernel-utils.sh: add compressed_module_cleanup testsAndrew Ammerlaan2024-08-071-0/+59
| | | | | | Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37985 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* eclass/tests/tests-common.sh: add in_iuse functionAndrew Ammerlaan2024-08-071-0/+2
| | | | Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* kernel-install.eclass: use dist-kernel_get_module_suffix to find compressionAndrew Ammerlaan2024-08-071-7/+29
| | | | | | | | | | | | Adjusts kernel-install_compress_modules to use the new function dist-kernel_get_module_suffix. This makes no functional difference at the moment since gentoo-kernel-bin is the only consumer and it has XZ compression in the config. Still this makes it possible to compile alternate prebuilt kernels with alternate module compression support, and may in the future help to support gzip and zstd module compression in gentoo-kernel-bin. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* dist-kernel-utils.eclass: fix module cleanup when using binpkgsAndrew Ammerlaan2024-08-071-10/+49
| | | | | | | | | | | When installing a binpkg -nt is not a good check because the modules in the binpkg we are installing may actually be older then what we have in root. Instead introduce a new function dist-kernel_get_module_suffix to find the desired compression based on USE=modules-sign and the kernel config. Then, remove only those files that do not match our desired compression. Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* rust-toolchain.eclass: add powerpc*musl supportPiotr Kubaj2024-08-071-20/+23
| | | | | | | | | | Also adjust indentation. [sam: Note that this is easier to review with `git diff -w`.] Signed-off-by: Piotr Kubaj <pkubaj@anongoth.pl> Closes: https://github.com/gentoo/gentoo/pull/35928 Signed-off-by: Sam James <sam@gentoo.org>
* java-vm-2.eclass: remove function set_java_envVolkmar W. Pogatzki2024-08-061-52/+0
| | | | | | | | Deprecated with commit 436dd062c on 2016-08-02 Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/37995 Signed-off-by: Florian Schmaus <flow@gentoo.org>
* distutils-r1.eclass: Support cross-compiling with PyO3James Le Cuirot2024-08-061-0/+5
| | | | | | | | | | Only one variable needs to be set. For details, see https://pyo3.rs/latest/building-and-distribution.html#cross-compiling. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37708 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Add python_get_stdlib helper functionJames Le Cuirot2024-08-061-0/+23
| | | | | | | | | This is just like python_get_sitedir, but it returns the stdlib directory such as /usr/lib/python3.12. This is useful for locating the sysconfigdata file. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Use cargo_env when appropriate for flag handlingJames Le Cuirot2024-08-061-12/+4
| | | | | | | | cargo_env handles linker flags and enables cross-compiling. It also handles LTO filtering, so we can remove that from this eclass. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* cargo.eclass: Shadow flag variables so that LTO filtering remains localJames Le Cuirot2024-08-061-0/+9
| | | | | | | | This is currently done for Cargo by distutils-r1.eclass. The next commit will remove that code, leaving cargo_env responsible for it. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* cargo.eclass: Explicitly tell rustc not to strip binariesJames Le Cuirot2024-08-061-2/+2
| | | | | | | | Most projects don't strip binaries in release mode by default, but there are exceptions like app-misc/broot. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* cargo.eclass: Handle LDFLAGS and RUSTFLAGS betterJames Le Cuirot2024-08-061-22/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LDFLAGS are not currently honoured by Cargo builds at all. It would be particularly advantageous to honour -fuse-ld because alternative linkers like mold are known to be significantly faster at handling Rust. As things stand, the eclass sets the linker to CC when cross-compiling, but it does so erroneously due to a shell quoting issue. If CC includes arguments, an error occurs when setting the CARGO_TARGET_*_LINKER variable. Even with the right quoting, Cargo still fails because this variable is not allowed to include arguments. They have to be specified via RUSTFLAGS instead. The build host linker is frequently invoked due to the use of build scripts by some crates. We would therefore also like to configure the build host linker properly when cross-compiling, but unfortunately there is currently no way to do this without using a Rust nightly feature. The build host linker is now configured in the cargo_gen_config function because this configuration is static. Conversely, the target host linker is configured with environment variables in the cargo_env function because the target may change. Some ebuilds already set RUSTFLAGS, so some consideration was given to how to handle these. When set, Cargo prioritises RUSTFLAGS and similar over specific configuration for the build and target hosts, so these must be unset. We can still include their contents in that configuration for convenience though. BUILD_RUSTFLAGS can be used by ebuilds to set flags only for the build host. It should not be necessary for ebuilds to figure out which Rust ABI is applicable in order to set flags only for the target host, so the helper reads from a simple TARGET_RUSTFLAGS variable without the triple for convenience. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* cargo.eclass: Add cargo_env helper and use it in compile, test, installJames Le Cuirot2024-08-061-14/+23
| | | | | | | | | | | | | | | | | | | Rust packages have a tendency to rebuild parts during test and install. It is not clear whether this can be addressed. We were therefore relying on some environment variables set during the compile phase for cross-compiling to work in the later phases. This is not ideal, especially if you need to build for multiple targets. These environment variables can also be useful in other contexts, such as the build runner in app-misc/anki. This change moves the setting of these variables into a separate helper that is now used in all these phases and can be used by ebuilds too. The variables are now kept local to each invocation of this helper, preventing leakage. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* cargo.eclass: Use newer Cargo config file nameJames Le Cuirot2024-08-061-2/+2
| | | | | | | "config" is deprecated and "config.toml" has been valid for ages. Signed-off-by: James Le Cuirot <chewi@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* python-utils-r1.eclass: Add a sanity check for PYTHONPATHMichał Górny2024-08-065-2/+41
| | | | | | | | Add a sanity check that ensures that PYTHONPATH does not contain any relative paths. While at it, also explicitly warn about PYTHONPATH being set, so we know about it in build logs. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* distutils-r1.eclass: Fix disabling DISTUTILS_ALLOW_WHEEL_REUSEMichał Górny2024-08-061-1/+1
| | | | | | | Fix the declaration of DISTUTILS_ALLOW_WHEEL_REUSE to allow disabling it via setting the variable to an empty value in the environment. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests/toolchain-funcs.sh: Cover tc-has-64bit-time_tMichał Górny2024-08-061-0/+20
| | | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37142 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain-funcs.eclass: Add tc-has-64bit-time_tMichał Górny2024-08-061-1/+11
| | | | | | | | | | Add a helper function to check whether time_t is 64-bit. This could be used e.g. to deselect tests that rely on timestamps exceeding Y2k38. It is meant to be more future-proof than hardcoding a list of 32-bit architectures, given the necessity of switching to 64-bit time_t in the future. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eclass/tests/toolchain-funcs.sh: Cover tc-is-ltoMichał Górny2024-08-061-0/+20
| | | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/37976 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain-funcs.eclass: Fix tc-is-lto not to leave stray files in TMichał Górny2024-08-061-3/+5
| | | | | | | | | | | | Fix tc-is-lto function to remove the temporary file after testing. Besides being cleaner, this fixes a permission problem when using Paludis and tc-is-lto is used both in pkg_setup() (which creates the temporary file owned by root) and src_*() phase (which attempts to rewrite it as a regular user). Thanks to negril for the report! Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain.eclass: run tests for -m32 if multilibSam James2024-08-061-1/+3
| | | | | | TODO: Does this handle s390 (-m31) correctly? Signed-off-by: Sam James <sam@gentoo.org>
* toolchain.eclass: use more conservative flags in src_testSam James2024-08-041-3/+38
| | | | | | | | | | | | | | | | | | | | For tests, we need to put some effort in to counteract our defaults like -Wformat-security and -Wtrampolines (which we may want to revisit at some point, but it is what it is for now). Use a subshell so we can mangle the values within without affecting the rest of the build. I still get some failures with this (including some related to e.g. -Wformat-security still) but far fewer, the flags don't get passed everywhere so needs more poking or maybe just patching those tests within the patch we use to change defaults. See also the discussion on gcc-patches recently [0]. [0] https://inbox.sourceware.org/gcc-patches/ee9a8a6b11438f158933a21d7965b486987be5a8.1721454759.git.sam@gentoo.org/ Signed-off-by: Sam James <sam@gentoo.org>
* kernel-install.eclass: fixup indentationAndrew Ammerlaan2024-08-041-12/+12
| | | | Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
* toolchain.eclass: drop -fno-harden-control-flow-redundancy appendSam James2024-08-041-3/+0
| | | | | | | This confuses things if e.g. using GDC from older GCC. Not worth it given I'd only added it for a personal experiment. Signed-off-by: Sam James <sam@gentoo.org>
* llvm.org.eclass: Remove 19.x snapshot supportMichał Górny2024-08-011-3/+0
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* llvm.org.eclass: Add 20.0.0_pre20240801 snapshotMichał Górny2024-08-011-0/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* java-utils-2.eclass: etestng use java-pkg_getjars --build-onlyVolkmar W. Pogatzki2024-08-011-1/+1
| | | | | | | Closes: https://bugs.gentoo.org/936812 Signed-off-by: Volkmar W. Pogatzki <gentoo@pogatzki.net> Closes: https://github.com/gentoo/gentoo/pull/37772/commits/513f82dafdb7874b77da408068e9b2e90bfe0c36 Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
* toolchain.eclass: ppc64-musl: Disable libquadmathA. Wilcox2024-07-311-1/+8
| | | | | | | | | | | | | | * --disable-libquadmath is needed to avoid GCC PR 116007. * --disable-libquadmath-support is needed for Fortran to build, as GCC upstream requires a weak header when float128 is available. * --with-long-double-128=no explicitly disables all Float128 support. [sam: Fix whitespace.] Bug: https://bugs.gentoo.org/892874 Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com> Closes: https://github.com/gentoo/gentoo/pull/37689 Signed-off-by: Sam James <sam@gentoo.org>