Skip to content

Commit

Permalink
[Linux] Only export extension init symbol
Browse files Browse the repository at this point in the history
Since we link with static libstdc++ we need to tell gcc to only export
the necessary symbols.
Using "-fvisibility=hidden" will not work, since libstdc++ explicitly
export its symbols.
  • Loading branch information
Faless committed Dec 21, 2023
1 parent 724910c commit b76cc5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ if env["platform"] == "macos" and os.environ.get("OSXCROSS_ROOT", ""):
if env["platform"] == "linux":
env.Append(
LINKFLAGS=[
"-Wl,--no-undefined",
"-Wl,--no-undefined,--version-script=" + env.File("misc/dist/linux/symbols.map").abspath,
"-static-libgcc",
"-static-libstdc++",
]
Expand Down
6 changes: 6 additions & 0 deletions misc/dist/linux/symbols.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
global:
webrtc_extension_init;
local:
*;
};

0 comments on commit b76cc5b

Please sign in to comment.