From: Otto Moerbeek Date: Fri, 14 Mar 2025 11:13:49 +0000 (+0100) Subject: rec and dnsdist: fix symbol export on macOS X-Git-Tag: dnsdist-2.0.0-alpha1~5^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15307%2Fhead;p=thirdparty%2Fpdns.git rec and dnsdist: fix symbol export on macOS --- diff --git a/pdns/dnsdistdist/meson/lua/meson.build b/pdns/dnsdistdist/meson/lua/meson.build index 3f5a299dc1..62aafc046b 100644 --- a/pdns/dnsdistdist/meson/lua/meson.build +++ b/pdns/dnsdistdist/meson/lua/meson.build @@ -42,8 +42,12 @@ conf.set('HAVE_LUA', dep_lua.found(), description: 'Lua') conf.set('HAVE_LUA_HPP', have_luahpp, description: 'Have ') if dep_lua.found() and dep_lua.name() == 'luajit' - # export FFI interfaces symbols, to be able to use the Lua FFI interface - add_project_link_arguments('-Wl,--export-dynamic-symbol=dnsdist_ffi_*', language: ['c', 'cpp']) + if target_machine.system() != 'darwin' + # export FFI interfaces symbols, to be able to use the Lua FFI interface + add_project_link_arguments('-Wl,--export-dynamic-symbol=dnsdist_ffi_*', language: ['c', 'cpp']) + else + add_project_link_arguments('-rdynamic', language: ['c', 'cpp']) + endif endif summary('Lua', dep_lua.found(), bool_yn: true, section: 'Lua') diff --git a/pdns/recursordist/meson.build b/pdns/recursordist/meson.build index 75ca0664f1..f32b4aa0a7 100644 --- a/pdns/recursordist/meson.build +++ b/pdns/recursordist/meson.build @@ -19,10 +19,6 @@ meson.add_dist_script('version.sh', 'set-dist', meson.project_version()) add_project_arguments('-DRECURSOR', language: 'cpp') add_project_arguments( - '-Wshadow', - '-Wmissing-declarations', - '-Wredundant-decls', - '-Wno-ignored-attributes', '-fvisibility=hidden', language: ['c', 'cpp'], ) @@ -413,13 +409,20 @@ librec_common = declare_dependency( ) ) + +if target_machine.system() != 'darwin' + rec_link_args = [ + '-Wl,--export-dynamic-symbol=pdns_ffi_*', + '-Wl,--export-dynamic-symbol=pdns_postresolve_ffi_*', + ] +else + rec_link_args = ['-rdynamic'] +endif + tools = { 'pdns_recursor': { 'main': src_dir / 'rec-main.cc', - 'link-args': [ - '-Wl,--export-dynamic-symbol=pdns_ffi_*', - '-Wl,--export-dynamic-symbol=pdns_postresolve_ffi_*', - ], + 'link-args': rec_link_args, 'files-extra': [ src_dir / 'capabilities.cc', src_dir / 'channel.cc',