Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(858)

Unified Diff: build/config/nacl/BUILD.gn

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/mips.gni ('k') | build/config/nacl/config.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/nacl/BUILD.gn
diff --git a/build/config/nacl/BUILD.gn b/build/config/nacl/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..452a68a0adc1347056480b5f835abf0ad95ce555
--- /dev/null
+++ b/build/config/nacl/BUILD.gn
@@ -0,0 +1,94 @@
+# Copyright (c) 2014 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/nacl/config.gni")
+
+# Native Client Definitions
+config("nacl_defines") {
+ defines = [
+ "_DEFAULT_SOURCE=1",
+ "_BSD_SOURCE=1",
+ "_POSIX_C_SOURCE=199506",
+ "_XOPEN_SOURCE=600",
+ "_GNU_SOURCE=1",
+ "__STDC_LIMIT_MACROS=1",
+ ]
+}
+
+config("nexe_defines") {
+ defines = [
+ "DYNAMIC_ANNOTATIONS_ENABLED=1",
+ "DYNAMIC_ANNOTATIONS_PREFIX=NACL_",
+ ]
+}
+
+# The base target that all targets in the NaCl build should depend on.
+# This allows configs to be modified for everything in the NaCl build, even when
+# the NaCl build is composed into the Chrome build. (GN has no functionality to
+# add flags to everythin in //native_client, having a base target works around
+# that limitation.)
+source_set("nacl_base") {
+ public_configs = [ ":nacl_defines" ]
+ if (current_os == "nacl") {
+ public_configs += [ ":nexe_defines" ]
+ }
+}
+
+config("compiler") {
+ cflags = []
+
+ if (is_clang && current_cpu != "pnacl") {
+ # -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" ]
+}
« no previous file with comments | « build/config/mips.gni ('k') | build/config/nacl/config.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698