security/sandbox/linux/moz.build
author Bob Owen <bobowencode@gmail.com>
Thu, 22 Jan 2015 08:37:30 +0000
changeset 253891 43f1f9eef449ef029ab5b2d54552e3de4203c2a6
parent 253890 4ccaf5ae9ced866e2670ec134402709283184c27
child 253895 b7f4dd2f128b52c454fa42f2de845beed11cb094
permissions -rw-r--r--
Bug 1102215: Move security/sandbox/chromium/base/shim/ to new directory security/sandbox/chromium-shim/ r=ted

# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# 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/.

FAIL_ON_WARNINGS = True

if CONFIG['OS_TARGET'] == 'Android':
    SharedLibrary('mozsandbox')
    USE_LIBS += [
        'mozglue',
    ]
else:
    Library('mozsandbox')

EXPORTS.mozilla += [
    'Sandbox.h',
]

SOURCES += [
    '../chromium-shim/base/logging.cpp',
    '../chromium/sandbox/linux/seccomp-bpf/basicblock.cc',
    '../chromium/sandbox/linux/seccomp-bpf/codegen.cc',
    '../chromium/sandbox/linux/seccomp-bpf/die.cc',
    '../chromium/sandbox/linux/seccomp-bpf/syscall.cc',
    'Sandbox.cpp',
    'SandboxAssembler.cpp',
    'SandboxFilter.cpp',
]

# 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']

DEFINES['NS_NO_XPCOM'] = True
DISABLE_STL_WRAPPING = True

LOCAL_INCLUDES += ['/security/sandbox/chromium-shim']
LOCAL_INCLUDES += ['/security/sandbox/chromium']

if CONFIG['OS_TARGET'] != 'Android':
    # Needed for clock_gettime with glibc < 2.17:
    OS_LIBS += [
        'rt',
    ]

DIRS += [
    'common',
    'glue',
]