Skip to content

Commit f56271a

Browse files
Sandboxed API Teamcopybara-github
authored andcommitted
Only add sandboxee linkopts when not generating CallMsgHandler function
PiperOrigin-RevId: 900139388 Change-Id: I4e29172a0ec5f11e4bb0e2cc6217f61b4179e55d
1 parent f2ad018 commit f56271a

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

sandboxed_api/bazel/sapi.bzl

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -388,19 +388,22 @@ def sapi_library(
388388
embed = False
389389
in_process = sandbox_mode == "passthrough"
390390

391-
# Reference (pull into the archive) required functions only. If the functions'
392-
# array is empty, pull in the whole archive (may not compile with MSAN).
393-
exported_funcs = ["-Wl,-u," + s for s in functions]
394-
if (not exported_funcs):
395-
exported_funcs = [
396-
"-Wl,--whole-archive",
397-
"-Wl,--allow-multiple-definition",
398-
]
399-
sandboxee_linkopts = [
400-
"-ldl", # For dlopen(), dlsym()
401-
# The sandboxing client must have access to all
402-
"-Wl,-E", # symbols used in the sandboxed library, so these
403-
] + exported_funcs # must be both referenced, and exported
391+
if use_sandboxee_generation:
392+
sandboxee_linkopts = []
393+
else:
394+
# Reference (pull into the archive) required functions only. If the functions'
395+
# array is empty, pull in the whole archive (may not compile with MSAN).
396+
exported_funcs = ["-Wl,-u," + s for s in functions]
397+
if (not exported_funcs):
398+
exported_funcs = [
399+
"-Wl,--whole-archive",
400+
"-Wl,--allow-multiple-definition",
401+
]
402+
sandboxee_linkopts = [
403+
"-ldl", # For dlopen(), dlsym()
404+
# The sandboxing client must have access to all
405+
"-Wl,-E", # symbols used in the sandboxed library, so these
406+
] + exported_funcs # must be both referenced, and exported
404407

405408
lib_hdrs = hdrs or []
406409

0 commit comments

Comments
 (0)