sys-libs/glibc: Add rudimentary Intel CET support (since glibc-2.29)
authorAndreas K. Hüttel <dilfridge@gentoo.org>
Fri, 3 Aug 2018 20:19:57 +0000 (22:19 +0200)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Fri, 3 Aug 2018 20:20:44 +0000 (22:20 +0200)
Before unmasking this flag we still need to add checks for binutils >=2.29
and gcc >=8 ...

Package-Manager: Portage-2.3.44, Repoman-2.3.10

sys-libs/glibc/glibc-9999.ebuild
sys-libs/glibc/metadata.xml

index f51a7785067fc873d25acaa72a5537512bc1a641..82232b67b6dd87a9cdea27d1555a3ac90367dc10 100644 (file)
@@ -33,7 +33,7 @@ PATCH_VER=7
 SRC_URI+=" https://dev.gentoo.org/~dilfridge/distfiles/${P}-patches-${PATCH_VER}.tar.bz2"
 SRC_URI+=" multilib? ( https://dev.gentoo.org/~dilfridge/distfiles/gcc-multilib-bootstrap-${GCC_BOOTSTRAP_VER}.tar.xz )"
 
-IUSE="audit caps compile-locales doc gd hardened headers-only +multiarch multilib nscd profile selinux suid systemtap test vanilla"
+IUSE="audit caps cet compile-locales doc gd hardened headers-only +multiarch multilib nscd profile selinux suid systemtap test vanilla"
 
 # Minimum kernel version that glibc requires
 MIN_KERN_VER="3.2.0"
@@ -841,6 +841,12 @@ glibc_do_configure() {
                *) myconf+=( libc_cv_ld_gnu_indirect_function=no ) ;;
        esac
 
+       # Enable Intel Control-flow Enforcement Technology on amd64 if requested
+       case ${CTARGET} in
+               x86_64-*) myconf+=( $(use_enable cet) ) ;;
+               *) ;;
+       esac
+
        [[ $(tc-is-softfloat) == "yes" ]] && myconf+=( --without-fp )
 
        myconf+=( --enable-kernel=${MIN_KERN_VER} )
index 89da155531ed4d03fa4e4146c43254d2f8ce8363..8079534faf1e542cb12a301aacf581ac1dec098f 100644 (file)
@@ -14,6 +14,7 @@
  <flag name="rpc">Enable obsolete RPC/NIS layers</flag>
  <flag name="suid">Make internal pt_chown helper setuid -- not needed if using Linux and have /dev/pts mounted with gid=5</flag>
  <flag name="systemtap">enable systemtap static probe points</flag>
+ <flag name="cet">Enable Intel Control-flow Enforcement Technology (needs binutils 2.29 and gcc 8)</flag>
 </use>
 <upstream>
  <remote-id type="cpe">cpe:/a:gnu:glibc</remote-id>