NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/59413: tools build blows up in zutil.h on macOS 15.4.1/Xcode 16.3



>Number:         59413
>Category:       toolchain
>Synopsis:       tools build blows up in zutil.h on macOS 15.4.1/Xcode 16.3
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 09 20:00:00 +0000 2025
>Originator:     Christoph Badura
>Release:        netbsd-current
>Organization:
The MAZE OF TWISTY LITTLE ZLIB VERSIONS, ALL DIFFERENT Foundation
>Environment:
Darwin inspiral-coalescence-ringdown 24.4.0 Darwin Kernel Version 24.4.0: Fri Apr 11 18:28:23 PDT 2025; root:xnu-11417.101.15~117/RELEASE_X86_64 x86_64
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: x86_64-apple-darwin24.4.0

>Description:
clang aborts with: 
In file included from /Users/bad/work/netbsd/src-current/tools/gdb/../../external/gpl3/gdb/dist/zlib/zutil.c:10:
In file included from /Users/bad/work/netbsd/src-current/tools/gdb/../../external/gpl3/gdb/dist/zlib/gzguts.h:21:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7: error: expected identifier or '('
  318 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^
/Users/bad/work/netbsd/src-current/tools/gdb/../../external/gpl3/gdb/dist/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */

The same happens for binutils and gcc.

Also:

In file included from /Users/bad/work/netbsd/src-current/tools/gdb/../../external/gpl3/gdb/dist/zlib/zutil.c:8:
/Users/bad/work/netbsd/src-current/tools/gdb/../../external/gpl3/gdb/dist/zlib/zutil.h:170:11: warning: 'OS_CODE' macro redefined [-Wmacro-redefined]
  170 | #  define OS_CODE 19
      |           ^
/Users/bad/work/netbsd/src-current/tools/gdb/../../external/gpl3/gdb/dist/zlib/zutil.h:141:11: note: previous definition is here
  141 | #  define OS_CODE  7
      |           ^

First report (with out details, though) by Greg Woods:
https://mail-index.netbsd.org/current-users/2025/04/04/msg046361.html

Both problems fixed upstream in zlib in commit
https://github.com/madler/zlib/commit/4bd9a71f3539b5ce47f0c67ab5e01f3196dc8ef9
which removed the #define for fdopen as that isn't used by the zlib code anymore.

Our tree includes 6 copies of zlib:
common/dist/zlib/zutil.h
external/cddl/osnet/dist/uts/common/zmod/zutil.h

external/gpl3/gdb/dist/zlib/zutil.h
external/gpl3/gdb.old/dist/zlib/zutil.h
external/gpl3/binutils.old/dist/zlib/zutil.h
external/gpl3/binutils/dist/zlib/zutil.h

The first one is at version 1.3.1 and not affected.
The second one is not used in the tools build.

The last 4 need to be patched.

martin@ remarked that it would be desirable to not have 6 copies of zlib in the tree.

This is probably worth pulling up.  But that very likely needs to be done with a patch.

>How-To-Repeat:
"build.sh -m amd64 tools build" on macOS 15.4.1 with Xcode 16.3 installed.

>Fix:
Liberally apply the above upstream commit.



Home | Main Index | Thread Index | Old Index