commit:     dd927e4ede05c4b468fa778b8ddf83ae7e8ce297
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Wed Feb  7 00:17:37 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 11 13:35:35 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd927e4e

sys-devel/clang-common: fixes for darwin

Add keywords, remove unsupported linker option

Bug: https://bugs.gentoo.org/758167
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-devel/clang-common/clang-common-16.0.6-r2.ebuild  |  2 +-
 sys-devel/clang-common/clang-common-17.0.6-r1.ebuild  | 19 +++++++++++++------
 sys-devel/clang-common/clang-common-18.1.0_rc2.ebuild | 17 ++++++++++++-----
 .../clang-common/clang-common-19.0.0.9999.ebuild      | 17 ++++++++++++-----
 .../clang-common-19.0.0_pre20240203.ebuild            | 17 ++++++++++++-----
 .../clang-common-19.0.0_pre20240210.ebuild            | 17 ++++++++++++-----
 6 files changed, 62 insertions(+), 27 deletions(-)

diff --git a/sys-devel/clang-common/clang-common-16.0.6-r2.ebuild 
b/sys-devel/clang-common/clang-common-16.0.6-r2.ebuild
index 4385b576d482..a118a00dae9b 100644
--- a/sys-devel/clang-common/clang-common-16.0.6-r2.ebuild
+++ b/sys-devel/clang-common/clang-common-16.0.6-r2.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/";
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux 
~ppc-macos ~x64-macos"
+KEYWORDS="amd64 arm arm64 ~loong ppc ppc64 ~riscv sparc x86 ~amd64-linux 
~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
        default-compiler-rt default-libcxx default-lld
        bootstrap-prefix hardened llvm-libunwind

diff --git a/sys-devel/clang-common/clang-common-17.0.6-r1.ebuild 
b/sys-devel/clang-common/clang-common-17.0.6-r1.ebuild
index 0083e09889b4..d680a956dfe1 100644
--- a/sys-devel/clang-common/clang-common-17.0.6-r1.ebuild
+++ b/sys-devel/clang-common/clang-common-17.0.6-r1.ebuild
@@ -10,7 +10,7 @@ HOMEPAGE="https://llvm.org/";
 
 LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
 SLOT="0"
-KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux 
~ppc-macos ~x64-macos"
+KEYWORDS="amd64 ~arm arm64 ~loong ~ppc ~ppc64 ~riscv ~sparc x86 ~amd64-linux 
~arm64-macos ~ppc-macos ~x64-macos"
 IUSE="
        default-compiler-rt default-libcxx default-lld
        bootstrap-prefix hardened llvm-libunwind
@@ -175,11 +175,18 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       newins - gentoo-hardened-ld.cfg <<-EOF
-               # Some of these options are added unconditionally, regardless of
-               # USE=hardened, for parity with sys-devel/gcc.
-               -Wl,-z,relro
-       EOF
+       if use kernel_Darwin; then
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # There was -Wl,-z,relro here, but it's not supported 
on Mac
+                       # TODO: investigate whether -bind_at_load or 
-read_only_stubs will do the job
+               EOF
+       else
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # Some of these options are added unconditionally, 
regardless of
+                       # USE=hardened, for parity with sys-devel/gcc.
+                       -Wl,-z,relro
+               EOF
+       fi
 
        dodir /usr/include/gentoo
 

diff --git a/sys-devel/clang-common/clang-common-18.1.0_rc2.ebuild 
b/sys-devel/clang-common/clang-common-18.1.0_rc2.ebuild
index a50679150043..80d989986d28 100644
--- a/sys-devel/clang-common/clang-common-18.1.0_rc2.ebuild
+++ b/sys-devel/clang-common/clang-common-18.1.0_rc2.ebuild
@@ -174,11 +174,18 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       newins - gentoo-hardened-ld.cfg <<-EOF
-               # Some of these options are added unconditionally, regardless of
-               # USE=hardened, for parity with sys-devel/gcc.
-               -Wl,-z,relro
-       EOF
+       if use kernel_Darwin; then
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # There was -Wl,-z,relro here, but it's not supported 
on Mac
+                       # TODO: investigate whether -bind_at_load or 
-read_only_stubs will do the job
+               EOF
+       else
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # Some of these options are added unconditionally, 
regardless of
+                       # USE=hardened, for parity with sys-devel/gcc.
+                       -Wl,-z,relro
+               EOF
+       fi
 
        dodir /usr/include/gentoo
 

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 a50679150043..80d989986d28 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
@@ -174,11 +174,18 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       newins - gentoo-hardened-ld.cfg <<-EOF
-               # Some of these options are added unconditionally, regardless of
-               # USE=hardened, for parity with sys-devel/gcc.
-               -Wl,-z,relro
-       EOF
+       if use kernel_Darwin; then
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # There was -Wl,-z,relro here, but it's not supported 
on Mac
+                       # TODO: investigate whether -bind_at_load or 
-read_only_stubs will do the job
+               EOF
+       else
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # Some of these options are added unconditionally, 
regardless of
+                       # USE=hardened, for parity with sys-devel/gcc.
+                       -Wl,-z,relro
+               EOF
+       fi
 
        dodir /usr/include/gentoo
 

diff --git a/sys-devel/clang-common/clang-common-19.0.0_pre20240203.ebuild 
b/sys-devel/clang-common/clang-common-19.0.0_pre20240203.ebuild
index a50679150043..80d989986d28 100644
--- a/sys-devel/clang-common/clang-common-19.0.0_pre20240203.ebuild
+++ b/sys-devel/clang-common/clang-common-19.0.0_pre20240203.ebuild
@@ -174,11 +174,18 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       newins - gentoo-hardened-ld.cfg <<-EOF
-               # Some of these options are added unconditionally, regardless of
-               # USE=hardened, for parity with sys-devel/gcc.
-               -Wl,-z,relro
-       EOF
+       if use kernel_Darwin; then
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # There was -Wl,-z,relro here, but it's not supported 
on Mac
+                       # TODO: investigate whether -bind_at_load or 
-read_only_stubs will do the job
+               EOF
+       else
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # Some of these options are added unconditionally, 
regardless of
+                       # USE=hardened, for parity with sys-devel/gcc.
+                       -Wl,-z,relro
+               EOF
+       fi
 
        dodir /usr/include/gentoo
 

diff --git a/sys-devel/clang-common/clang-common-19.0.0_pre20240210.ebuild 
b/sys-devel/clang-common/clang-common-19.0.0_pre20240210.ebuild
index a50679150043..80d989986d28 100644
--- a/sys-devel/clang-common/clang-common-19.0.0_pre20240210.ebuild
+++ b/sys-devel/clang-common/clang-common-19.0.0_pre20240210.ebuild
@@ -174,11 +174,18 @@ src_install() {
                -include "${EPREFIX}/usr/include/gentoo/fortify.h"
        EOF
 
-       newins - gentoo-hardened-ld.cfg <<-EOF
-               # Some of these options are added unconditionally, regardless of
-               # USE=hardened, for parity with sys-devel/gcc.
-               -Wl,-z,relro
-       EOF
+       if use kernel_Darwin; then
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # There was -Wl,-z,relro here, but it's not supported 
on Mac
+                       # TODO: investigate whether -bind_at_load or 
-read_only_stubs will do the job
+               EOF
+       else
+               newins - gentoo-hardened-ld.cfg <<-EOF
+                       # Some of these options are added unconditionally, 
regardless of
+                       # USE=hardened, for parity with sys-devel/gcc.
+                       -Wl,-z,relro
+               EOF
+       fi
 
        dodir /usr/include/gentoo
 

Reply via email to