diff options
author | Torne (Richard Coles) <torne@google.com> | 2013-09-12 12:10:22 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2013-09-12 12:10:22 +0100 |
commit | 58537e28ecd584eab876aee8be7156509866d23a (patch) | |
tree | 8988984e52090aaadf33cff139d7dd212cd13656 /sandbox | |
parent | 0a1b11dee8e5cb2520121c300858fea6138e3c54 (diff) | |
download | chromium_org-58537e28ecd584eab876aee8be7156509866d23a.tar.gz |
Merge from Chromium at DEPS revision 222756
This commit was generated by merge_to_master.py.
Change-Id: I40d7f32f195f328f005f230ea80d07092d48040e
Diffstat (limited to 'sandbox')
19 files changed, 159 insertions, 31 deletions
diff --git a/sandbox/linux/seccomp-bpf/die.cc b/sandbox/linux/seccomp-bpf/die.cc index 4962c4d30b..dfc59a50e7 100644 --- a/sandbox/linux/seccomp-bpf/die.cc +++ b/sandbox/linux/seccomp-bpf/die.cc @@ -55,6 +55,13 @@ void Die::SandboxDie(const char *msg, const char *file, int line) { ExitGroup(); } +void Die::RawSandboxDie(const char *msg) { + if (!msg) + msg = ""; + RAW_LOG(FATAL, msg); + ExitGroup(); +} + void Die::SandboxInfo(const char *msg, const char *file, int line) { if (!suppress_info_) { #if defined(SECCOMP_BPF_STANDALONE) diff --git a/sandbox/linux/seccomp-bpf/die.h b/sandbox/linux/seccomp-bpf/die.h index f15f10877e..7c95997c9c 100644 --- a/sandbox/linux/seccomp-bpf/die.h +++ b/sandbox/linux/seccomp-bpf/die.h @@ -13,9 +13,13 @@ namespace playground2 { class Die { public: // This is the main API for using this file. Prints a error message and - // exits with a fatal error. + // exits with a fatal error. This is not async-signal safe. #define SANDBOX_DIE(m) playground2::Die::SandboxDie(m, __FILE__, __LINE__) + // An async signal safe version of the same API. Won't print the filename + // and line numbers. + #define RAW_SANDBOX_DIE(m) playground2::Die::RawSandboxDie(m) + // Adds an informational message to the log file or stderr as appropriate. #define SANDBOX_INFO(m) playground2::Die::SandboxInfo(m, __FILE__, __LINE__) @@ -31,6 +35,8 @@ class Die { static void SandboxDie(const char *msg, const char *file, int line) __attribute__((noreturn)); + static void RawSandboxDie(const char *msg) __attribute__((noreturn)); + // This method gets called by SANDBOX_INFO(). There is normally no reason // to call it directly unless you are defining your own logging macro. static void SandboxInfo(const char *msg, const char *file, int line); diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc index 78a78ee5d0..499c81b535 100644 --- a/sandbox/linux/seccomp-bpf/trap.cc +++ b/sandbox/linux/seccomp-bpf/trap.cc @@ -61,6 +61,14 @@ void SetIsInSigHandler() { } } +bool IsDefaultSignalAction(const struct sigaction& sa) { + if (sa.sa_flags & SA_SIGINFO || + sa.sa_handler != SIG_DFL) { + return false; + } + return true; +} + } // namespace namespace playground2 { @@ -74,10 +82,16 @@ Trap::Trap() struct sigaction sa = { }; sa.sa_sigaction = SigSysAction; sa.sa_flags = SA_SIGINFO | SA_NODEFER; - if (sigaction(SIGSYS, &sa, NULL) < 0) { + struct sigaction old_sa; + if (sigaction(SIGSYS, &sa, &old_sa) < 0) { SANDBOX_DIE("Failed to configure SIGSYS handler"); } + if (!IsDefaultSignalAction(old_sa)) { + // TODO(jln): make this FATAL, at least in DEBUG mode. + LOG(ERROR) << "Existing signal handler when trying to install SIGSYS"; + } + // Unmask SIGSYS sigset_t mask; if (sigemptyset(&mask) || @@ -104,33 +118,31 @@ Trap *Trap::GetInstance() { void Trap::SigSysAction(int nr, siginfo_t *info, void *void_context) { if (!global_trap_) { - SANDBOX_DIE("This can't happen. Found no global singleton instance " - "for Trap() handling."); + RAW_SANDBOX_DIE("This can't happen. Found no global singleton instance " + "for Trap() handling."); } global_trap_->SigSys(nr, info, void_context); } void Trap::SigSys(int nr, siginfo_t *info, void *void_context) { + // Signal handlers should always preserve "errno". Otherwise, we could + // trigger really subtle bugs. + const int old_errno = errno; + // Various sanity checks to make sure we actually received a signal // triggered by a BPF filter. If something else triggered SIGSYS // (e.g. kill()), there is really nothing we can do with this signal. if (nr != SIGSYS || info->si_code != SYS_SECCOMP || !void_context || info->si_errno <= 0 || static_cast<size_t>(info->si_errno) > trap_array_size_) { - // SANDBOX_DIE() can call LOG(FATAL). This is not normally async-signal - // safe and can lead to bugs. We should eventually implement a different - // logging and reporting mechanism that is safe to be called from - // the sigSys() handler. - // TODO: If we feel confident that our code otherwise works correctly, we - // could actually make an argument that spurious SIGSYS should - // just get silently ignored. TBD - SANDBOX_DIE("Unexpected SIGSYS received."); + // ATI drivers seem to send SIGSYS, so this cannot be FATAL. + // See crbug.com/178166. + // TODO(jln): add a DCHECK or move back to FATAL. + RAW_LOG(ERROR, "Unexpected SIGSYS received."); + errno = old_errno; + return; } - // Signal handlers should always preserve "errno". Otherwise, we could - // trigger really subtle bugs. - const int old_errno = errno; - // Obtain the signal context. This, most notably, gives us access to // all CPU registers at the time of the signal. ucontext_t *ctx = reinterpret_cast<ucontext_t *>(void_context); @@ -145,14 +157,19 @@ void Trap::SigSys(int nr, siginfo_t *info, void *void_context) { if (sigsys.ip != reinterpret_cast<void *>(SECCOMP_IP(ctx)) || sigsys.nr != static_cast<int>(SECCOMP_SYSCALL(ctx)) || sigsys.arch != SECCOMP_ARCH) { - SANDBOX_DIE("Sanity checks are failing after receiving SIGSYS."); + // TODO(markus): + // SANDBOX_DIE() can call LOG(FATAL). This is not normally async-signal + // safe and can lead to bugs. We should eventually implement a different + // logging and reporting mechanism that is safe to be called from + // the sigSys() handler. + RAW_SANDBOX_DIE("Sanity checks are failing after receiving SIGSYS."); } intptr_t rc; if (has_unsafe_traps_ && GetIsInSigHandler(ctx)) { errno = old_errno; if (sigsys.nr == __NR_clone) { - SANDBOX_DIE("Cannot call clone() from an UnsafeTrap() handler."); + RAW_SANDBOX_DIE("Cannot call clone() from an UnsafeTrap() handler."); } rc = SandboxSyscall(sigsys.nr, SECCOMP_PARM1(ctx), SECCOMP_PARM2(ctx), diff --git a/sandbox/linux/seccomp-bpf/trap.h b/sandbox/linux/seccomp-bpf/trap.h index db29757c0d..2a4c6ed713 100644 --- a/sandbox/linux/seccomp-bpf/trap.h +++ b/sandbox/linux/seccomp-bpf/trap.h @@ -90,7 +90,10 @@ class Trap { static Trap *GetInstance(); static void SigSysAction(int nr, siginfo_t *info, void *void_context); - void SigSys(int nr, siginfo_t *info, void *void_context); + // Make sure that SigSys is not inlined in order to get slightly better crash + // dumps. + void SigSys(int nr, siginfo_t *info, void *void_context) + __attribute__ ((noinline)); ErrorCode MakeTrapImpl(TrapFnc fnc, const void *aux, bool safe); bool SandboxDebuggingAllowedByUser() const; diff --git a/sandbox/sandbox_services.target.darwin-arm.mk b/sandbox/sandbox_services.target.darwin-arm.mk index 94dcc268fb..fc6a899d77 100644 --- a/sandbox/sandbox_services.target.darwin-arm.mk +++ b/sandbox/sandbox_services.target.darwin-arm.mk @@ -61,6 +61,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -73,6 +74,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -142,6 +144,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -154,6 +157,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -206,7 +210,9 @@ LOCAL_LDFLAGS_Debug := \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ -Wl,--icf=safe \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -225,7 +231,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--icf=safe \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/sandbox_services.target.darwin-mips.mk b/sandbox/sandbox_services.target.darwin-mips.mk index 70c3000381..d3affed452 100644 --- a/sandbox/sandbox_services.target.darwin-mips.mk +++ b/sandbox/sandbox_services.target.darwin-mips.mk @@ -60,6 +60,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -72,6 +73,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -140,6 +142,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -152,6 +155,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -202,7 +206,9 @@ LOCAL_LDFLAGS_Debug := \ -nostdlib \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -219,7 +225,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--exclude-libs=ALL \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/sandbox_services.target.darwin-x86.mk b/sandbox/sandbox_services.target.darwin-x86.mk index d559143389..be4050313c 100644 --- a/sandbox/sandbox_services.target.darwin-x86.mk +++ b/sandbox/sandbox_services.target.darwin-x86.mk @@ -63,6 +63,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -75,6 +76,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -147,6 +149,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -159,6 +162,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -208,7 +212,9 @@ LOCAL_LDFLAGS_Debug := \ -nostdlib \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -225,7 +231,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--exclude-libs=ALL \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/sandbox_services.target.linux-arm.mk b/sandbox/sandbox_services.target.linux-arm.mk index 94dcc268fb..fc6a899d77 100644 --- a/sandbox/sandbox_services.target.linux-arm.mk +++ b/sandbox/sandbox_services.target.linux-arm.mk @@ -61,6 +61,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -73,6 +74,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -142,6 +144,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -154,6 +157,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -206,7 +210,9 @@ LOCAL_LDFLAGS_Debug := \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ -Wl,--icf=safe \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -225,7 +231,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--icf=safe \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/sandbox_services.target.linux-mips.mk b/sandbox/sandbox_services.target.linux-mips.mk index 70c3000381..d3affed452 100644 --- a/sandbox/sandbox_services.target.linux-mips.mk +++ b/sandbox/sandbox_services.target.linux-mips.mk @@ -60,6 +60,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -72,6 +73,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -140,6 +142,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -152,6 +155,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -202,7 +206,9 @@ LOCAL_LDFLAGS_Debug := \ -nostdlib \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -219,7 +225,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--exclude-libs=ALL \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/sandbox_services.target.linux-x86.mk b/sandbox/sandbox_services.target.linux-x86.mk index d559143389..be4050313c 100644 --- a/sandbox/sandbox_services.target.linux-x86.mk +++ b/sandbox/sandbox_services.target.linux-x86.mk @@ -63,6 +63,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -75,6 +76,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -147,6 +149,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -159,6 +162,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -208,7 +212,9 @@ LOCAL_LDFLAGS_Debug := \ -nostdlib \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -225,7 +231,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--exclude-libs=ALL \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/sandbox_services_headers.target.darwin-arm.mk b/sandbox/sandbox_services_headers.target.darwin-arm.mk index bf45355727..6119ec3a09 100644 --- a/sandbox/sandbox_services_headers.target.darwin-arm.mk +++ b/sandbox/sandbox_services_headers.target.darwin-arm.mk @@ -60,6 +60,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -72,6 +73,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -139,6 +141,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -151,6 +154,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ diff --git a/sandbox/sandbox_services_headers.target.darwin-x86.mk b/sandbox/sandbox_services_headers.target.darwin-x86.mk index c4917ea981..27bfae5041 100644 --- a/sandbox/sandbox_services_headers.target.darwin-x86.mk +++ b/sandbox/sandbox_services_headers.target.darwin-x86.mk @@ -62,6 +62,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -74,6 +75,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -144,6 +146,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -156,6 +159,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ diff --git a/sandbox/sandbox_services_headers.target.linux-arm.mk b/sandbox/sandbox_services_headers.target.linux-arm.mk index bf45355727..6119ec3a09 100644 --- a/sandbox/sandbox_services_headers.target.linux-arm.mk +++ b/sandbox/sandbox_services_headers.target.linux-arm.mk @@ -60,6 +60,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -72,6 +73,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -139,6 +141,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -151,6 +154,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ diff --git a/sandbox/sandbox_services_headers.target.linux-x86.mk b/sandbox/sandbox_services_headers.target.linux-x86.mk index c4917ea981..27bfae5041 100644 --- a/sandbox/sandbox_services_headers.target.linux-x86.mk +++ b/sandbox/sandbox_services_headers.target.linux-x86.mk @@ -62,6 +62,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -74,6 +75,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -144,6 +146,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -156,6 +159,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ diff --git a/sandbox/seccomp_bpf.target.darwin-arm.mk b/sandbox/seccomp_bpf.target.darwin-arm.mk index b42c8589f0..1dbe5e7a27 100644 --- a/sandbox/seccomp_bpf.target.darwin-arm.mk +++ b/sandbox/seccomp_bpf.target.darwin-arm.mk @@ -70,6 +70,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -82,6 +83,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -150,6 +152,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -162,6 +165,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -213,7 +217,9 @@ LOCAL_LDFLAGS_Debug := \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ -Wl,--icf=safe \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -232,7 +238,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--icf=safe \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/seccomp_bpf.target.darwin-x86.mk b/sandbox/seccomp_bpf.target.darwin-x86.mk index fc0c1b07f5..e90b2dadae 100644 --- a/sandbox/seccomp_bpf.target.darwin-x86.mk +++ b/sandbox/seccomp_bpf.target.darwin-x86.mk @@ -72,6 +72,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -84,6 +85,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -155,6 +157,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -167,6 +170,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -215,7 +219,9 @@ LOCAL_LDFLAGS_Debug := \ -nostdlib \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -232,7 +238,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--exclude-libs=ALL \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/seccomp_bpf.target.linux-arm.mk b/sandbox/seccomp_bpf.target.linux-arm.mk index b42c8589f0..1dbe5e7a27 100644 --- a/sandbox/seccomp_bpf.target.linux-arm.mk +++ b/sandbox/seccomp_bpf.target.linux-arm.mk @@ -70,6 +70,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -82,6 +83,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -150,6 +152,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -162,6 +165,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -213,7 +217,9 @@ LOCAL_LDFLAGS_Debug := \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ -Wl,--icf=safe \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -232,7 +238,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--icf=safe \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/seccomp_bpf.target.linux-x86.mk b/sandbox/seccomp_bpf.target.linux-x86.mk index fc0c1b07f5..e90b2dadae 100644 --- a/sandbox/seccomp_bpf.target.linux-x86.mk +++ b/sandbox/seccomp_bpf.target.linux-x86.mk @@ -72,6 +72,7 @@ MY_CFLAGS_Debug := \ MY_DEFS_Debug := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -84,6 +85,7 @@ MY_DEFS_Debug := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -155,6 +157,7 @@ MY_CFLAGS_Release := \ MY_DEFS_Release := \ '-DANGLE_DX11' \ + '-DWTF_VECTOR_INITIAL_SIZE=16' \ '-D_FILE_OFFSET_BITS=64' \ '-DNO_TCMALLOC' \ '-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY' \ @@ -167,6 +170,7 @@ MY_DEFS_Release := \ '-DENABLE_GPU=1' \ '-DUSE_OPENSSL=1' \ '-DENABLE_EGLIMAGE=1' \ + '-DCLD_VERSION=1' \ '-D__STDC_CONSTANT_MACROS' \ '-D__STDC_FORMAT_MACROS' \ '-DANDROID' \ @@ -215,7 +219,9 @@ LOCAL_LDFLAGS_Debug := \ -nostdlib \ -Wl,--no-undefined \ -Wl,--exclude-libs=ALL \ + -Wl,--fatal-warnings \ -Wl,--gc-sections \ + -Wl,--warn-shared-textrel \ -Wl,-O1 \ -Wl,--as-needed @@ -232,7 +238,9 @@ LOCAL_LDFLAGS_Release := \ -Wl,--exclude-libs=ALL \ -Wl,-O1 \ -Wl,--as-needed \ - -Wl,--gc-sections + -Wl,--gc-sections \ + -Wl,--fatal-warnings \ + -Wl,--warn-shared-textrel LOCAL_LDFLAGS := $(LOCAL_LDFLAGS_$(GYP_CONFIGURATION)) diff --git a/sandbox/win/src/handle_inheritance_test.cc b/sandbox/win/src/handle_inheritance_test.cc index 5523a6c64a..6dceee6d23 100644 --- a/sandbox/win/src/handle_inheritance_test.cc +++ b/sandbox/win/src/handle_inheritance_test.cc @@ -40,8 +40,7 @@ TEST(HandleInheritanceTests, TestStdoutInheritance) { EXPECT_TRUE(::CloseHandle(file_handle)); std::string data; - EXPECT_TRUE(file_util::ReadFileToString(base::FilePath(temp_file_name), - &data)); + EXPECT_TRUE(base::ReadFileToString(base::FilePath(temp_file_name), &data)); // Redirection uses a feature that was added in Windows Vista. if (base::win::GetVersion() >= base::win::VERSION_VISTA) { EXPECT_EQ("Example output to stdout\r\n", data); |