OLD | NEW |
---|---|
1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/nacl/config.gni") | 5 import("//build/config/nacl/config.gni") |
6 | 6 |
7 # Native Client Definitions | 7 # Native Client Definitions |
8 config("nacl_defines") { | 8 config("nacl_defines") { |
9 if (is_linux || is_android || is_nacl) { | 9 if (is_linux || is_android || is_nacl) { |
10 defines = [ | 10 defines = [ |
(...skipping 20 matching lines...) Expand all Loading... | |
31 source_set("nacl_base") { | 31 source_set("nacl_base") { |
32 public_configs = [ ":nacl_defines" ] | 32 public_configs = [ ":nacl_defines" ] |
33 if (current_os == "nacl") { | 33 if (current_os == "nacl") { |
34 public_configs += [ ":nexe_defines" ] | 34 public_configs += [ ":nexe_defines" ] |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 config("compiler") { | 38 config("compiler") { |
39 configs = [] | 39 configs = [] |
40 cflags = [] | 40 cflags = [] |
41 ldflags = [] | |
41 | 42 |
42 if (is_clang && current_cpu != "pnacl") { | 43 if (is_clang && current_cpu != "pnacl") { |
43 # -no-integrated-as is the default in nacl-clang for historical | 44 # -no-integrated-as is the default in nacl-clang for historical |
44 # compatibility with inline assembly code and so forth. But there | 45 # compatibility with inline assembly code and so forth. But there |
45 # are no such cases in Chromium code, and -integrated-as is nicer in | 46 # are no such cases in Chromium code, and -integrated-as is nicer in |
46 # general. Moreover, the IRT must be built using LLVM's assembler | 47 # general. Moreover, the IRT must be built using LLVM's assembler |
47 # on x86-64 to preserve sandbox base address hiding. Use it | 48 # on x86-64 to preserve sandbox base address hiding. Use it |
48 # everywhere for consistency (and possibly quicker builds). | 49 # everywhere for consistency (and possibly quicker builds). |
49 cflags += [ "-integrated-as" ] | 50 cflags += [ "-integrated-as" ] |
50 } | 51 } |
52 if (is_nacl_nonsfi) { | |
53 cflags += [ | |
54 "--pnacl-allow-native", | |
Mark Seaborn
2015/10/22 21:48:30
Is there a reason that some of these flags are in
Petr Hosek
2015/10/23 03:01:15
Yes, I tried to follow the existing conventions.
| |
55 "--pnacl-allow-translate", | |
56 ] | |
57 ldflags += [ "--pnacl-allow-native" ] | |
58 include_dirs = [ "//native_client/src/public/linux_syscalls" ] | |
59 } | |
51 | 60 |
52 asmflags = cflags | 61 asmflags = cflags |
53 } | 62 } |
54 | 63 |
55 config("compiler_codegen") { | 64 config("compiler_codegen") { |
56 cflags = [] | 65 cflags = [] |
57 | 66 |
58 if (is_nacl_irt) { | 67 if (is_nacl_irt) { |
59 cflags += [ | 68 cflags += [ |
60 # A debugger should be able to unwind IRT call frames. This is | 69 # A debugger should be able to unwind IRT call frames. This is |
(...skipping 25 matching lines...) Expand all Loading... | |
86 "-Os", | 95 "-Os", |
87 | 96 |
88 # These are omitted from non-IRT libraries to keep the libraries | 97 # These are omitted from non-IRT libraries to keep the libraries |
89 # themselves small. | 98 # themselves small. |
90 "-ffunction-sections", | 99 "-ffunction-sections", |
91 "-fdata-sections", | 100 "-fdata-sections", |
92 ] | 101 ] |
93 | 102 |
94 ldflags = [ "-Wl,--gc-sections" ] | 103 ldflags = [ "-Wl,--gc-sections" ] |
95 } | 104 } |
OLD | NEW |