1# Copyright 2019 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15load("//sandboxed_api/bazel:build_defs.bzl", "sapi_platform_copts") 16load("//sandboxed_api/bazel:proto.bzl", "sapi_proto_library") 17 18package(default_visibility = [ 19 "//sandboxed_api/sandbox2:__subpackages__", 20]) 21 22licenses(["notice"]) 23 24cc_library( 25 name = "ptrace_hook", 26 srcs = ["ptrace_hook.cc"], 27 hdrs = ["ptrace_hook.h"], 28 copts = sapi_platform_copts(), 29 deps = [ 30 "//sandboxed_api/sandbox2/util:syscall_trap", 31 "@com_google_absl//absl/strings", 32 ], 33) 34 35cc_library( 36 name = "unwind", 37 srcs = ["unwind.cc"], 38 hdrs = ["unwind.h"], 39 copts = sapi_platform_copts([ 40 # TODO(cblichmann): Remove this, fix bazel/external/libunwind.BUILD 41 "-Iexternal/org_gnu_libunwind/include", 42 ]), 43 visibility = ["//visibility:public"], 44 deps = [ 45 ":ptrace_hook", 46 ":unwind_cc_proto", 47 "//sandboxed_api:config", 48 "//sandboxed_api/sandbox2:comms", 49 "//sandboxed_api/sandbox2/util:maps_parser", 50 "//sandboxed_api/sandbox2/util:minielf", 51 "//sandboxed_api/util:file_helpers", 52 "//sandboxed_api/util:raw_logging", 53 "//sandboxed_api/util:status", 54 "@com_google_absl//absl/cleanup", 55 "@com_google_absl//absl/status", 56 "@com_google_absl//absl/status:statusor", 57 "@com_google_absl//absl/strings", 58 "@org_gnu_libunwind//:unwind-ptrace", 59 ], 60) 61 62sapi_proto_library( 63 name = "unwind_proto", 64 srcs = ["unwind.proto"], 65) 66