meson: macos: Use -Wl,-undefined,error for modules
authorAndres Freund <[email protected]>
Sun, 16 Oct 2022 00:00:27 +0000 (17:00 -0700)
committerAndres Freund <[email protected]>
Sun, 16 Oct 2022 00:02:32 +0000 (17:02 -0700)
meson defaults to -Wl,-undefined,dynamic_lookup for modules, which we don't
want because a) it's different from what we do for autoconf, b) it causes
warnings starting in macOS Ventura.

Discussion: https://postgr.es/m/20221015211955[email protected]

meson.build

index fdf8ec8ad9c1e3655237a0999f3de4d845ad2349..2d225f706d2ff881aa18c0c1bca4d4b41c50f109 100644 (file)
@@ -228,6 +228,10 @@ elif host_system == 'darwin'
   message('darwin sysroot: @0@'.format(pg_sysroot))
   cflags += ['-isysroot', pg_sysroot]
   ldflags += ['-isysroot', pg_sysroot]
+  # meson defaults to -Wl,-undefined,dynamic_lookup for modules, which we
+  # don't want because a) it's different from what we do for autoconf, b) it
+  # causes warnings starting in macOS Ventura
+  ldflags_mod += ['-Wl,-undefined,error']
 
 elif host_system == 'freebsd'
   sema_kind = 'unnamed_posix'