Skip to content

Commit

Permalink
agent: Exclude OS/arch symbols in version script
Browse files Browse the repository at this point in the history
Newer toolchains, such as the default toolchain on FreeBSD 14.2,
don't like references to symbols that don't exist. Instead of
listing JNI_OnLoad, which is only defined for Android builds,
we use a separate version script for Android instead.
  • Loading branch information
oleavr committed Jan 9, 2025
1 parent 1e0f37f commit 7638290
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions lib/agent/frida-agent-android.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
global:
frida_agent_main;
JNI_OnLoad;

local:
*;
};
1 change: 0 additions & 1 deletion lib/agent/frida-agent.version
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
global:
frida_agent_main;
JNI_OnLoad;

local:
*;
Expand Down
2 changes: 1 addition & 1 deletion lib/agent/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if host_os_family == 'windows'
elif host_os_family == 'darwin'
extra_link_args += '-Wl,-exported_symbol,_frida_agent_main'
else
symscript = 'frida-agent.version'
symscript = (host_os == 'android') ? 'frida-agent-android.version' : 'frida-agent.version'
extra_link_args += '-Wl,--version-script,' + meson.current_source_dir() / symscript
extra_link_depends += symscript
endif
Expand Down

0 comments on commit 7638290

Please sign in to comment.