Skip to content

Commit db2ca16

Browse files
committed
Merge branch 'hn/macos-linker-warning' into next
A linker warning on macOS when building with Xcode 16.3 or newer has been avoided by passing -fno-common to the compiler when a sufficiently new linker is detected. * hn/macos-linker-warning: config.mak.uname: avoid macOS linker warning on Xcode 16.3+
2 parents 6dc748a + 5cd4d0d commit db2ca16

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

config.mak.uname

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ ifeq ($(uname_S),Darwin)
173173
NEEDS_GOOD_LIBICONV = UnfortunatelyYes
174174
endif
175175

176+
# Silence Xcode 16.3+ linker warning about __DATA,__common alignment.
177+
LD_MAJOR_VERSION = $(shell ld -v 2>&1 | sed -n 's/.*PROJECT:ld-\([0-9]*\).*/\1/p')
178+
ifeq ($(shell test -n "$(LD_MAJOR_VERSION)" && test "$(LD_MAJOR_VERSION)" -ge 1167 && echo 1),1)
179+
BASIC_CFLAGS += -fno-common
180+
endif
181+
176182
# The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require
177183
# Unix domain sockets and PThreads.
178184
ifndef NO_PTHREADS

0 commit comments

Comments
 (0)