Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: build/config/android/BUILD.gn

Issue 1515123002: GN: Use gold linker for arm64 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@arm64-android
Patch Set: just use gold Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 26 matching lines...) Expand all
37 if (current_cpu == "mipsel") { 37 if (current_cpu == "mipsel") {
38 cflags += [ 38 cflags += [
39 # TODO(gordanac) Enable integrated-as. 39 # TODO(gordanac) Enable integrated-as.
40 "-no-integrated-as", 40 "-no-integrated-as",
41 "-B${rebased_android_toolchain_root}/bin", # Else /usr/bin/as gets pick ed up. 41 "-B${rebased_android_toolchain_root}/bin", # Else /usr/bin/as gets pick ed up.
42 ] 42 ]
43 } 43 }
44 } 44 }
45 45
46 # Use gold for Android for most CPU architectures. 46 # Use gold for Android for most CPU architectures.
47 if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") { 47 if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
48 current_cpu == "arm64") {
48 ldflags += [ "-fuse-ld=gold" ] 49 ldflags += [ "-fuse-ld=gold" ]
49 if (is_clang) { 50 if (is_clang) {
50 # Let clang find the ld.gold in the NDK. 51 # Let clang find the ld.gold in the NDK.
51 ldflags += [ "--gcc-toolchain=$rebased_android_toolchain_root" ] 52 ldflags += [ "--gcc-toolchain=$rebased_android_toolchain_root" ]
52 } 53 }
53 54
54 # Use -mstackrealign due to a bug on ia32 Jelly Bean. 55 # Use -mstackrealign due to a bug on ia32 Jelly Bean.
55 # See crbug.com/521527 56 # See crbug.com/521527
56 if (current_cpu == "x86") { 57 if (current_cpu == "x86") {
57 cflags += [ "-mstackrealign" ] 58 cflags += [ "-mstackrealign" ]
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 # ld linker is used for mips Android, and ld does not accept library 161 # ld linker is used for mips Android, and ld does not accept library
161 # absolute path prefixed by "-l"; Since libgcc does not exist in mips 162 # absolute path prefixed by "-l"; Since libgcc does not exist in mips
162 # sysroot the proper library will be linked. 163 # sysroot the proper library will be linked.
163 # TODO(gordanac): Remove once gold linker is used for mips Android. 164 # TODO(gordanac): Remove once gold linker is used for mips Android.
164 "gcc", 165 "gcc",
165 ] 166 ]
166 } else { 167 } else {
167 libs += [ 168 libs += [
168 # Manually link the libgcc.a that the cross compiler uses. This is 169 # Manually link the libgcc.a that the cross compiler uses. This is
169 # absolute because the linker will look inside the sysroot if it's not. 170 # absolute because the linker will look inside the sysroot if it's not.
171 # Passing via -l (as is done in libs) works only with gold, and not with
172 # the system linker.
170 rebase_path(android_libgcc_file), 173 rebase_path(android_libgcc_file),
171 ] 174 ]
172 } 175 }
173 176
174 libs += [ 177 libs += [
175 "c", 178 "c",
176 "dl", 179 "dl",
177 "m", 180 "m",
178 ] 181 ]
179 182
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 237
235 # Avoid errors with current NDK: 238 # Avoid errors with current NDK:
236 # "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" 239 # "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"
237 "-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM. h", 240 "-finstrument-functions-exclude-file-list=arm_neon.h,SaturatedArithmeticARM. h",
238 ] 241 ]
239 defines = [ "CYGPROFILE_INSTRUMENTATION=1" ] 242 defines = [ "CYGPROFILE_INSTRUMENTATION=1" ]
240 } 243 }
241 244
242 config("no_cygprofile_instrumentation") { 245 config("no_cygprofile_instrumentation") {
243 } 246 }
OLDNEW
« no previous file with comments | « build/config/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698