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") | 6 import("//build/toolchain/ccache.gni") |
7 import("//build/toolchain/clang.gni") | 7 import("//build/toolchain/clang.gni") |
8 import("//build/toolchain/goma.gni") | 8 import("//build/toolchain/goma.gni") |
9 import("//build/toolchain/gcc_toolchain.gni") | 9 import("//build/toolchain/gcc_toolchain.gni") |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 cc = "${compiler_prefix}$prefix/clang" | 57 cc = "${compiler_prefix}$prefix/clang" |
58 cxx = "${compiler_prefix}$prefix/clang++" | 58 cxx = "${compiler_prefix}$prefix/clang++" |
59 } else { | 59 } else { |
60 cc = "${compiler_prefix}${tool_prefix}gcc" | 60 cc = "${compiler_prefix}${tool_prefix}gcc" |
61 cxx = "${compiler_prefix}${tool_prefix}g++" | 61 cxx = "${compiler_prefix}${tool_prefix}g++" |
62 } | 62 } |
63 ar = tool_prefix + "ar" | 63 ar = tool_prefix + "ar" |
64 ld = cxx | 64 ld = cxx |
65 readelf = compiler_prefix + tool_prefix + "readelf" | 65 readelf = compiler_prefix + tool_prefix + "readelf" |
66 nm = compiler_prefix + tool_prefix + "nm" | 66 nm = compiler_prefix + tool_prefix + "nm" |
| 67 strip = "${tool_prefix}strip" |
67 | 68 |
68 toolchain_os = "android" | 69 toolchain_os = "android" |
69 toolchain_cpu = invoker.toolchain_cpu | 70 toolchain_cpu = invoker.toolchain_cpu |
70 | |
71 # We make the assumption that the gcc_toolchain will produce a soname with | |
72 # the following definition. | |
73 soname = "{{target_output_name}}{{output_extension}}" | |
74 | |
75 stripped_soname = "lib.stripped/${soname}" | |
76 temp_stripped_soname = "${stripped_soname}.tmp" | |
77 | |
78 android_strip = "${tool_prefix}strip" | |
79 | |
80 strip_command = | |
81 "$android_strip --strip-unneeded -o $temp_stripped_soname $soname" | |
82 replace_command = "if ! cmp -s $temp_stripped_soname $stripped_soname; then
mv $temp_stripped_soname $stripped_soname; fi" | |
83 postsolink = "$strip_command && $replace_command" | |
84 solink_outputs = [ stripped_soname ] | |
85 default_output_extension = android_product_extension | |
86 | |
87 # We make the assumption that the gcc_toolchain will produce an exe with | |
88 # the following definition. | |
89 exe = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" | |
90 stripped_exe = "exe.stripped/$exe" | |
91 postlink = "$android_strip --strip-unneeded -o $stripped_exe $exe" | |
92 link_outputs = [ stripped_exe ] | |
93 } | 71 } |
94 } | 72 } |
95 | 73 |
96 template("android_gcc_toolchains_helper") { | 74 template("android_gcc_toolchains_helper") { |
97 android_gcc_toolchain(target_name) { | 75 android_gcc_toolchain(target_name) { |
98 android_ndk_sysroot = invoker.android_ndk_sysroot | 76 android_ndk_sysroot = invoker.android_ndk_sysroot |
99 android_ndk_lib_dir = invoker.android_ndk_lib_dir | 77 android_ndk_lib_dir = invoker.android_ndk_lib_dir |
100 tool_prefix = invoker.tool_prefix | 78 tool_prefix = invoker.tool_prefix |
101 toolchain_cpu = invoker.toolchain_cpu | 79 toolchain_cpu = invoker.toolchain_cpu |
102 } | 80 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 toolchain_cpu = "aarch64" | 128 toolchain_cpu = "aarch64" |
151 } | 129 } |
152 | 130 |
153 android_gcc_toolchains_helper("mips64el") { | 131 android_gcc_toolchains_helper("mips64el") { |
154 android_ndk_sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" | 132 android_ndk_sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" |
155 android_ndk_lib_dir = "usr/lib64" | 133 android_ndk_lib_dir = "usr/lib64" |
156 | 134 |
157 tool_prefix = "$mips64_android_toolchain_root/bin/mipsel-linux-android-" | 135 tool_prefix = "$mips64_android_toolchain_root/bin/mipsel-linux-android-" |
158 toolchain_cpu = "mipsel64el" | 136 toolchain_cpu = "mipsel64el" |
159 } | 137 } |
OLD | NEW |