OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
7 | 7 |
8 assert(is_android) | 8 assert(is_android) |
9 | 9 |
10 # This is included by reference in the //build/config/compiler config that | 10 # This is included by reference in the //build/config/compiler config that |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 # http://crbug.com/448386 | 56 # http://crbug.com/448386 |
57 "-Wl,--exclude-libs=libvpx_assembly_arm.a", | 57 "-Wl,--exclude-libs=libvpx_assembly_arm.a", |
58 ] | 58 ] |
59 | 59 |
60 if (is_clang) { | 60 if (is_clang) { |
61 if (current_cpu == "arm") { | 61 if (current_cpu == "arm") { |
62 abi_target = "arm-linux-androideabi" | 62 abi_target = "arm-linux-androideabi" |
63 } else if (current_cpu == "x86") { | 63 } else if (current_cpu == "x86") { |
64 abi_target = "i686-linux-androideabi" | 64 abi_target = "i686-linux-androideabi" |
65 } else if (current_cpu == "arm64") { | 65 } else if (current_cpu == "arm64") { |
66 # Place holder for arm64 support, not tested. | |
67 # TODO: Enable clang support for Android Arm64. http://crbug.com/539781 | |
68 abi_target = "aarch64-linux-android" | 66 abi_target = "aarch64-linux-android" |
69 } else if (current_cpu == "x64") { | 67 } else if (current_cpu == "x64") { |
70 # Place holder for x64 support, not tested. | 68 # Place holder for x64 support, not tested. |
71 # TODO: Enable clang support for Android x64. http://crbug.com/539781 | 69 # TODO: Enable clang support for Android x64. http://crbug.com/539781 |
72 abi_target = "x86_64-linux-androideabi" | 70 abi_target = "x86_64-linux-androideabi" |
73 } else if (current_cpu == "mipsel") { | 71 } else if (current_cpu == "mipsel") { |
74 abi_target = "mipsel-linux-android" | 72 abi_target = "mipsel-linux-android" |
75 } else if (current_cpu == "mips64el") { | 73 } else if (current_cpu == "mips64el") { |
76 # Place holder for mips64 support, not tested. | 74 # Place holder for mips64 support, not tested. |
77 abi_target = "mips64el-linux-androideabi" | 75 abi_target = "mips64el-linux-androideabi" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 if (!is_clang) { | 140 if (!is_clang) { |
143 libs += [ "atomic" ] | 141 libs += [ "atomic" ] |
144 } | 142 } |
145 | 143 |
146 if (is_clang) { | 144 if (is_clang) { |
147 # Work around incompatibilities between bionic and clang headers. | 145 # Work around incompatibilities between bionic and clang headers. |
148 defines += [ | 146 defines += [ |
149 "__compiler_offsetof=__builtin_offsetof", | 147 "__compiler_offsetof=__builtin_offsetof", |
150 "nan=__builtin_nan", | 148 "nan=__builtin_nan", |
151 ] | 149 ] |
| 150 |
| 151 if (current_cpu == "x64" || current_cpu == "arm64" || |
| 152 current_cpu == "mips64el") { |
| 153 # 64-bit targets build with NDK 21, 32-bit targets with NDK 16 |
| 154 # (see ./config.gni). When using clang, NDK 21 defines snprintf to |
| 155 # something for a kind of for of _FORTIFY_SOURCE support, see |
| 156 # third_party/android_tools/ndk/platforms/android-21/arch-x86_64/usr/inclu
de/stdio.h |
| 157 # Making snprintf a macro breaks base/strings/string_utils.h which |
| 158 # defines base::snprintf(). So define snprintf to itself to force the |
| 159 # NDK to not redefine it. This disables _chk for snprintf, but since |
| 160 # 32-bit versions use NDK 16 which doesn't have any fortify support, that |
| 161 # seems ok. b/32067310 tracks better fortify support with clang. |
| 162 # TODO(thakis): Remove this once b/32067310 is fixed. |
| 163 defines += [ "snprintf=snprintf" ] |
| 164 } |
152 } | 165 } |
153 | 166 |
154 # TODO(jdduke) Re-enable on mips after resolving linking | 167 # TODO(jdduke) Re-enable on mips after resolving linking |
155 # issues with libc++ (crbug.com/456380). | 168 # issues with libc++ (crbug.com/456380). |
156 if (current_cpu != "mipsel" && current_cpu != "mips64el") { | 169 if (current_cpu != "mipsel" && current_cpu != "mips64el") { |
157 ldflags += [ "-Wl,--warn-shared-textrel" ] | 170 ldflags += [ "-Wl,--warn-shared-textrel" ] |
158 } | 171 } |
159 } | 172 } |
160 | 173 |
161 config("executable_config") { | 174 config("executable_config") { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 210 |
198 # Avoid errors with current NDK: | 211 # Avoid errors with current NDK: |
199 # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/preb
uilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:34
26:3: error: argument must be a constant" | 212 # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/preb
uilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:34
26:3: error: argument must be a constant" |
200 "-finstrument-functions-exclude-file-list=arm_neon.h", | 213 "-finstrument-functions-exclude-file-list=arm_neon.h", |
201 ] | 214 ] |
202 } | 215 } |
203 } | 216 } |
204 | 217 |
205 config("no_cygprofile_instrumentation") { | 218 config("no_cygprofile_instrumentation") { |
206 } | 219 } |
OLD | NEW |