Since some time, llvm-libunwind implemented the CET support, but currently only (masked) support for it is implemented in gcc, glibc and binutils. It can be enabled as easy as adding cet as IUSE and adding the following line in configure function: mycmakeargs+=( -DLIBUNWIND_ENABLE_CET=$(usex cet ON OFF) ) I think that despite the use flag is currently masked for testing it could be a good idea to include its support here also for testing with LLVM profiles also. Reproducible: Always
Inspecting compiler-rt's CMake I found COMPILER_RT_ENABLE_CET, so I will change the title to enable CET in all LLVM
Could you consider making a PR or a series of patches, for 17.0.0.9999?
(In reply to Michał Górny from comment #2) > Could you consider making a PR or a series of patches, for 17.0.0.9999? Thanks for your hint, I did finally a PR containing the changes for current ebuilds in https://github.com/gentoo/gentoo/pull/33424
Sorry, I closed old PR and remade it correctly in https://github.com/gentoo/gentoo/pull/33425
The options in libunwind, etc. are not valid additions, since they only add compilation flags for these packages. However, I think we may need to add a USE=cet to clang-common, to toggle CET-by-default like in sys-devel/gcc[cet,hardened].
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bfd8afef6dd8c66def48ef52abcb624c0077ad1 commit 8bfd8afef6dd8c66def48ef52abcb624c0077ad1 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-03-23 15:04:34 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-03-23 15:38:51 +0000 sys-devel/clang-common: updates for 23.0 * Promote -Wl,-z,now to vanilla, following GCC (bug #876923) * Add USE=cet to control -fcf-protection, following GCC (bug #908600, bug #927298) Bug: https://bugs.gentoo.org/876923 Bug: https://bugs.gentoo.org/927298 Closes: https://bugs.gentoo.org/908600 Signed-off-by: Sam James <sam@gentoo.org> profiles/arch/amd64/package.use.mask | 1 + profiles/base/package.use.mask | 1 + profiles/features/musl/package.use.mask | 1 + .../clang-common/clang-common-17.0.6-r2.ebuild | 295 ++++++++++++++++++++ .../clang-common/clang-common-18.1.2-r1.ebuild | 297 +++++++++++++++++++++ .../clang-common/clang-common-19.0.0.9999.ebuild | 10 +- .../clang-common-19.0.0_pre20240316.ebuild | 10 +- sys-devel/clang-common/metadata.xml | 10 + 8 files changed, 621 insertions(+), 4 deletions(-)