openwrt-mirror/toolchain/gcc/patches-11.x
Georgi Valkov d3bb23946e toolchain: gcc: fix build error with Xcode 16.3
Xcode 16.3 defines TARGET_OS_MAC, it was not defined in prior versions.
zutil.h conditionally defines fdopen as NULL when this macro is defined,
resulting in the following build error:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7: e>
  318 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^
./zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */

In Xcode 16.2 and earlier, TARGET_OS_MAC was not defined so this entire
block was ignored, gcc and gdb used to compile and work fine.

This may have been used for compatibility with older versions of macOS,
but is no longer needed. By pure luck, the build worked fine for a long
time, because it did not properly detect macOS.
Fixed by removing the check for TARGET_OS_MAC.

Note that since Xcode 16.3, an entire set of TARGET_OS macros
are now defined, most of which are set to 0:
TARGET_OS_LINUX 0
TARGET_OS_MAC 1
TARGET_OS_OSX 1

Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18467
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-04-16 14:38:34 +02:00
..
002-case_insensitive.patch
010-documentation.patch
011-v12-configure-define-TARGET_LIBC_GNUSTACK-on-musl.patch
020-Include-safe-ctype.h-after-C-standard-headers-to-avo.patch toolchain/gcc: fix build errors on macOS with Xcode 15.3 2024-04-02 11:10:32 +02:00
110-Fix-MIPS-PR-84790.patch
230-musl_libssp.patch
300-mips_Os_cpu_rtx_cost_model.patch
400-libsanitizer-cherry-pick-9cf13067cb5088626ba7-from-u.patch
700-RISCV-Inline-subword-atomic-ops.patch toolchain: gcc: backport inline subword atomic support for riscv 2023-06-11 17:09:06 +02:00
701-riscv-linux-Don-t-add-latomic-with-pthread.patch toolchain: gcc: backport inline subword atomic support for riscv 2023-06-11 17:09:06 +02:00
810-arm-softfloat-libgcc.patch
820-libgcc_pic.patch
840-armv4_pass_fix-v4bx_to_ld.patch
850-use_shared_libgcc.patch
851-libgcc_no_compat.patch
870-ppc_no_crtsavres.patch
881-no_tm_section.patch
900-bad-mips16-crt.patch
910-mbsd_multi.patch toolchain: gcc: backport inline subword atomic support for riscv 2023-06-11 17:09:06 +02:00
920-specs_nonfatal_getenv.patch
931-libffi-fix-MIPS-softfloat-build-issue.patch
960-gotools-fix-compilation-when-making-cross-compiler.patch
970-macos_arm64-building-fix.patch
980-fix-build-error-with-Xcode-16.3.patch toolchain: gcc: fix build error with Xcode 16.3 2025-04-16 14:38:34 +02:00