From b0efc17d3b898206c2e1c98ad4884e404808c854 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 21 Dec 2023 19:05:53 +0100 Subject: [Linux] Only export extension init symbol 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 exports its symbols. --- tools/openssl.py | 4 ++++ tools/rtc.py | 2 ++ 2 files changed, 6 insertions(+) (limited to 'tools') diff --git a/tools/openssl.py b/tools/openssl.py index f42928f..7b18210 100644 --- a/tools/openssl.py +++ b/tools/openssl.py @@ -125,6 +125,8 @@ def build_openssl(env, jobs=None): env.Prepend(LIBPATH=[env["SSL_BUILD"]]) if env["platform"] == "windows": env.PrependUnique(LIBS=["crypt32", "ws2_32", "advapi32", "user32"]) + if env["platform"] == "linux": + env.PrependUnique(LIBS=["pthread", "dl"]) env.Prepend(LIBS=env["SSL_LIBS"]) return [env["SSL_CRYPTO_LIBRARY"], env["SSL_LIBRARY"]] @@ -169,6 +171,8 @@ def build_openssl(env, jobs=None): env.Prepend(LIBPATH=[env["SSL_BUILD"]]) if env["platform"] == "windows": env.PrependUnique(LIBS=["crypt32", "ws2_32", "advapi32", "user32"]) + if env["platform"] == "linux": + env.PrependUnique(LIBS=["pthread", "dl"]) env.Prepend(LIBS=env["SSL_LIBS"]) return ssl diff --git a/tools/rtc.py b/tools/rtc.py index 6882bb4..b4d9173 100644 --- a/tools/rtc.py +++ b/tools/rtc.py @@ -37,6 +37,8 @@ def build_library(env, ssl): # Configure env. if env["platform"] == "windows": env.PrependUnique(LIBS=["iphlpapi", "bcrypt"]) + if env["platform"] == "linux": + env.PrependUnique(LIBS=["pthread"]) env.Prepend(LIBS=list(filter(lambda f: str(f).endswith(lib_ext), rtc))) env.Append(CPPPATH=["#thirdparty/libdatachannel/include"]) -- cgit v1.2.3