From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 451E7158041 for ; Sun, 17 Mar 2024 09:18:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 70483E29B1; Sun, 17 Mar 2024 09:18:32 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3F712E29B1 for ; Sun, 17 Mar 2024 09:18:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4450D335D63 for ; Sun, 17 Mar 2024 09:18:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CBEF914E1 for ; Sun, 17 Mar 2024 09:18:29 +0000 (UTC) From: "Andreas K. Hüttel" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas K. Hüttel" Message-ID: <1710667097.394aed402f624e26ad0e422fd9ddcaeac8ec3772.dilfridge@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/toolchain.eclass X-VCS-Directories: eclass/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: 394aed402f624e26ad0e422fd9ddcaeac8ec3772 X-VCS-Branch: master Date: Sun, 17 Mar 2024 09:18:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 59aed63e-0cf3-46ee-8474-fe2b6eb8f5ba X-Archives-Hash: 5c97ba75eed7345c6021ad7fb7e5ce5b commit: 394aed402f624e26ad0e422fd9ddcaeac8ec3772 Author: Andreas K. Hüttel gentoo org> AuthorDate: Sun Mar 17 09:17:28 2024 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Sun Mar 17 09:18:17 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=394aed40 toolchain.eclass: Make CET auto-apply x86-64 flags also outside hardened Signed-off-by: Andreas K. Hüttel gentoo.org> eclass/toolchain.eclass | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 2acfad8162ac..59d51d9c1e38 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -677,6 +677,11 @@ tc_enable_hardened_gcc() { hardened_gcc_flags+=" -DDEF_GENTOO_ZNOW" fi + if _tc_use_if_iuse cet && [[ ${CTARGET} == *x86_64*-linux-gnu* ]] ; then + einfo "Updating gcc to use x86-64 control flow protection by default ..." + hardened_gcc_flags+=" -DEXTRA_OPTIONS_CF" + fi + if _tc_use_if_iuse hardened ; then # Will add some hardened options as default, e.g. for gcc-12 # * -fstack-clash-protection @@ -688,10 +693,6 @@ tc_enable_hardened_gcc() { # Add -D_GLIBCXX_ASSERTIONS hardened_gcc_flags+=" -DDEF_GENTOO_GLIBCXX_ASSERTIONS" - if _tc_use_if_iuse cet && [[ ${CTARGET} == *x86_64*-linux* ]] ; then - hardened_gcc_flags+=" -DEXTRA_OPTIONS_CF" - fi - # Rebrand to make bug reports easier BRANDING_GCC_PKGVERSION=${BRANDING_GCC_PKGVERSION/Gentoo/Gentoo Hardened} fi