| 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 import("//build/config/sysroot.gni") | 7 import("//build/config/sysroot.gni") |
| 8 | 8 |
| 9 assert(is_android) | 9 assert(is_android) |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 rebase_path(android_toolchain_root, root_build_dir) | 35 rebase_path(android_toolchain_root, root_build_dir) |
| 36 if (current_cpu == "arm") { | 36 if (current_cpu == "arm") { |
| 37 cflags += [ | 37 cflags += [ |
| 38 # TODO(hans) Enable integrated-as (crbug.com/124610). | 38 # TODO(hans) Enable integrated-as (crbug.com/124610). |
| 39 "-no-integrated-as", | 39 "-no-integrated-as", |
| 40 "-B${rebased_android_toolchain_root}/bin", # Else /usr/bin/as gets pick
ed up. | 40 "-B${rebased_android_toolchain_root}/bin", # Else /usr/bin/as gets pick
ed up. |
| 41 ] | 41 ] |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 if (is_asan) { | |
| 46 # Android build relies on -Wl,--gc-sections removing unreachable code. | |
| 47 # ASan instrumentation for globals inhibits this and results in a library | |
| 48 # with unresolvable relocations. | |
| 49 # TODO(eugenis): find a way to reenable this. | |
| 50 cflags += [ "-mllvm -asan-globals=0" ] | |
| 51 } | |
| 52 | |
| 53 # Use gold for Android for most CPU architectures. | 45 # Use gold for Android for most CPU architectures. |
| 54 if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") { | 46 if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") { |
| 55 ldflags += [ "-fuse-ld=gold" ] | 47 ldflags += [ "-fuse-ld=gold" ] |
| 56 if (is_clang) { | 48 if (is_clang) { |
| 57 # Let clang find the ld.gold in the NDK. | 49 # Let clang find the ld.gold in the NDK. |
| 58 ldflags += [ "--gcc-toolchain=$rebased_android_toolchain_root" ] | 50 ldflags += [ "--gcc-toolchain=$rebased_android_toolchain_root" ] |
| 59 } | 51 } |
| 60 | 52 |
| 61 # Use -mstackrealign due to a bug on ia32 Jelly Bean. | 53 # Use -mstackrealign due to a bug on ia32 Jelly Bean. |
| 62 # See crbug.com/521527 | 54 # See crbug.com/521527 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 225 |
| 234 # Avoid errors with current NDK: | 226 # Avoid errors with current NDK: |
| 235 # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebui
lt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:3426
:3: error: argument must be a constant" | 227 # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebui
lt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:3426
:3: error: argument must be a constant" |
| 236 "-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.
h", | 228 "-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM.
h", |
| 237 ] | 229 ] |
| 238 defines = [ "CYGPROFILE_INSTRUMENTATION=1" ] | 230 defines = [ "CYGPROFILE_INSTRUMENTATION=1" ] |
| 239 } | 231 } |
| 240 | 232 |
| 241 config("no_cygprofile_instrumentation") { | 233 config("no_cygprofile_instrumentation") { |
| 242 } | 234 } |
| OLD | NEW |