commit:     80f6d04c612d5bd82d6cb0aca530c6f68addf7b6
Author:     Jacob Floyd <cognifloyd <AT> gmail <DOT> com>
AuthorDate: Fri Dec 18 21:06:17 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sat Dec 19 19:07:39 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80f6d04c

sys-devel/binutils-apple-11.3.1: fix compilation on newer macOS

In the version of private header (dyld_priv.h) copied from DYLD sources,
It uses TARGET_OS_BRIDGE which is not defined in the latest MacOSX.sdk.
We don't care about BridgeOS, so we just disable that.

This only hits during stage3 and later once we've compiled our own
clang so that clang starts injecting -Werror,-Wundef-prefix=TARGET_OS_
(Apple must have that disabled in their version of clang).

Bug: https://bugs.gentoo.org/758167
Signed-off-by: Jacob Floyd <cognifloyd <AT> gmail.com>
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 sys-devel/binutils-apple/binutils-apple-11.3.1.ebuild | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys-devel/binutils-apple/binutils-apple-11.3.1.ebuild 
b/sys-devel/binutils-apple/binutils-apple-11.3.1.ebuild
index 9263d8e00b0..9c24505b552 100644
--- a/sys-devel/binutils-apple/binutils-apple-11.3.1.ebuild
+++ b/sys-devel/binutils-apple/binutils-apple-11.3.1.ebuild
@@ -79,6 +79,10 @@ src_prepare() {
        mkdir -p include/mach-o || die
        # never present because it's private
        cp ../../${DYLD}/include/mach-o/dyld_priv.h include/mach-o || die
+       # TARGET_OS_BRIDGE is undefined in TargetConditionals.h of newer 
MacOSX.sdk.
+       # We don't target BridgeOS. Disable it to avoid errors when clang adds:
+       # -Werror,-Wundef-prefix=TARGET_OS_
+       sed -i -e 's/#if TARGET_OS_BRIDGE/#if 0/' include/mach-o/dyld_priv.h
 
        local VER_STR="\"@(#)PROGRAM:ld  PROJECT:${LD64} (Gentoo 
${PN}-${PVR})\\n\""
        echo "char ldVersionString[] = ${VER_STR};" > version.cpp

Reply via email to