OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium 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/sanitizers/sanitizers.gni") |
5 import("//build/config/sysroot.gni") | 6 import("//build/config/sysroot.gni") |
| 7 import("//build/toolchain/toolchain.gni") |
6 | 8 |
7 assert(is_posix) | 9 assert(is_posix) |
8 | 10 |
| 11 # This is included by reference in the //build/config/compiler config that |
| 12 # is applied to all Posix targets. It is here to separate out the logic that is |
| 13 # Posix-only. Note that this is in addition to an OS-specific variant of this |
| 14 # config. |
| 15 config("compiler") { |
| 16 if ((allow_posix_link_time_opt || is_cfi) && !is_nacl) { |
| 17 arflags = [ |
| 18 "--plugin", |
| 19 rebase_path("//third_party/llvm-build/Release+Asserts/lib/LLVMgold.so", |
| 20 root_build_dir), |
| 21 ] |
| 22 } |
| 23 } |
| 24 |
9 # This is included by reference in the //build/config/compiler:runtime_library | 25 # This is included by reference in the //build/config/compiler:runtime_library |
10 # config that is applied to all targets. It is here to separate out the logic | 26 # config that is applied to all targets. It is here to separate out the logic |
11 # that is Posix-only. Please see that target for advice on what should go in | 27 # that is Posix-only. Please see that target for advice on what should go in |
12 # :runtime_library vs. :compiler. | 28 # :runtime_library vs. :compiler. |
13 config("runtime_library") { | 29 config("runtime_library") { |
14 if (!is_mac && !is_ios && sysroot != "") { | 30 if (!is_mac && !is_ios && sysroot != "") { |
15 # Pass the sysroot to all C compiler variants, the assembler, and linker. | 31 # Pass the sysroot to all C compiler variants, the assembler, and linker. |
16 cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ] | 32 cflags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ] |
17 asmflags = cflags | 33 asmflags = cflags |
18 ldflags = cflags | 34 ldflags = cflags |
19 | 35 |
20 # Need to get some linker flags out of the sysroot. | 36 # Need to get some linker flags out of the sysroot. |
21 ldflags += [ exec_script("sysroot_ld_path.py", | 37 ldflags += [ exec_script("sysroot_ld_path.py", |
22 [ | 38 [ |
23 rebase_path("//build/linux/sysroot_ld_path.sh", | 39 rebase_path("//build/linux/sysroot_ld_path.sh", |
24 root_build_dir), | 40 root_build_dir), |
25 sysroot, | 41 sysroot, |
26 ], | 42 ], |
27 "value") ] | 43 "value") ] |
28 } | 44 } |
29 } | 45 } |
OLD | NEW |