OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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/sysroot.gni") # Imports android/config.gni. | 5 import("//build/config/sysroot.gni") # Imports android/config.gni. |
6 import("//build/toolchain/ccache.gni") | |
7 import("//build/toolchain/goma.gni") | |
8 import("//build/toolchain/gcc_toolchain.gni") | 6 import("//build/toolchain/gcc_toolchain.gni") |
9 | 7 |
10 # The Android GCC toolchains share most of the same parameters, so we have this | 8 # The Android GCC toolchains share most of the same parameters, so we have this |
11 # wrapper around gcc_toolchain to avoid duplication of logic. | 9 # wrapper around gcc_toolchain to avoid duplication of logic. |
12 # | 10 # |
13 # Parameters: | 11 # Parameters: |
14 # - android_ndk_sysroot | 12 # - android_ndk_sysroot |
15 # Sysroot for this architecture. | 13 # Sysroot for this architecture. |
16 # - android_ndk_lib_dir | 14 # - android_ndk_lib_dir |
17 # Subdirectory inside of android_ndk_sysroot where libs go. | 15 # Subdirectory inside of android_ndk_sysroot where libs go. |
(...skipping 10 matching lines...) Expand all Loading... |
28 | 26 |
29 libs_section_prefix = "$android_ndk_lib/crtbegin_dynamic.o" | 27 libs_section_prefix = "$android_ndk_lib/crtbegin_dynamic.o" |
30 libs_section_postfix = "$android_ndk_lib/crtend_android.o" | 28 libs_section_postfix = "$android_ndk_lib/crtend_android.o" |
31 | 29 |
32 solink_libs_section_prefix = "$android_ndk_lib/crtbegin_so.o" | 30 solink_libs_section_prefix = "$android_ndk_lib/crtbegin_so.o" |
33 solink_libs_section_postfix = "$android_ndk_lib/crtend_so.o" | 31 solink_libs_section_postfix = "$android_ndk_lib/crtend_so.o" |
34 | 32 |
35 # The tools should be run relative to the build dir. | 33 # The tools should be run relative to the build dir. |
36 tool_prefix = rebase_path(invoker.tool_prefix, root_build_dir) | 34 tool_prefix = rebase_path(invoker.tool_prefix, root_build_dir) |
37 | 35 |
38 if (use_goma) { | |
39 assert(!use_ccache, "Goma and ccache can't be used together.") | |
40 compiler_prefix = "$goma_dir/gomacc " | |
41 } else if (use_ccache) { | |
42 compiler_prefix = "ccache " | |
43 } else { | |
44 compiler_prefix = "" | |
45 } | |
46 | |
47 is_clang = invoker.is_clang | 36 is_clang = invoker.is_clang |
48 if (is_clang) { | 37 if (is_clang) { |
49 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | 38 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
50 root_build_dir) | 39 root_build_dir) |
51 cc = "${compiler_prefix}$prefix/clang" | 40 cc = "$prefix/clang" |
52 cxx = "${compiler_prefix}$prefix/clang++" | 41 cxx = "$prefix/clang++" |
53 } else { | 42 } else { |
54 cc = "${compiler_prefix}${tool_prefix}gcc" | 43 cc = "${tool_prefix}gcc" |
55 cxx = "${compiler_prefix}${tool_prefix}g++" | 44 cxx = "${tool_prefix}g++" |
56 } | 45 } |
57 ar = tool_prefix + "ar" | 46 ar = tool_prefix + "ar" |
58 ld = cxx | 47 ld = cxx |
59 readelf = compiler_prefix + tool_prefix + "readelf" | 48 readelf = tool_prefix + "readelf" |
60 nm = compiler_prefix + tool_prefix + "nm" | 49 nm = tool_prefix + "nm" |
61 strip = "${tool_prefix}strip" | 50 strip = "${tool_prefix}strip" |
62 | 51 |
63 toolchain_os = "android" | 52 toolchain_os = "android" |
64 toolchain_cpu = invoker.toolchain_cpu | 53 toolchain_cpu = invoker.toolchain_cpu |
65 } | 54 } |
66 } | 55 } |
67 | 56 |
68 template("android_gcc_toolchains_helper") { | 57 template("android_gcc_toolchains_helper") { |
69 android_gcc_toolchain(target_name) { | 58 android_gcc_toolchain(target_name) { |
70 android_ndk_sysroot = invoker.android_ndk_sysroot | 59 android_ndk_sysroot = invoker.android_ndk_sysroot |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 toolchain_cpu = "aarch64" | 111 toolchain_cpu = "aarch64" |
123 } | 112 } |
124 | 113 |
125 android_gcc_toolchains_helper("mips64el") { | 114 android_gcc_toolchains_helper("mips64el") { |
126 android_ndk_sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" | 115 android_ndk_sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" |
127 android_ndk_lib_dir = "usr/lib64" | 116 android_ndk_lib_dir = "usr/lib64" |
128 | 117 |
129 tool_prefix = "$mips64_android_toolchain_root/bin/mipsel-linux-android-" | 118 tool_prefix = "$mips64_android_toolchain_root/bin/mipsel-linux-android-" |
130 toolchain_cpu = "mipsel64el" | 119 toolchain_cpu = "mipsel64el" |
131 } | 120 } |
OLD | NEW |