diff options
author | Sam James <sam@gentoo.org> | 2024-03-11 19:05:21 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-03-11 19:20:17 +0000 |
commit | 99fb7418c7de7029635ba480eb53450e423cf953 (patch) | |
tree | 7fdb91ca9827b2e6428a1f49323bf012a8cfafde /sys-libs | |
parent | toolchain.eclass: pass --enable-standard-branch-detection if USE=cet (diff) | |
download | gentoo-99fb7418c7de7029635ba480eb53450e423cf953.tar.gz gentoo-99fb7418c7de7029635ba480eb53450e423cf953.tar.bz2 gentoo-99fb7418c7de7029635ba480eb53450e423cf953.zip |
sys-libs/glibc: pass -mbranch-protection=none if USE=-cet on arm64
Quoting NEWS:
"""
[...]
User code can use PAC-RET
without libc support, but BTI requires a libc that is built with BTI
support, otherwise runtime objects linked into user code will not be
BTI compatible.
"""
This is the same as 0b7eace724b0035856311008c95cc7fe18b8231b but for
newly-introduced-in-Gentoo support for default -mbranch-protection in GCC.
Bug: https://bugs.gentoo.org/916381
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/glibc/glibc-2.39-r2.ebuild | 8 | ||||
-rw-r--r-- | sys-libs/glibc/glibc-9999.ebuild | 8 |
2 files changed, 12 insertions, 4 deletions
diff --git a/sys-libs/glibc/glibc-2.39-r2.ebuild b/sys-libs/glibc/glibc-2.39-r2.ebuild index b176c2198555..236484af1eeb 100644 --- a/sys-libs/glibc/glibc-2.39-r2.ebuild +++ b/sys-libs/glibc/glibc-2.39-r2.ebuild @@ -512,8 +512,12 @@ setup_flags() { # should not be a problem, but for glibc it matters as it is # dealing with CET in ld.so. So if CET is supposed to be # disabled for glibc, be explicit about it. - if (use amd64 || use x86) && ! use cet; then - append-flags '-fcf-protection=none' + if ! use cet; then + if use amd64 || use x86; then + append-flags '-fcf-protection=none' + elif use arm64; then + append-flags '-mbranch-protection=none' + fi fi } diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild index f82a00f91c2f..5a0caff2e597 100644 --- a/sys-libs/glibc/glibc-9999.ebuild +++ b/sys-libs/glibc/glibc-9999.ebuild @@ -512,8 +512,12 @@ setup_flags() { # should not be a problem, but for glibc it matters as it is # dealing with CET in ld.so. So if CET is supposed to be # disabled for glibc, be explicit about it. - if (use amd64 || use x86) && ! use cet; then - append-flags '-fcf-protection=none' + if ! use cet; then + if use amd64 || use x86; then + append-flags '-fcf-protection=none' + elif use arm64; then + append-flags '-mbranch-protection=none' + fi fi } |