Skip to content

Commit 0e660a3

Browse files
config.mak.uname: avoid macOS linker warning on Xcode 16.3+
Building on macOS with Xcode 16.3 or newer emits: ld: warning: reducing alignment of section __DATA,__common from 0x8000 to 0x4000 because it exceeds segment maximum alignment Pass -fno-common when "ld -v" reports ld-1167 or newer, so tentative definitions of large arrays go into BSS instead of __DATA,__common. Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
1 parent c69baaf commit 0e660a3

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
@@ -163,6 +163,12 @@ ifeq ($(uname_S),Darwin)
163163
NEEDS_GOOD_LIBICONV = UnfortunatelyYes
164164
endif
165165

166+
# Silence Xcode 16.3+ linker warning about __DATA,__common alignment.
167+
LD_MAJOR_VERSION = $(shell ld -v 2>&1 | sed -n 's/.*PROJECT:ld-\([0-9]*\).*/\1/p')
168+
ifeq ($(shell test "$(LD_MAJOR_VERSION)" -ge 1167 && echo 1),1)
169+
BASIC_CFLAGS += -fno-common
170+
endif
171+
166172
# The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require
167173
# Unix domain sockets and PThreads.
168174
ifndef NO_PTHREADS

0 commit comments

Comments
 (0)