commit:     b55238cc14fdf9eb9cfbd71e26ec84f855f3a259
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 19:16:11 2024 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 19:16:11 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=b55238cc

sys-devel/gcc-14.2.0: fix interoperability with Clang 16's as

Sequoia comes with Clang 16 which requires explicitness for reading from
pipe

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 sys-devel/gcc/files/gcc-14.2.0-darwin-as-dash-pipe.patch | 14 ++++++++++++++
 sys-devel/gcc/gcc-14.2.0.ebuild                          |  5 ++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/sys-devel/gcc/files/gcc-14.2.0-darwin-as-dash-pipe.patch 
b/sys-devel/gcc/files/gcc-14.2.0-darwin-as-dash-pipe.patch
new file mode 100644
index 0000000000..a4d79d1295
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-14.2.0-darwin-as-dash-pipe.patch
@@ -0,0 +1,14 @@
+Since Sequoia with Clang 16, as needs - when used via pipe input
+
+--- a/gcc/config/darwin.h
++++ b/gcc/config/darwin.h
+@@ -977,6 +977,9 @@
+   { "weak_import", 0, 0, true, false, false, false,                        \
+     darwin_handle_weak_import_attribute, NULL }
+ 
++/* Since clang 16 called as 'as', it requires a dash to read pipe */
++#define AS_NEEDS_DASH_FOR_PIPED_INPUT
++
+ /* Make local constant labels linker-visible, so that if one follows a
+    weak_global constant, ld64 will be able to separate the atoms.  */
+ #undef ASM_GENERATE_INTERNAL_LABEL

diff --git a/sys-devel/gcc/gcc-14.2.0.ebuild b/sys-devel/gcc/gcc-14.2.0.ebuild
index 1528d821c9..a6df03929c 100644
--- a/sys-devel/gcc/gcc-14.2.0.ebuild
+++ b/sys-devel/gcc/gcc-14.2.0.ebuild
@@ -46,6 +46,9 @@ src_prepare() {
        # apply big arm64-darwin patch first thing
        use elibc_Darwin && eapply "${DISTDIR}"/${P}-arm64-darwin.patch
 
+       # run as with - on pipe (for Clang 16)
+       eapply "${FILESDIR}"/${PN}-14.2.0-darwin-as-dash-pipe.patch
+
        # make sure 64-bits native targets don't screw up the linker paths
        eapply "${FILESDIR}"/gcc-12-no-libs-for-startfile.patch
 
@@ -57,7 +60,7 @@ src_prepare() {
        done
 
        toolchain_src_prepare
-       #
+
        # make it have correct install_names on Darwin
        eapply -p1 "${FILESDIR}"/4.3.3/darwin-libgcc_s-installname.patch
 

Reply via email to