Move dependency on libdl into build defs, like CMake

PiperOrigin-RevId: 281699435
Change-Id: Iced13e98578b2c36a1eeac71fd02a6d7ed87a8fb
This commit is contained in:
Christian Blichmann 2019-11-21 01:36:09 -08:00 committed by Copybara-Service
parent ae2954f598
commit 6dd97f5073
2 changed files with 7 additions and 10 deletions

View File

@ -161,10 +161,6 @@ cc_library(
name = "client", name = "client",
srcs = ["client.cc"], srcs = ["client.cc"],
copts = sapi_platform_copts(), copts = sapi_platform_copts(),
# TODO(124852776): investigate whether this is necessary
linkopts = [
"-Wl,-ldl",
],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
":call", ":call",

View File

@ -205,9 +205,12 @@ def sapi_library(
native.cc_binary( native.cc_binary(
name = name + ".bin", name = name + ".bin",
linkopts = [ linkopts = [
# The sandboxing client must have access to all "-ldl", # For dlopen(), dlsym()
"-Wl,-E", # symbols used in the sandboxed library, so these # The sandboxing client must have access to all symbols used in
] + exported_funcs, # must be both referenced, and exported # the sandboxed library, so these must be both referenced, and
# exported
"-Wl,-E",
] + exported_funcs,
deps = [ deps = [
":" + name + ".lib", ":" + name + ".lib",
rprefix + "//sandboxed_api:client", rprefix + "//sandboxed_api:client",
@ -217,9 +220,7 @@ def sapi_library(
native.cc_library( native.cc_library(
name = name + ".lib", name = name + ".lib",
deps = [ deps = [lib],
lib,
],
alwayslink = 1, # All functions are linked into depending binaries alwayslink = 1, # All functions are linked into depending binaries
**common **common
) )