Split sanitizer.h into a separate library

PiperOrigin-RevId: 305327952
Change-Id: I6708729d379d019c3d299e9cb54b76338ced23bf
This commit is contained in:
Sandboxed API Team 2020-04-07 13:26:15 -07:00 committed by Copybara-Service
parent bd4cb3ad10
commit 9b85dc49c1
2 changed files with 31 additions and 15 deletions

View File

@ -190,9 +190,9 @@ cc_binary(
srcs = ["forkserver_bin.cc"],
copts = sapi_platform_copts(),
deps = [
":client",
":comms",
":forkserver",
":sanitizer",
"//sandboxed_api/sandbox2/util:strerror",
"//sandboxed_api/util:raw_logging",
"@com_google_absl//absl/base:core_headers",
@ -211,10 +211,10 @@ cc_library(
hdrs = ["global_forkclient.h"],
copts = sapi_platform_copts(),
deps = [
":client",
":comms",
":forkserver",
":forkserver_bin_embed",
":sanitizer",
"//sandboxed_api:embed_file",
"//sandboxed_api/sandbox2/util:strerror",
"//sandboxed_api/util:raw_logging",
@ -277,6 +277,7 @@ cc_library(
":comms",
":forkserver_cc_proto",
":global_forkserver",
":sanitizer",
":violation_cc_proto",
":forkserver",
":ipc",
@ -310,7 +311,6 @@ cc_library(
"//sandboxed_api/sandbox2/util:bpf_helper",
"//sandboxed_api/sandbox2/util:file_base",
"//sandboxed_api/sandbox2/util:fileops",
"//sandboxed_api/sandbox2/util:strerror",
"//sandboxed_api/util:raw_logging",
"//sandboxed_api/util:status",
"//sandboxed_api/util:statusor",
@ -325,10 +325,7 @@ cc_library(
cc_library(
name = "client",
srcs = ["client.cc"],
hdrs = [
"client.h",
"sanitizer.h",
],
hdrs = ["client.h"],
copts = sapi_platform_copts(),
visibility = ["//visibility:public"],
deps = [
@ -336,11 +333,8 @@ cc_library(
":logsink",
":sanitizer",
"//sandboxed_api/sandbox2/network_proxy:client",
"//sandboxed_api/sandbox2/util:file_helpers",
"//sandboxed_api/sandbox2/util:fileops",
"//sandboxed_api/sandbox2/util:strerror",
"//sandboxed_api/util:raw_logging",
"//sandboxed_api/util:status",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
@ -376,6 +370,7 @@ cc_library(
":forkserver_cc_proto",
":namespace",
":policy",
":sanitizer",
":syscall",
":util",
"//sandboxed_api/sandbox2/unwind",
@ -487,6 +482,7 @@ cc_library(
":client",
":comms",
":forkserver",
":sanitizer",
"@com_google_absl//absl/memory",
],
)
@ -710,9 +706,9 @@ cc_test(
copts = sapi_platform_copts(),
data = ["//sandboxed_api/sandbox2/testcases:sanitizer"],
deps = [
":client",
":comms",
":sandbox2",
":sanitizer",
":testing",
":util",
"//sandboxed_api/sandbox2/util:bpf_helper",

View File

@ -197,6 +197,7 @@ target_link_libraries(forkserver_bin PRIVATE
sandbox2::client
sandbox2::comms
sandbox2::forkserver
sandbox2::sanitizer
sandbox2::strerror
sapi::base
sapi::raw_logging
@ -223,6 +224,7 @@ target_link_libraries(sandbox2_global_forkserver PRIVATE
sandbox2::comms
sandbox2::forkserver
sandbox2::forkserver_bin_embed
sandbox2::sanitizer
sandbox2::strerror
sapi::base
sapi::embed_file
@ -295,6 +297,7 @@ target_link_libraries(sandbox2_sandbox2
sandbox2::ptrace_hook
sandbox2::regs
sandbox2::result
sandbox2::sanitizer
sandbox2::syscall
sandbox2::unwind
sandbox2::unwind_proto
@ -311,18 +314,15 @@ target_link_libraries(sandbox2_sandbox2
add_library(sandbox2_client STATIC
client.cc
client.h
sanitizer.cc
sanitizer.h
)
add_library(sandbox2::client ALIAS sandbox2_client)
target_link_libraries(sandbox2_client
PRIVATE absl::core_headers
absl::memory
absl::strings
sandbox2::file_helpers
sandbox2::fileops
sandbox2::logsink
sandbox2::network_proxy_client
sandbox2::sanitizer
sandbox2::strerror
sapi::base
sapi::raw_logging
@ -330,6 +330,23 @@ target_link_libraries(sandbox2_client
sandbox2::comms
)
# sandboxed_api/sandbox2:sanitizer
add_library(sandbox2_sanitizer STATIC
sanitizer.cc
sanitizer.h
)
add_library(sandbox2::sanitizer ALIAS sandbox2_sanitizer)
target_link_libraries(sandbox2_sanitizer
PRIVATE absl::core_headers
absl::strings
sandbox2::file_helpers
sandbox2::fileops
sandbox2::strerror
sapi::base
sapi::raw_logging
PUBLIC glog::glog
)
# sandboxed_api/sandbox2:forkserver
add_library(sandbox2_forkserver STATIC
forkserver.cc
@ -351,6 +368,7 @@ target_link_libraries(sandbox2_forkserver PRIVATE
sandbox2::policy
sandbox2::ptrace_hook
sandbox2::strerror
sandbox2::sanitizer
sandbox2::syscall
sandbox2::unwind
sandbox2::unwind_proto
@ -416,6 +434,7 @@ add_library(sandbox2::forkingclient ALIAS sandbox2_forkingclient)
target_link_libraries(sandbox2_forkingclient
PRIVATE absl::memory
sandbox2::forkserver
sandbox2::sanitizer
sapi::base
PUBLIC sandbox2::client
)
@ -772,6 +791,7 @@ if(SAPI_ENABLE_TESTS)
sandbox2::client
sandbox2::comms
sandbox2::sandbox2
sandbox2::sanitizer
sandbox2::testing
sandbox2::util
sapi::status_matchers