From 5477d585d81a72ae76509889dc829f9636a1b613 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Fri, 18 Dec 2020 15:06:17 -0600 Subject: [PATCH] binutils-apple: fix prefix bootstrap stage3 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 once we've re-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 --- 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 -- 2.26.2