Bug 1313808 - Part 2: Move SandboxEarlyInit call into libxul. r=glandium,tedd

MozReview-Commit-ID: 2EY0wadYhO0

--HG--
extra : rebase_source : 4773cbff758054863293d1fa239c3246eca6dc36
This commit is contained in:
Jed Davis 2016-11-08 14:40:44 -07:00
parent 8f3f056572
commit f3cdcb35e5
4 changed files with 5 additions and 34 deletions

View File

@ -63,17 +63,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'xul.dll',
]
if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] in ('Linux', 'Android'):
USE_LIBS += [
'mozsandbox',
]
# 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']
if CONFIG['MOZ_SANDBOX'] and CONFIG['OS_TARGET'] == 'Darwin':
# For sandbox includes and the include dependencies those have
LOCAL_INCLUDES += [

View File

@ -16,15 +16,4 @@ LOCAL_INCLUDES += [
'/xpcom/base',
]
if CONFIG['MOZ_SANDBOX']:
USE_LIBS += [
'mozsandbox',
]
# 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']
LDFLAGS += ['-pie']

View File

@ -27,11 +27,6 @@
#include "mozilla/sandboxing/sandboxLogging.h"
#endif
#if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
#include "mozilla/Sandbox.h"
#include "mozilla/SandboxInfo.h"
#endif
#ifdef MOZ_WIDGET_GONK
# include <sys/time.h>
# include <sys/resource.h>
@ -139,13 +134,6 @@ content_process_main(int argc, char* argv[])
XRE_SetProcessType(argv[--argc]);
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
// This has to happen while we're still single-threaded, and on
// B2G that means before the Android Binder library is
// initialized.
mozilla::SandboxEarlyInit(XRE_GetProcessType());
#endif
#ifdef MOZ_WIDGET_GONK
// This creates a ThreadPool for binder ipc. A ThreadPool is necessary to
// receive binder calls, though not necessary to send binder calls.

View File

@ -361,6 +361,11 @@ XRE_InitChildProcess(int aArgc,
NS_ENSURE_ARG_POINTER(aArgv[0]);
MOZ_ASSERT(aChildData);
#if defined(XP_LINUX) && defined(MOZ_SANDBOX)
// This has to happen while we're still single-threaded.
mozilla::SandboxEarlyInit(XRE_GetProcessType());
#endif
#ifdef MOZ_JPROF
// Call the code to install our handler
setupProfilingStuff();