Skip to content

Commit

Permalink
Merge pull request godotengine#79578 from Faless/web/4.x_dlink_visibi…
Browse files Browse the repository at this point in the history
…lity

[Web] Use `fvisibility=hidden` for side module when dlink_enabled.
  • Loading branch information
akien-mga committed Aug 17, 2023
2 parents 1fda5ea + 5eed870 commit 314cdf4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions platform/web/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ if env["dlink_enabled"]:
sys_env.Append(LINKFLAGS=["-s", "WARN_ON_UNDEFINED_SYMBOLS=0"])
# Force exporting the standard library (printf, malloc, etc.)
sys_env["ENV"]["EMCC_FORCE_STDLIBS"] = "libc,libc++,libc++abi"
sys_env["CCFLAGS"].remove("-fvisibility=hidden")
sys_env["LINKFLAGS"].remove("-fvisibility=hidden")

# The main emscripten runtime, with exported standard libraries.
sys = sys_env.Program(build_targets, ["web_runtime.cpp"])

Expand Down
2 changes: 2 additions & 0 deletions platform/web/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ def configure(env: "Environment"):

env.Append(CCFLAGS=["-s", "SIDE_MODULE=2"])
env.Append(LINKFLAGS=["-s", "SIDE_MODULE=2"])
env.Append(CCFLAGS=["-fvisibility=hidden"])
env.Append(LINKFLAGS=["-fvisibility=hidden"])
env.extra_suffix = ".dlink" + env.extra_suffix

# Reduce code size by generating less support code (e.g. skip NodeJS support).
Expand Down

0 comments on commit 314cdf4

Please sign in to comment.