commit:     cec5808b1344015de6492ef6728fde3c6040b35f
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  3 18:58:17 2024 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Apr  4 16:49:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cec5808b

sys-devel/clang-common: apply cet config for x86_64 only

Closes: https://bugs.gentoo.org/928460
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 ...-17.0.6-r4.ebuild => clang-common-17.0.6-r5.ebuild} | 18 +++++++++++++-----
 ...-18.1.2-r3.ebuild => clang-common-18.1.2-r4.ebuild} | 18 +++++++++++++-----
 sys-devel/clang-common/clang-common-19.0.0.9999.ebuild | 18 +++++++++++++-----
 ...build => clang-common-19.0.0_pre20240322-r2.ebuild} | 18 +++++++++++++-----
 ...build => clang-common-19.0.0_pre20240330-r1.ebuild} | 18 +++++++++++++-----
 5 files changed, 65 insertions(+), 25 deletions(-)

diff --git a/sys-devel/clang-common/clang-common-17.0.6-r4.ebuild 
b/sys-devel/clang-common/clang-common-17.0.6-r5.ebuild
similarity index 96%
rename from sys-devel/clang-common/clang-common-17.0.6-r4.ebuild
rename to sys-devel/clang-common/clang-common-17.0.6-r5.ebuild
index f152ec3f96ec..e736620feb37 100644
--- a/sys-devel/clang-common/clang-common-17.0.6-r4.ebuild
+++ b/sys-devel/clang-common/clang-common-17.0.6-r5.ebuild
@@ -73,6 +73,11 @@ _doclang_cfg() {
                        @gentoo-common.cfg
                        @gentoo-common-ld.cfg
                EOF
+               if [[ ${triple} == x86_64* ]]; then
+                       cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+                               @gentoo-cet.cfg
+                       EOF
+               fi
        done
 
        if use kernel_Darwin; then
@@ -85,6 +90,11 @@ _doclang_cfg() {
                # This configuration file is used by the ${triple}-clang-cpp 
driver.
                @gentoo-common.cfg
        EOF
+       if [[ ${triple} == x86_64* ]]; then
+               cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+                       @gentoo-cet.cfg
+               EOF
+       fi
 
        # Install symlinks for triples with other vendor strings since some
        # programs insist on mangling the triple.
@@ -175,11 +185,9 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       if use amd64; then
-               cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-                       -Xarch_host -fcf-protection=$(usex cet full none)
-               EOF
-       fi
+       newins - gentoo-cet.cfg <<-EOF
+               -Xarch_host -fcf-protection=$(usex cet full none)
+       EOF
 
        if use kernel_Darwin; then
                newins - gentoo-hardened-ld.cfg <<-EOF

diff --git a/sys-devel/clang-common/clang-common-18.1.2-r3.ebuild 
b/sys-devel/clang-common/clang-common-18.1.2-r4.ebuild
similarity index 96%
rename from sys-devel/clang-common/clang-common-18.1.2-r3.ebuild
rename to sys-devel/clang-common/clang-common-18.1.2-r4.ebuild
index fff63838526d..b7d4720e0e22 100644
--- a/sys-devel/clang-common/clang-common-18.1.2-r3.ebuild
+++ b/sys-devel/clang-common/clang-common-18.1.2-r4.ebuild
@@ -73,6 +73,11 @@ _doclang_cfg() {
                        @gentoo-common.cfg
                        @gentoo-common-ld.cfg
                EOF
+               if [[ ${triple} == x86_64* ]]; then
+                       cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+                               @gentoo-cet.cfg
+                       EOF
+               fi
        done
 
        if use kernel_Darwin; then
@@ -85,6 +90,11 @@ _doclang_cfg() {
                # This configuration file is used by the ${triple}-clang-cpp 
driver.
                @gentoo-common.cfg
        EOF
+       if [[ ${triple} == x86_64* ]]; then
+               cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+                       @gentoo-cet.cfg
+               EOF
+       fi
 
        # Install symlinks for triples with other vendor strings since some
        # programs insist on mangling the triple.
@@ -175,11 +185,9 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       if use amd64; then
-               cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-                       -Xarch_host -fcf-protection=$(usex cet full none)
-               EOF
-       fi
+       newins - gentoo-cet.cfg <<-EOF
+               -Xarch_host -fcf-protection=$(usex cet full none)
+       EOF
 
        if use kernel_Darwin; then
                newins - gentoo-hardened-ld.cfg <<-EOF

diff --git a/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild 
b/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild
index 45196776694b..f260391ba4ab 100644
--- a/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild
+++ b/sys-devel/clang-common/clang-common-19.0.0.9999.ebuild
@@ -72,6 +72,11 @@ _doclang_cfg() {
                        @gentoo-common.cfg
                        @gentoo-common-ld.cfg
                EOF
+               if [[ ${triple} == x86_64* ]]; then
+                       cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+                               @gentoo-cet.cfg
+                       EOF
+               fi
        done
 
        if use kernel_Darwin; then
@@ -84,6 +89,11 @@ _doclang_cfg() {
                # This configuration file is used by the ${triple}-clang-cpp 
driver.
                @gentoo-common.cfg
        EOF
+       if [[ ${triple} == x86_64* ]]; then
+               cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+                       @gentoo-cet.cfg
+               EOF
+       fi
 
        # Install symlinks for triples with other vendor strings since some
        # programs insist on mangling the triple.
@@ -174,11 +184,9 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       if use amd64; then
-               cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-                       -Xarch_host -fcf-protection=$(usex cet full none)
-               EOF
-       fi
+       newins - gentoo-cet.cfg <<-EOF
+               -Xarch_host -fcf-protection=$(usex cet full none)
+       EOF
 
        if use kernel_Darwin; then
                newins - gentoo-hardened-ld.cfg <<-EOF

diff --git a/sys-devel/clang-common/clang-common-19.0.0_pre20240330.ebuild 
b/sys-devel/clang-common/clang-common-19.0.0_pre20240322-r2.ebuild
similarity index 96%
rename from sys-devel/clang-common/clang-common-19.0.0_pre20240330.ebuild
rename to sys-devel/clang-common/clang-common-19.0.0_pre20240322-r2.ebuild
index 45196776694b..f260391ba4ab 100644
--- a/sys-devel/clang-common/clang-common-19.0.0_pre20240330.ebuild
+++ b/sys-devel/clang-common/clang-common-19.0.0_pre20240322-r2.ebuild
@@ -72,6 +72,11 @@ _doclang_cfg() {
                        @gentoo-common.cfg
                        @gentoo-common-ld.cfg
                EOF
+               if [[ ${triple} == x86_64* ]]; then
+                       cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+                               @gentoo-cet.cfg
+                       EOF
+               fi
        done
 
        if use kernel_Darwin; then
@@ -84,6 +89,11 @@ _doclang_cfg() {
                # This configuration file is used by the ${triple}-clang-cpp 
driver.
                @gentoo-common.cfg
        EOF
+       if [[ ${triple} == x86_64* ]]; then
+               cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+                       @gentoo-cet.cfg
+               EOF
+       fi
 
        # Install symlinks for triples with other vendor strings since some
        # programs insist on mangling the triple.
@@ -174,11 +184,9 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       if use amd64; then
-               cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-                       -Xarch_host -fcf-protection=$(usex cet full none)
-               EOF
-       fi
+       newins - gentoo-cet.cfg <<-EOF
+               -Xarch_host -fcf-protection=$(usex cet full none)
+       EOF
 
        if use kernel_Darwin; then
                newins - gentoo-hardened-ld.cfg <<-EOF

diff --git a/sys-devel/clang-common/clang-common-19.0.0_pre20240322-r1.ebuild 
b/sys-devel/clang-common/clang-common-19.0.0_pre20240330-r1.ebuild
similarity index 96%
rename from sys-devel/clang-common/clang-common-19.0.0_pre20240322-r1.ebuild
rename to sys-devel/clang-common/clang-common-19.0.0_pre20240330-r1.ebuild
index 45196776694b..f260391ba4ab 100644
--- a/sys-devel/clang-common/clang-common-19.0.0_pre20240322-r1.ebuild
+++ b/sys-devel/clang-common/clang-common-19.0.0_pre20240330-r1.ebuild
@@ -72,6 +72,11 @@ _doclang_cfg() {
                        @gentoo-common.cfg
                        @gentoo-common-ld.cfg
                EOF
+               if [[ ${triple} == x86_64* ]]; then
+                       cat >> "${ED}/etc/clang/${tool}.cfg" <<-EOF || die
+                               @gentoo-cet.cfg
+                       EOF
+               fi
        done
 
        if use kernel_Darwin; then
@@ -84,6 +89,11 @@ _doclang_cfg() {
                # This configuration file is used by the ${triple}-clang-cpp 
driver.
                @gentoo-common.cfg
        EOF
+       if [[ ${triple} == x86_64* ]]; then
+               cat >> "${ED}/etc/clang/${triple}-clang-cpp.cfg" <<-EOF || die
+                       @gentoo-cet.cfg
+               EOF
+       fi
 
        # Install symlinks for triples with other vendor strings since some
        # programs insist on mangling the triple.
@@ -174,11 +184,9 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       if use amd64; then
-               cat >> "${ED}/etc/clang/gentoo-hardened.cfg" <<-EOF || die
-                       -Xarch_host -fcf-protection=$(usex cet full none)
-               EOF
-       fi
+       newins - gentoo-cet.cfg <<-EOF
+               -Xarch_host -fcf-protection=$(usex cet full none)
+       EOF
 
        if use kernel_Darwin; then
                newins - gentoo-hardened-ld.cfg <<-EOF

Reply via email to