Skip to content

Commit 781d072

Browse files
committed
Merge branch 'hn/macos-linker-warning' into seen
Xcode 15 and later has a linker set to complain when the same library archive is listed twice on the command line. Squelch the annoyance. * hn/macos-linker-warning: config.mak.uname: avoid macOS dup-library warning
2 parents 9b12223 + f6791de commit 781d072

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

config.mak.uname

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,15 @@ 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')
176+
# ld reports "PROJECT:{ld,ld64,dyld}-NNN", match any of the three.
177+
LD_MAJOR_VERSION = $(shell ld -v 2>&1 | sed -n 's/.*PROJECT:[^ ]*-\([0-9][0-9]*\).*/\1/p')
178+
179+
# Silence the Xcode 15+ warning about archives listed more than once.
180+
ifeq ($(shell test -n "$(LD_MAJOR_VERSION)" && test "$(LD_MAJOR_VERSION)" -ge 907 && echo 1),1)
181+
BASIC_LDFLAGS += -Wl,-no_warn_duplicate_libraries
182+
endif
183+
184+
# Silence the Xcode 16.3+ warning about __DATA,__common alignment.
178185
ifeq ($(shell test -n "$(LD_MAJOR_VERSION)" && test "$(LD_MAJOR_VERSION)" -ge 1167 && echo 1),1)
179186
BASIC_CFLAGS += -fno-common
180187
endif

0 commit comments

Comments
 (0)