Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita3da95d

Browse files
committed
meson: macos: Avoid warnings on Sonoma
Starting with the Sonoma toolchain macos' linker emits warnings when the samelibrary is linked to twice. That's ill considered, as the same library can beused by multiple subsidiary libraries. Luckily there's a flag to suppress thatwarning.On Ventura meson's default of -Wl,-undefined,dynamic_lookup caused warnings,which we suppressed with -Wl,-undefined,error. Unfortunately that causes awarning on Sonoma, which is absurd, as it's documented linker default. Toavoid that warning, only add -Wl,-undefined,error if it does not triggerwarnings. Luckily dynamic_lookup doesn't trigger a warning on Sonoma anymore.Discussion:https://postgr.es/m/20231201040515.p5bshhhtfru7d3da@awork3.anarazel.deBackpatch: 16-, where the meson build was added
1 parent6612185 commita3da95d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

‎meson.build

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,20 @@ elif host_system == 'darwin'
222222
cflags+= ['-isysroot', pg_sysroot]
223223
ldflags+= ['-isysroot', pg_sysroot]
224224
endif
225+
225226
# meson defaults to -Wl,-undefined,dynamic_lookup for modules, which we
226227
# don't want because a) it's different from what we do for autoconf, b) it
227-
# causes warnings starting in macOS Ventura
228-
ldflags_mod+= ['-Wl,-undefined,error']
228+
# causes warnings in macOS Ventura. But using -Wl,-undefined,error causes a
229+
# warning starting in Sonoma. So only add -Wl,-undefined,error if it does
230+
# not cause a warning.
231+
if cc.has_multi_link_arguments('-Wl,-undefined,error','-Werror')
232+
ldflags_mod+='-Wl,-undefined,error'
233+
endif
234+
235+
# Starting in Sonoma, the linker warns about the same library being
236+
# linked twice. Which can easily happen when multiple dependencies
237+
# depend on the same library. Quiesce the ill considered warning.
238+
ldflags+= cc.get_supported_link_arguments('-Wl,-no_warn_duplicate_libraries')
229239

230240
elif host_system=='freebsd'
231241
sema_kind='unnamed_posix'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp