meson: macos: Correct -exported_symbols_list syntax for Sonoma compat
authorAndres Freund
Sat, 30 Sep 2023 19:10:15 +0000 (12:10 -0700)
committerAndres Freund
Sat, 30 Sep 2023 19:10:47 +0000 (12:10 -0700)
-exported_symbols_list=... works on Ventura and earlier, but not on
Sonoma. The easiest way to fix it is to -Wl,-exported_symbols_list,@0@ which
actually seems more appropriate anyway, it's obviously a linker argument. It
is easier to use the -Wl,, syntax than passing multiple arguments, due to the
way the export_fmt is used (a single string that's formatted), but if it turns
out to be necessary, we can go for multiple arguments as well.

Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/20230928222248[email protected]
Backpatch: 16-, where the meson based buildsystem was added

meson.build

index 5422885b0a25f66cf7c2d2183aa8e73d32053c70..862c955453f4f0e16bb12854efc495ca4ab31f50 100644 (file)
@@ -224,7 +224,7 @@ elif host_system == 'darwin'
   library_path_var = 'DYLD_LIBRARY_PATH'
 
   export_file_format = 'darwin'
-  export_fmt = '-exported_symbols_list=@0@'
+  export_fmt = '-Wl,-exported_symbols_list,@0@'
 
   mod_link_args_fmt = ['-bundle_loader', '@0@']
   mod_link_with_dir = 'bindir'