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

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

Issue 275703003: Make GN Android build link executables (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whitespace Created 6 years, 7 months 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
OLDNEW
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/android/config.gni") 5 import("//build/config/sysroot.gni") # Imports android/config.gni.
6 import("//build/toolchain/clang.gni") 6 import("//build/toolchain/clang.gni")
7 import("//build/toolchain/goma.gni") 7 import("//build/toolchain/goma.gni")
8 import("//build/toolchain/gcc_toolchain.gni") 8 import("//build/toolchain/gcc_toolchain.gni")
9 9
10 # Get the Android version of the name of the build host's architecture. 10 android_ndk_lib = sysroot + "android_ndk_lib_dir"
11 if (build_cpu_arch == "x64") { 11
12 android_host_arch = "x86_64" 12 # The Android GCC toolchains share most of the same parameters, so we have this
13 } else if (build_cpu_arch == "x86") { 13 # wrapper around gcc_toolchain to avoid duplication of logic.
14 android_host_arch = "x86" 14 #
15 } else { 15 # Parameters:
16 assert(false, "Need Android toolchain support for your build OS.") 16 # - android_ndk_sysroot
17 # Sysroot for this architecture.
18 # - android_ndk_lib_dir
19 # Subdirectory inside of android_ndk_sysroot where libs go.
20 # - tool_prefix
21 # Prefix to be added to the tool names.
22 # - toolchain_cpu_arch
23 # Same as gcc_toolchain
24 template("android_gcc_toolchain") {
25 gcc_toolchain(target_name) {
26 # Make our manually injected libs relative to the build dir.
27 android_ndk_lib = rebase_path(
28 invoker.android_ndk_sysroot + "/" + invoker.android_ndk_lib_dir,
29 root_build_dir)
30
31 libs_section_prefix = "$android_ndk_lib/crtbegin_dynamic.o"
awong 2014/05/12 19:23:02 I think you might be able to kill this if you don'
32 libs_section_postfix = "$android_ndk_lib/crtend_android.o"
33
34 # The tools should be run relative to the build dir.
35 tool_prefix = rebase_path(invoker.tool_prefix, root_build_dir)
36
37 cc = tool_prefix + "gcc"
38 cxx = tool_prefix + "g++"
39 ar = tool_prefix + "ar"
40 ld = cxx
41
42 toolchain_os = "android"
43 toolchain_cpu_arch = invoker.toolchain_cpu_arch
44 }
17 } 45 }
18 46
19 gcc_toolchain("x86") { 47 android_gcc_toolchain("x86") {
20 prefix = "$android_ndk_root/toolchains/x86-4.6/prebuilt/$build_os-$android_hos t_arch/bin/i686-linux-android-" 48 android_ndk_sysroot = "$android_ndk_root/$x86_android_sysroot_subdir"
21 cc = prefix + "gcc" 49 android_ndk_lib_dir = "usr/lib"
22 cxx = prefix + "g++"
23 ar = prefix + "ar"
24 ld = cxx
25 50
51 tool_prefix = "$x86_android_toolchain_root/bin/i686-linux-android-"
awong 2014/05/12 19:23:02 Is there a reason the tool_prefix is here rather t
brettw 2014/05/12 21:00:08 Yes, because it's different in every toolchain in
26 toolchain_cpu_arch = "x86" 52 toolchain_cpu_arch = "x86"
27 toolchain_os = "android"
28 } 53 }
29 54
30 gcc_toolchain("arm") { 55 android_gcc_toolchain("arm") {
31 prefix = "$android_ndk_root/toolchains/arm-linux-androideabi-4.6/prebuilt/$bui ld_os-$android_host_arch/bin/arm-linux-androideabi-" 56 android_ndk_sysroot = "$android_ndk_root/$arm_android_sysroot_subdir"
32 cc = prefix + "gcc" 57 android_ndk_lib_dir = "usr/lib"
33 cxx = prefix + "g++"
34 ar = prefix + "ar"
35 ld = cxx
36 58
59 tool_prefix = "$arm_android_toolchain_root/bin/arm-linux-androideabi-"
37 toolchain_cpu_arch = "arm" 60 toolchain_cpu_arch = "arm"
38 toolchain_os = "android"
39 } 61 }
40 62
41 gcc_toolchain("mipsel") { 63 android_gcc_toolchain("mipsel") {
42 prefix = "$android_ndk_root/toolchains/mipsel-linux-android-4.6/prebuilt/$buil d_os-$android_host_arch/bin/mipsel-linux-android-" 64 android_ndk_sysroot = "$android_ndk_root/$mips_android_sysroot_subdir"
43 cc = prefix + "gcc" 65 android_ndk_lib_dir = "usr/lib"
44 cxx = prefix + "g++"
45 ar = prefix + "ar"
46 ld = cxx
47 66
67 tool_prefix = "$mips_android_toolchain_root/bin/mipsel-linux-android-"
48 toolchain_cpu_arch = "mipsel" 68 toolchain_cpu_arch = "mipsel"
49 toolchain_os = "android"
50 } 69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698