1
0
Fork 0
forked from mirror/openwrt
openwrt/toolchain/gcc
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
..
files do not use the wrapper scripts for exportable toolchains internally. on some systems the wrapper scripts are broken, and their use should be opt-in 2009-11-19 17:23:31 +00:00
final toolchain/gcc: use explicit configure args 2023-02-09 02:53:35 +01:00
initial toolchain: remove installing twice in the "initial" subdir 2023-02-19 19:44:39 +01:00
minimal toolchain: skip gcc/minimal for musl 2016-07-07 15:13:40 +02:00
patches-11.x toolchain: gcc: fix build error with Xcode 16.3 2025-04-16 14:38:34 +02:00
patches-12.x toolchain: gcc: fix build error with Xcode 16.3 2025-04-16 14:38:34 +02:00
patches-13.x toolchain: gcc: fix build error with Xcode 16.3 2025-04-16 14:38:34 +02:00
patches-14.x toolchain: gcc: fix build error with Xcode 16.3 2025-04-16 14:38:34 +02:00
common.mk toolchain: gcc: update GCC 14 to 14.2.0 2024-08-13 00:30:29 +02:00
Config.in toolchain: gcc: add support for GCC 14 2024-05-12 12:47:12 +01:00
Config.version toolchain: gcc: update GCC 14 to 14.2.0 2024-08-13 00:30:29 +02:00
exclude-testsuite toolchain: add gcc 7.1.0 support 2017-05-25 19:01:07 +02:00