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",
srcs = ["client.cc"],
copts = sapi_platform_copts(),
# TODO(124852776): investigate whether this is necessary
linkopts = [
"-Wl,-ldl",
],
visibility = ["//visibility:public"],
deps = [
":call",

View File

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