Chromium Code Reviews| Index: build/config/nacl/BUILD.gn |
| diff --git a/build/config/nacl/BUILD.gn b/build/config/nacl/BUILD.gn |
| index d2643b85e41bfe48415436c510c359d64e098d19..5bc6f1792c040ccdd8bde465f524ef753a12abe6 100644 |
| --- a/build/config/nacl/BUILD.gn |
| +++ b/build/config/nacl/BUILD.gn |
| @@ -2,6 +2,8 @@ |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| +import("config.gni") |
|
Dirk Pranke
2015/10/09 19:25:53
imports should always be src-relative paths, i.e.,
Roland McGrath
2015/10/09 20:35:26
Done.
|
| + |
| # Native Client Definitions |
| config("nacl_defines") { |
| defines = [ |
| @@ -32,3 +34,62 @@ source_set("nacl_base") { |
| public_configs += [ ":nexe_defines" ] |
| } |
| } |
| + |
| +config("compiler") { |
| + configs = [] |
| + cflags = [] |
| + |
| + if (is_clang) { |
| + # -no-integrated-as is the default in nacl-clang for historical |
| + # compatibility with inline assembly code and so forth. But there |
| + # are no such cases in Chromium code, and -integrated-as is nicer in |
| + # general. Moreover, the IRT must be built using LLVM's assembler |
| + # on x86-64 to preserve sandbox base address hiding. Use it |
| + # everywhere for consistency (and possibly quicker builds). |
| + cflags += [ "-integrated-as" ] |
| + } |
| + |
| + asmflags = cflags |
| +} |
| + |
| +config("compiler_codegen") { |
| + cflags = [] |
| + |
| + if (is_nacl_irt) { |
| + cflags += [ |
| + # A debugger should be able to unwind IRT call frames. This is |
| + # the default behavior on x86-64 and when compiling C++ with |
| + # exceptions enabled; the change is for the benefit of x86-32 C. |
| + # The frame pointer is unnecessary when unwind tables are used. |
| + "-fasynchronous-unwind-tables", |
| + "-fomit-frame-pointer", |
| + ] |
| + |
| + if (current_cpu == "x86") { |
| + # The x86-32 IRT needs to be callable with an under-aligned |
| + # stack; so we disable SSE instructions, which can fault on |
| + # misaligned addresses. See |
| + # https://code.google.com/p/nativeclient/issues/detail?id=3935 |
| + cflags += [ |
| + "-mstackrealign", |
| + "-mno-sse", |
| + ] |
| + } |
| + } |
| + |
| + asmflags = cflags |
| +} |
| + |
| +config("irt_optimize") { |
| + cflags = [ |
| + # Optimize for space, keep the IRT nexe small. |
| + "-Os", |
| + |
| + # These are omitted from non-IRT libraries to keep the libraries |
| + # themselves small. |
| + "-ffunction-sections", |
| + "-fdata-sections", |
| + ] |
| + |
| + ldflags = [ "-Wl,--gc-sections" ] |
| +} |