meson: macos: Avoid warnings on Sonoma
authorAndres Freund
Wed, 13 Mar 2024 08:40:53 +0000 (01:40 -0700)
committerAndres Freund
Wed, 13 Mar 2024 08:40:53 +0000 (01:40 -0700)
commita3da95deee38ee067b0bead639c830eacbe894d5
tree8f67db39a7c9724f8bb9d15331e7682958102aff
parent6612185883c6a43979693358423ee647421ff621
meson: macos: Avoid warnings on Sonoma

Starting with the Sonoma toolchain macos' linker emits warnings when the same
library is linked to twice. That's ill considered, as the same library can be
used by multiple subsidiary libraries. Luckily there's a flag to suppress that
warning.

On Ventura meson's default of -Wl,-undefined,dynamic_lookup caused warnings,
which we suppressed with -Wl,-undefined,error. Unfortunately that causes a
warning on Sonoma, which is absurd, as it's documented linker default. To
avoid that warning, only add -Wl,-undefined,error if it does not trigger
warnings. Luckily dynamic_lookup doesn't trigger a warning on Sonoma anymore.

Discussion: https://postgr.es/m/20231201040515[email protected]
Backpatch: 16-, where the meson build was added
meson.build