summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* toolchain-funcs.eclass: Remove outdated reference to tc-has-openmpPetr Vaněk2023-10-011-3/+1
| | | | | | | | | | | | tc-has-openmp function was deprecated in commit 9bc832c6d39b ("toolchain-funcs.eclass: deprecate tc-has-openmp") and later removed in commit eb970274d283 ("toolchain-funcs.eclass: remove tc-has-openmp"). Due to this, the reference to it in the tc-check-openmp function has become redundant and is therefore removed. Signed-off-by: Petr Vaněk <arkamar@atlas.cz> Closes: https://github.com/gentoo/gentoo/pull/32903 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: tc-enables-fortify-source: update for newer libcxxSam James2023-08-181-2/+2
| | | | | | | | Newer libcxx uses _LIBCPP_ENABLE_HARDENED_MODE instead of _LIBCPP_ENABLE_ASSERTIONS which is now deprecated. Bug: https://bugs.gentoo.org/912223 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: cleanup obsolete bits in tc-ld-force-bfdSam James2023-07-301-19/+0
| | | | | | | | | | | | I didn't want to drop this entirely in c26413ae8029f1557aae95b6f8744fc16671fa3b as I wanted to keep it to just fixing the error I'd made, but I don't see the point in keeping this now anyway - non-gcc/clang isn't a thing and if it is I'd hope they'd support -fuse-ld=bfd anyway. Plus it's an obvious approach if we need it for something else like forcing an alt linker that isn't bfd anyway, no need for having cruft remaining. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: shift commentSam James2023-07-301-1/+1
| | | | | | | | | | | | It makes a bit more sense (although still a bit suspicious, wonder if should strip . as well, see c26413ae8029f1557aae95b6f8744fc16671fa3b and bug #911503 where we had 'ld.lld.bd') now with the comment in the right place. It was added originally for bug #545218 (b959fb6c158d4727e85472b3a50af5af3f719972). Bug: https://bugs.gentoo.org/545218 Bug: https://bugs.gentoo.org/911503 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: fix tc-force-bfdSam James2023-07-301-2/+1
| | | | | | | | | | | Before c4e911da66c918bd0944d1457776b82260657cd6, fallback would be false for newer GCC and Clang, not true. Thanks to parona for giving the nudge. Closes: https://bugs.gentoo.org/911503 Fixes: c4e911da66c918bd0944d1457776b82260657cd6 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: cleanup old gcc/clang logic in tc-ld-force-bfdSam James2023-07-221-16/+8
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: formatting tweaksSam James2023-07-221-11/+13
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: fix incomplete ninj renameSam James2023-07-211-1/+1
| | | | | | | | | Lost in rebase as kept changing between splitting/unsplitting sparc64*. Thanks to dilfridge & ionen for spotting. Fixes: d1c60c8515d1487149bda90575609a757b8246ef Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: tc-ninja_magic_to_arch: rename helper functionSam James2023-07-211-7/+7
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: drop dead prefix targetsSam James2023-06-101-12/+2
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: Quote argument of ":" commandUlrich Müller2023-03-261-9/+9
| | | | | | This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* toolchain-funcs.eclass: document tc-endianSam James2023-02-191-0/+7
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: remove tc-has-openmpDavid Seifert2023-02-191-10/+0
| | | | Signed-off-by: David Seifert <soap@gentoo.org>
* toolchain-funcs.eclass: consistently pass CPPFLAGS before C{,XX}FLAGSSam James2023-01-301-2/+2
| | | | | | This is generally what we do in patches and such. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: style tweaksSam James2023-01-301-13/+13
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: include CXXFLAGS in various tc-enables-* checksSam James2023-01-301-4/+4
| | | | | | SSP and PIE are relevant to C++ too. Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: add tc-enables-cxx-assertionsSam James2023-01-301-0/+9
| | | | | | Bug: https://bugs.gentoo.org/884417 Bug: https://bugs.gentoo.org/876895 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: add tc-enables-fortify-source for FORTIFY_SOURCESam James2023-01-301-1/+10
| | | | | | | | | | | | As Zero_Chaos reported on IRC, the check we had wasn't good enough in systemd* (before we were able to remove it), as it wouldn't fire for e.g. -Os. While we could've changed it to fail safe (always unset, then set a lower F_S if possible), let's add a proper helper instead to the eclass. Bug: https://bugs.gentoo.org/841770 Bug: https://bugs.gentoo.org/847148 Bug: https://bugs.gentoo.org/876893 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: Promote tc-env_build to a non-internal functionJames Le Cuirot2023-01-031-1/+0
| | | | | | | It's generally useful and already directly used by three packages. I need to use it to fix cross-compiling of LLVM. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* toolchain-funcs.eclass: Set CHOST within econf_build to fix config.siteJames Le Cuirot2022-12-061-1/+2
| | | | | | | | | | | | We were setting CBUILD within econf_build but not CHOST. crossdev's /usr/share/config.site relies on both of these to decide whether to load configure overrides needed when cross-compiling. Using the wrong overrides leads to packages such as Python failing. Doing this also avoids the need to duplicate the --build and --host configure arguments. Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* toolchain-funcs.eclass: stop using which(1)Sam James2022-12-061-2/+2
| | | | | | | | It's non-portable and we're looking to remove it from @system. Bug: https://bugs.gentoo.org/487696 Bug: https://bugs.gentoo.org/646588 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: fix -Wstrict-prototypes in linker, openmp testsSam James2022-12-061-3/+3
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: Add tc-get-c-rtlib() to get CC runtimeMichał Górny2022-10-101-0/+28
| | | | | | | | Add a new tc-get-c-rtlib() that attempts to get the runtime used by the current C compiler. Currently it supports compiler-rt and libgcc. Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain-funcs.eclass: Add tc-get-cxx-stdlib() to get C++ stdlibMichał Górny2022-10-101-0/+36
| | | | | | | | Add a new tc-get-cxx-stdlib() that attempts to get the C++ stdlib variant used by the current C++ compiler. Currently it supports libc++ and libstdc++ (GCC's stdlib). Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain-funcs.eclass: Drop support for EAPIs 0 and 5Ulrich Müller2022-07-181-4/+3
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* toolchain-funcs.eclass: placate cheesy eclass-to-manpage awkSam James2022-07-161-1/+1
| | | | | | Failed to generate otherwise. But it's nearly gone! Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: set LC_ALL=C where appropriateMike Gilbert2022-06-271-0/+6
| | | | | | | | | tc-ld-is-gold and tc-ld-is-lld check the output of ld --version. This output may vary depending on the language selected by the user. Set LC_ALL=C to force English output. Bug: https://bugs.gentoo.org/854147 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* toolchain-funcs.eclass: document proper tc-check-openmp useDavid Seifert2022-05-161-0/+13
| | | | | | Signed-off-by: David Seifert <soap@gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/25498 Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: deprecate tc-has-openmpDavid Seifert2022-05-161-4/+15
| | | | | Signed-off-by: David Seifert <soap@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: add detection for loongarchWANG Xuerui2021-12-141-0/+2
| | | | | | | | | | | | | | | The Linux port currently under review has arch/loongarch, and should almost certainly remain that way till merge; meanwhile it's ARCH=loong on the Gentoo side, per mailing list discussion[1] and eselect adaptation[2]. This architecture is little-endian-only according to the manual[3]. [1]: https://archives.gentoo.org/gentoo-dev/message/388a4b7428461660e89c8eae8c292f32 [2]: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=a49477f39d3f000cc2ca57f18aafbd66656aba05 [3]: https://github.com/loongson/LoongArch-Documentation/blob/2021.08.17/docs/LoongArch-Vol1-EN/basic-integer-instructions/programming-model-of-basic-integer-instructions/endian.adoc Signed-off-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: Support EAPI 8Ulrich Müller2021-06-231-2/+2
| | | | Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* toolchain-funcs.eclass: restore EAPI=0 support used by crossdevSergei Trofimovich2021-06-211-1/+2
| | | | | | Reported-by: Marco Scardovi (scardracs) Bug: https://bugs.gentoo.org/797367 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs.eclass: fix @SUPPORTED_EAPIS eclassdocSam James2021-06-211-1/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* toolchain-funcs.eclass: [QA] add EAPI guardSam James2021-06-201-0/+6
| | | | | | | | | * Declare suppported EAPIs. * Add EAPI guard to prevent newer/older unsupported EAPIs from using this eclass when they've not been tested/eclass isn't adapted for it. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: David Seifert <soap@gentoo.org>
* toolchain-funcs.eclass: new function tc-ld-force-bfd()Theo Anderson2021-01-231-6/+15
| | | | | | | | | | | | No functions currently force ld.bfd usage when ld.lld is active. This function forces ld.bfd when either ld.gold or ld.lld is active. tc-ld-disable-gold() now calls this new function only if ld.gold is active. Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Theo Anderson <telans@posteo.de> Closes: https://github.com/gentoo/gentoo/pull/19116 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs.eclass: fix or1k* tuple detectionSergei Trofimovich2021-01-051-1/+1
| | | | | | | | | | Before the change the only recognised CHOST was 'or1k'. After the change CHOSTs like 'or1k-linux-musl' are also recognised as 'openrisc'. Reported-by: adam@pimentel.space Bug: https://bugs.gentoo.org/763606 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs.eclass: export tc-get*STRINGS helpersSergei Trofimovich2020-06-141-0/+8
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs.eclass: tweak commentSergei Trofimovich2020-05-251-2/+2
| | | | | | | s/archiver indexer/archive indexer/ Reported-by: Arfrever Frehtes Taifersar Arahesis Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs.eclass: export tc-get*READELF helpersSergei Trofimovich2020-05-251-0/+9
| | | | | Bug: https://bugs.gentoo.org/725304 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs.eclass: fix tc-cpp-is-true() to work with clangMattias Nissler2019-11-061-8/+7
| | | | | | | | | | | | | Clang's preprocessor likes to output a leading newline, which makes the comparison always fail. GCC generates additional output with certain flags (e.g. -ggdb3) as well. Hence, switch the test to trigger a preprocessor error when the condition is not true and examine the exit code. Bug: https://bugs.gentoo.org/698912 Signed-off-by: Mattias Nissler <mnissler@chromium.org> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs: Add tc-ld-is-lld helper.Manoj Gupta2019-09-131-0/+30
| | | | | | | | LLD is a new linker for LLVM project. Add tc-ld-is-lld helper to be able to detect it. Signed-off-by: Manoj Gupta <manojgupta@google.com> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs.eclass: deprecate gen_usr_ldscriptMike Gilbert2019-07-181-11/+4
| | | | Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* eclass: Add risc-v endianness informationArfrever Frehtes Taifersar Arahesis2019-05-111-1/+2
| | | | Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* toolchain-funcs.eclass: Fix eclassdoc for tc-detect-is-softfloatMichał Górny2019-03-141-5/+3
| | | | | Closes: https://bugs.gentoo.org/679930 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* toolchain-funcs.eclass: softfloat detection, bug #666896Sergei Trofimovich2018-09-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 921cb9c10de4d237924a61a1c27f914dfb479a64 "toolchain-funcs.eclass: Update tc-is-softfloat for new ARM tuples" changed autodetection of mst 'arm*' targets from from 'no' to 'yes'. It is incorrect at least for bare-metal targets that tend to pass their taget defaults. Bug #666896 is one example example command: # crossdev -s1 \ --env 'EXTRA_ECONF="--with-multilib-list=rmprofile"' \ arm-none-eabi rmprofile one of special cases for gcc as it explicitky does not myx with any arch-specific options and --with-float=soft breaks it: Error: You cannot use any of --with-arch/cpu/fpu/float/mode with --with-multilib-list=rmprofile The immediate fix is to restore initial autodetection for bare-metal targets. Reported-by: Eugene Bright Closes: https://bugs.gentoo.org/666896 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* toolchain-funcs.eclass: Update tc-is-softfloat for new ARM tuplesJames Le Cuirot2018-08-211-14/+60
| | | | | | | | | | | | | | | | | ARM tuples will change from armv7a-hardfloat-linux-gnueabi to armv7a-unknown-linux-gnueabihf or similar in the 17.0 profiles. The function already treated the latter as hardfloat but this commit will now treat ambiguous tuples such as arm-unknown-linux-gnueabi as softfloat rather than hardfloat. This brings Gentoo in line with most of the ARM Linux community. However, the function will now check existing toolchains to avoid breaking existing systems, if possible. This has been achieved by splitting the function in three, tc-detect-is-softfloat for checking existing toolchains, tc-tuple-is-softfloat for checking just the tuple, and the new tc-is-softfloat that calls the first two. The output from the first two could be compared to inform the user that they are not using a recommended tuplet.
* toolchain-funcs.eclass: tc-cpp-is-true function to simplify helpersJames Le Cuirot2018-08-211-28/+25
| | | | | CTARGET is used, if defined, otherwise CHOST. CHOST was previously assumed but this should not affect existing usage of these helpers.
* toolchain-funcs.eclass: New tc-getTARGET_CPP functionJames Le Cuirot2018-08-211-0/+11
| | | | | | | | | | | This returns the name of the C preprocessor for the toolchain being built if CTARGET is defined, or the toolchain being used otherwise. It is primarily intended to determine characteristics about an existing toolchain's target as these may differ from what the tuple suggests. It is not necessary to add the full set of tc-getTARGET_* helper functions as this is probably the only reason we would ever invoke a toolchain in the context of CTARGET.
* toolchain-funcs.eclass: fix tc-ld-disable-gold when using clangRahul Chaudhry2018-05-261-8/+22
| | | | | | | | | | | | | tc-ld-disable-gold checks gcc version to see if we have gcc-4.8+ The version check fails if clang is set as the compiler. $ clang -E -P - <<<"__GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__" 4 2 1 i.e. clang returns a gcc version of 4.2.1 This results in incorrectly adding -B ... to LDFLAGS, when clang supports "-fuse-ld" just fine. Support for "-fuse-ld" first appeared in clang-3.5, so check clang version and use the flag if supported.
* tc-export_build_env: handle non-cross compile caseRaul E Rangel2018-05-051-7/+15
| | | | | | | | | | | By handling the non-cross compiler case the meson.eclass can be simplified to `tc-env_build "$@" || die`. See https://bugs.gentoo.org/654424 Change-Id: I1a90da46366c490abbf7d5660bf90482c7f22747 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Closes: https://bugs.gentoo.org/654424