2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-10-29 01:54:36 +04:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# 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/.
|
|
|
|
|
2016-10-27 01:57:24 +03:00
|
|
|
SharedLibrary('mozsandbox')
|
|
|
|
|
|
|
|
# Depend on mozglue if and only if it's a shared library;
|
|
|
|
# this needs to match mozglue/build/moz.build:
|
2014-11-25 02:22:13 +03:00
|
|
|
if CONFIG['OS_TARGET'] == 'Android':
|
2014-12-11 03:17:47 +03:00
|
|
|
USE_LIBS += [
|
|
|
|
'mozglue',
|
|
|
|
]
|
2014-08-27 00:54:09 +04:00
|
|
|
|
2013-10-29 01:54:36 +04:00
|
|
|
EXPORTS.mozilla += [
|
|
|
|
'Sandbox.h',
|
2016-10-27 23:06:00 +03:00
|
|
|
'SandboxInfo.h',
|
2013-10-29 01:54:36 +04:00
|
|
|
]
|
|
|
|
|
|
|
|
SOURCES += [
|
2015-01-22 11:37:30 +03:00
|
|
|
'../chromium-shim/base/logging.cpp',
|
2017-03-29 16:23:17 +03:00
|
|
|
'../chromium-shim/base/threading/platform_thread_linux.cpp',
|
2015-02-11 11:22:02 +03:00
|
|
|
'../chromium/base/at_exit.cc',
|
|
|
|
'../chromium/base/callback_internal.cc',
|
|
|
|
'../chromium/base/lazy_instance.cc',
|
|
|
|
'../chromium/base/memory/ref_counted.cc',
|
|
|
|
'../chromium/base/memory/singleton.cc',
|
2015-07-09 13:09:00 +03:00
|
|
|
'../chromium/base/strings/safe_sprintf.cc',
|
2015-02-11 11:22:02 +03:00
|
|
|
'../chromium/base/strings/string16.cc',
|
|
|
|
'../chromium/base/strings/string_piece.cc',
|
|
|
|
'../chromium/base/strings/string_util.cc',
|
|
|
|
'../chromium/base/strings/string_util_constants.cc',
|
|
|
|
'../chromium/base/strings/stringprintf.cc',
|
|
|
|
'../chromium/base/strings/utf_string_conversion_utils.cc',
|
|
|
|
'../chromium/base/strings/utf_string_conversions.cc',
|
|
|
|
'../chromium/base/synchronization/condition_variable_posix.cc',
|
|
|
|
'../chromium/base/synchronization/lock.cc',
|
|
|
|
'../chromium/base/synchronization/lock_impl_posix.cc',
|
|
|
|
'../chromium/base/synchronization/waitable_event_posix.cc',
|
|
|
|
'../chromium/base/third_party/icu/icu_utf.cc',
|
2016-09-06 10:57:21 +03:00
|
|
|
'../chromium/base/threading/platform_thread_internal_posix.cc',
|
2015-02-11 11:22:02 +03:00
|
|
|
'../chromium/base/threading/platform_thread_posix.cc',
|
|
|
|
'../chromium/base/threading/thread_collision_warner.cc',
|
|
|
|
'../chromium/base/threading/thread_id_name_manager.cc',
|
2017-03-29 16:23:17 +03:00
|
|
|
'../chromium/base/threading/thread_local_storage.cc',
|
|
|
|
'../chromium/base/threading/thread_local_storage_posix.cc',
|
2015-02-11 11:22:02 +03:00
|
|
|
'../chromium/base/threading/thread_restrictions.cc',
|
|
|
|
'../chromium/base/time/time.cc',
|
2017-10-26 17:10:41 +03:00
|
|
|
'../chromium/base/time/time_exploded_posix.cc',
|
|
|
|
'../chromium/base/time/time_now_posix.cc',
|
2015-02-11 11:22:02 +03:00
|
|
|
'../chromium/sandbox/linux/bpf_dsl/bpf_dsl.cc',
|
2016-09-06 10:57:21 +03:00
|
|
|
'../chromium/sandbox/linux/bpf_dsl/codegen.cc',
|
2015-02-11 11:22:02 +03:00
|
|
|
'../chromium/sandbox/linux/bpf_dsl/dump_bpf.cc',
|
2015-06-06 01:17:32 +03:00
|
|
|
'../chromium/sandbox/linux/bpf_dsl/policy.cc',
|
2015-02-11 11:22:02 +03:00
|
|
|
'../chromium/sandbox/linux/bpf_dsl/policy_compiler.cc',
|
2016-09-06 10:57:21 +03:00
|
|
|
'../chromium/sandbox/linux/bpf_dsl/syscall_set.cc',
|
2014-08-27 00:54:16 +04:00
|
|
|
'../chromium/sandbox/linux/seccomp-bpf/die.cc',
|
|
|
|
'../chromium/sandbox/linux/seccomp-bpf/syscall.cc',
|
2015-06-06 01:17:35 +03:00
|
|
|
'../chromium/sandbox/linux/seccomp-bpf/trap.cc',
|
2016-09-06 10:57:21 +03:00
|
|
|
'../chromium/sandbox/linux/services/syscall_wrappers.cc',
|
2015-10-08 08:13:08 +03:00
|
|
|
'broker/SandboxBrokerCommon.cpp',
|
2015-04-11 04:05:19 +03:00
|
|
|
'LinuxCapabilities.cpp',
|
2013-10-29 01:54:36 +04:00
|
|
|
'Sandbox.cpp',
|
2015-10-08 08:13:08 +03:00
|
|
|
'SandboxBrokerClient.cpp',
|
2015-04-11 04:05:19 +03:00
|
|
|
'SandboxChroot.cpp',
|
2014-03-20 18:19:42 +04:00
|
|
|
'SandboxFilter.cpp',
|
2015-06-06 01:17:32 +03:00
|
|
|
'SandboxFilterUtil.cpp',
|
2016-11-05 03:16:05 +03:00
|
|
|
'SandboxHooks.cpp',
|
2016-10-27 23:06:00 +03:00
|
|
|
'SandboxInfo.cpp',
|
2015-07-09 13:09:00 +03:00
|
|
|
'SandboxLogging.cpp',
|
2017-01-31 04:49:53 +03:00
|
|
|
'SandboxReporterClient.cpp',
|
2015-04-11 04:05:19 +03:00
|
|
|
'SandboxUtil.cpp',
|
2013-10-29 01:54:36 +04:00
|
|
|
]
|
|
|
|
|
2017-07-07 17:58:50 +03:00
|
|
|
if CONFIG['MOZ_GMP_SANDBOX']:
|
|
|
|
SOURCES += [
|
|
|
|
'SandboxOpenedFiles.cpp',
|
|
|
|
]
|
|
|
|
|
2015-07-09 13:09:00 +03:00
|
|
|
# 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']
|
|
|
|
|
2017-08-06 20:06:36 +03:00
|
|
|
if CONFIG['CLANG_CXX'] or CONFIG['GNU_CXX']:
|
2017-08-10 04:45:16 +03:00
|
|
|
# Keep clang from warning about intentional 'switch' fallthrough in icu_utf.cc:
|
2016-03-04 20:00:40 +03:00
|
|
|
SOURCES['../chromium/base/third_party/icu/icu_utf.cc'].flags += ['-Wno-implicit-fallthrough']
|
2017-08-10 04:45:16 +03:00
|
|
|
SOURCES['../chromium/sandbox/linux/seccomp-bpf/trap.cc'].flags += ['-Wno-unreachable-code-return']
|
2016-03-04 20:00:40 +03:00
|
|
|
|
2016-05-11 10:00:01 +03:00
|
|
|
if CONFIG['GNU_CXX']:
|
|
|
|
CXXFLAGS += ['-Wno-shadow']
|
2016-09-06 10:57:21 +03:00
|
|
|
SOURCES['../chromium/sandbox/linux/services/syscall_wrappers.cc'].flags += [
|
|
|
|
'-Wno-empty-body',
|
|
|
|
]
|
2016-05-11 10:00:01 +03:00
|
|
|
|
2014-09-16 03:46:14 +04:00
|
|
|
# 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.
|
|
|
|
if '-flto' in CONFIG['OS_CXXFLAGS'] and not CONFIG['CLANG_CXX']:
|
|
|
|
LDFLAGS += ['--param lto-partitions=1']
|
|
|
|
|
2014-08-27 00:54:09 +04:00
|
|
|
DEFINES['NS_NO_XPCOM'] = True
|
2017-09-11 21:33:26 +03:00
|
|
|
DisableStlWrapping()
|
2014-08-27 00:54:09 +04:00
|
|
|
|
2016-10-27 23:06:00 +03:00
|
|
|
LOCAL_INCLUDES += ['/security/sandbox/linux']
|
2015-01-22 11:37:30 +03:00
|
|
|
LOCAL_INCLUDES += ['/security/sandbox/chromium-shim']
|
2014-08-27 00:54:16 +04:00
|
|
|
LOCAL_INCLUDES += ['/security/sandbox/chromium']
|
2015-02-11 11:22:02 +03:00
|
|
|
LOCAL_INCLUDES += ['/nsprpub']
|
|
|
|
|
2014-05-21 05:37:53 +04:00
|
|
|
|
2014-08-27 00:54:09 +04:00
|
|
|
if CONFIG['OS_TARGET'] != 'Android':
|
|
|
|
# Needed for clock_gettime with glibc < 2.17:
|
|
|
|
OS_LIBS += [
|
|
|
|
'rt',
|
|
|
|
]
|
2013-10-29 01:54:36 +04:00
|
|
|
|
2014-08-27 00:54:09 +04:00
|
|
|
DIRS += [
|
2015-10-08 08:13:08 +03:00
|
|
|
'broker',
|
2014-08-27 00:54:09 +04:00
|
|
|
'glue',
|
2017-01-31 04:50:41 +03:00
|
|
|
'interfaces',
|
2017-10-07 02:15:46 +03:00
|
|
|
'launch',
|
2017-01-31 04:49:53 +03:00
|
|
|
'reporter',
|
2015-04-25 03:36:08 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
TEST_DIRS += [
|
2015-04-11 04:05:19 +03:00
|
|
|
'gtest',
|
2014-08-27 00:54:09 +04:00
|
|
|
]
|