Also add absl/strings/internal/utf8.cc to the sandbox source lists; the newer str_format wide-char path references WideToUtf8. Differential Revision: https://phabricator.services.mozilla.com/D309452
167 lines
6.1 KiB
INI
167 lines
6.1 KiB
INI
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
SharedLibrary("mozsandbox")
|
|
|
|
# Depend on mozglue if and only if it's a shared library;
|
|
# this needs to match mozglue/build/moz.build:
|
|
if CONFIG["OS_TARGET"] == "Android":
|
|
USE_LIBS += [
|
|
"mozglue",
|
|
]
|
|
|
|
USE_LIBS += [
|
|
# For PR_GetEnv
|
|
"nspr",
|
|
]
|
|
|
|
OS_LIBS += CONFIG["DL_LIBS"]
|
|
|
|
EXPORTS.mozilla += [
|
|
"Sandbox.h",
|
|
"SandboxInfo.h",
|
|
"SandboxProfiler.h",
|
|
"SandboxProfilerObserver.h",
|
|
]
|
|
|
|
UNIFIED_SOURCES += [
|
|
"../chromium-shim/base/debug/dump_without_crashing.cpp",
|
|
"../chromium-shim/base/debug/stack_trace.cpp",
|
|
"../chromium-shim/base/logging.cpp",
|
|
"../chromium-shim/base/threading/platform_thread_linux.cpp",
|
|
"../chromium/base/at_exit.cc",
|
|
"../chromium/base/check.cc",
|
|
"../chromium/base/check_op.cc",
|
|
"../chromium/base/debug/alias.cc",
|
|
"../chromium/base/debug/crash_logging.cc",
|
|
"../chromium/base/functional/callback_internal.cc",
|
|
"../chromium/base/lazy_instance_helpers.cc",
|
|
"../chromium/base/location.cc",
|
|
"../chromium/base/memory/ref_counted.cc",
|
|
"../chromium/base/posix/safe_strerror.cc",
|
|
"../chromium/base/strings/string_number_conversions.cc",
|
|
"../chromium/base/strings/string_util.cc",
|
|
"../chromium/base/strings/string_util_constants.cc",
|
|
"../chromium/base/strings/stringprintf.cc",
|
|
"../chromium/base/strings/utf_ostream_operators.cc",
|
|
"../chromium/base/strings/utf_string_conversion_utils.cc",
|
|
"../chromium/base/strings/utf_string_conversions.cc",
|
|
"../chromium/base/synchronization/lock.cc",
|
|
"../chromium/base/synchronization/lock_impl_posix.cc",
|
|
"../chromium/base/threading/platform_thread.cc",
|
|
"../chromium/base/threading/platform_thread_posix.cc",
|
|
"../chromium/base/threading/platform_thread_ref.cc",
|
|
"../chromium/base/threading/thread_collision_warner.cc",
|
|
"../chromium/base/threading/thread_id_name_manager.cc",
|
|
"../chromium/base/threading/thread_local_storage.cc",
|
|
"../chromium/base/threading/thread_local_storage_posix.cc",
|
|
"../chromium/base/threading/thread_restrictions.cc",
|
|
"../chromium/base/time/time.cc",
|
|
"../chromium/base/time/time_now_posix.cc",
|
|
"../chromium/sandbox/linux/bpf_dsl/bpf_dsl.cc",
|
|
"../chromium/sandbox/linux/bpf_dsl/codegen.cc",
|
|
"../chromium/sandbox/linux/bpf_dsl/dump_bpf.cc",
|
|
"../chromium/sandbox/linux/bpf_dsl/policy.cc",
|
|
"../chromium/sandbox/linux/bpf_dsl/policy_compiler.cc",
|
|
"../chromium/sandbox/linux/bpf_dsl/syscall_set.cc",
|
|
"../chromium/sandbox/linux/seccomp-bpf/die.cc",
|
|
"../chromium/sandbox/linux/seccomp-bpf/syscall.cc",
|
|
"/ipc/glue/UtilityProcessSandboxing.cpp",
|
|
"broker/SandboxBrokerCommon.cpp",
|
|
"Sandbox.cpp",
|
|
"SandboxBrokerClient.cpp",
|
|
"SandboxFilter.cpp",
|
|
"SandboxFilterUtil.cpp",
|
|
"SandboxHooks.cpp",
|
|
"SandboxInfo.cpp",
|
|
"SandboxLogging.cpp",
|
|
"SandboxOpenedFiles.cpp",
|
|
"SandboxProfiler.cpp",
|
|
"SandboxReporterClient.cpp",
|
|
]
|
|
|
|
SOURCES += [
|
|
"../chromium/base/strings/safe_sprintf.cc",
|
|
"../chromium/sandbox/linux/seccomp-bpf/trap.cc",
|
|
"../chromium/sandbox/linux/services/syscall_wrappers.cc",
|
|
]
|
|
|
|
SOURCES += [
|
|
"/third_party/abseil-cpp/absl/base/internal/raw_logging.cc",
|
|
"/third_party/abseil-cpp/absl/numeric/int128.cc",
|
|
"/third_party/abseil-cpp/absl/strings/ascii.cc",
|
|
"/third_party/abseil-cpp/absl/strings/charconv.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/charconv_bigint.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/charconv_parse.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/memutil.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/str_format/arg.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/str_format/bind.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/str_format/extension.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/str_format/float_conversion.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/str_format/output.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/str_format/parser.cc",
|
|
"/third_party/abseil-cpp/absl/strings/internal/utf8.cc",
|
|
"/third_party/abseil-cpp/absl/strings/match.cc",
|
|
"/third_party/abseil-cpp/absl/strings/numbers.cc",
|
|
]
|
|
|
|
if CONFIG["CC_TYPE"] in ("clang", "gcc"):
|
|
SOURCES["/third_party/abseil-cpp/absl/strings/numbers.cc"].flags += ["-Wno-comma"]
|
|
|
|
# This copy of SafeSPrintf doesn't need to avoid the Chromium logging
|
|
# dependency like the one in libxul does, but this way the behavior is
|
|
# consistent. See also the comment in SandboxLogging.h.
|
|
SOURCES["../chromium/base/strings/safe_sprintf.cc"].flags += ["-DNDEBUG"]
|
|
|
|
if CONFIG["CC_TYPE"] in ("clang", "gcc"):
|
|
SOURCES["../chromium/sandbox/linux/seccomp-bpf/trap.cc"].flags += [
|
|
"-Wno-unreachable-code-return"
|
|
]
|
|
|
|
if CONFIG["CC_TYPE"] in ("clang", "gcc"):
|
|
CXXFLAGS += ["-Wno-error=stack-protector"]
|
|
SOURCES["../chromium/sandbox/linux/services/syscall_wrappers.cc"].flags += [
|
|
"-Wno-empty-body",
|
|
]
|
|
|
|
# gcc lto likes to put the top level asm in syscall.cc in a different partition
|
|
# from the function using it which breaks the build. Work around that by
|
|
# forcing there to be only one partition.
|
|
for f in CONFIG["OS_CXXFLAGS"]:
|
|
if f.startswith("-flto") and CONFIG["CC_TYPE"] != "clang":
|
|
LDFLAGS += ["--param lto-partitions=1"]
|
|
|
|
DEFINES["NS_NO_XPCOM"] = True
|
|
DisableStlWrapping()
|
|
|
|
LOCAL_INCLUDES += ["/security/sandbox/linux"]
|
|
LOCAL_INCLUDES += ["/security/sandbox/chromium-shim"]
|
|
LOCAL_INCLUDES += ["/security/sandbox/chromium"]
|
|
LOCAL_INCLUDES += [
|
|
"/security/sandbox/chromium-shim/base/allocator/partition_allocator/src"
|
|
]
|
|
LOCAL_INCLUDES += ["/security/sandbox/chromium/base/allocator/partition_allocator/src"]
|
|
LOCAL_INCLUDES += ["/third_party/abseil-cpp"]
|
|
LOCAL_INCLUDES += ["/nsprpub"]
|
|
LOCAL_INCLUDES += ["/mozglue/baseprofiler/core/"]
|
|
LOCAL_INCLUDES += ["/tools/profiler"]
|
|
|
|
if CONFIG["OS_TARGET"] != "Android":
|
|
# Needed for clock_gettime with glibc < 2.17:
|
|
OS_LIBS += [
|
|
"rt",
|
|
]
|
|
|
|
DIRS += [
|
|
"broker",
|
|
"glue",
|
|
"interfaces",
|
|
"launch",
|
|
"reporter",
|
|
]
|
|
|
|
TEST_DIRS += [
|
|
"gtest",
|
|
]
|