@@ -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