Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix r2dec using external qjs, and fix symbol visibility #331

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c/r2dec-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be tested like this (otherwise it will fail on other compilers)

  if cc.has_argument('-fvisibility=hidden')
    r2dec_c_args += '-fvisibility=hidden'
  endif

r2dec_src = [
'c' / 'r2dec.c',
'c' / 'base64.c',
Expand Down Expand Up @@ -84,6 +84,7 @@ else

shared_library('core_pdd', r2dec_src,
c_args : r2dec_c_args,
link_args: ['-Wl,-Bsymbolic'],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same this.

dependencies: r2dec_deps,
include_directories: include_directories(r2dec_incs),
implicit_include_directories: false,
Expand Down