diff --git a/c/r2dec-plugin.c b/c/r2dec-plugin.c index 88e8abb..d1cdad9 100644 --- a/c/r2dec-plugin.c +++ b/c/r2dec-plugin.c @@ -258,7 +258,7 @@ RCorePlugin core_plugin_r2dec = { #ifdef _MSC_VER #define _R_API __declspec(dllexport) #else -#define _R_API +#define _R_API __attribute__((visibility("default"))) #endif #ifndef CORELIB diff --git a/meson.build b/meson.build index 4f05508..13d50ee 100644 --- a/meson.build +++ b/meson.build @@ -10,7 +10,7 @@ libquickjs_dep = libquickjs_proj.get_variable('quickjs_dep') qjsc = libquickjs_proj.get_variable('qjsc') r2dec_incs = ['.', 'c'] -r2dec_c_args = [] +r2dec_c_args = ['-fvisibility=hidden', '-flto'] r2dec_src = [ 'c' / 'r2dec.c', 'c' / 'base64.c', @@ -84,6 +84,7 @@ else shared_library('core_pdd', r2dec_src, c_args : r2dec_c_args, + link_args: ['-Wl,-Bsymbolic'], dependencies: r2dec_deps, include_directories: include_directories(r2dec_incs), implicit_include_directories: false,