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