| 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") | |
| 7 import("//build/toolchain/clang.gni") | 6 import("//build/toolchain/clang.gni") |
| 8 import("//build/toolchain/goma.gni") | |
| 9 import("//build/toolchain/gcc_toolchain.gni") | 7 import("//build/toolchain/gcc_toolchain.gni") |
| 10 | 8 |
| 11 # The Android GCC toolchains share most of the same parameters, so we have this | 9 # The Android GCC toolchains share most of the same parameters, so we have this |
| 12 # wrapper around gcc_toolchain to avoid duplication of logic. | 10 # wrapper around gcc_toolchain to avoid duplication of logic. |
| 13 # | 11 # |
| 14 # Parameters: | 12 # Parameters: |
| 15 # - android_ndk_sysroot | 13 # - android_ndk_sysroot |
| 16 # Sysroot for this architecture. | 14 # Sysroot for this architecture. |
| 17 # - android_ndk_lib_dir | 15 # - android_ndk_lib_dir |
| 18 # Subdirectory inside of android_ndk_sysroot where libs go. | 16 # Subdirectory inside of android_ndk_sysroot where libs go. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 29 | 27 |
| 30 libs_section_prefix = "$android_ndk_lib/crtbegin_dynamic.o" | 28 libs_section_prefix = "$android_ndk_lib/crtbegin_dynamic.o" |
| 31 libs_section_postfix = "$android_ndk_lib/crtend_android.o" | 29 libs_section_postfix = "$android_ndk_lib/crtend_android.o" |
| 32 | 30 |
| 33 solink_libs_section_prefix = "$android_ndk_lib/crtbegin_so.o" | 31 solink_libs_section_prefix = "$android_ndk_lib/crtbegin_so.o" |
| 34 solink_libs_section_postfix = "$android_ndk_lib/crtend_so.o" | 32 solink_libs_section_postfix = "$android_ndk_lib/crtend_so.o" |
| 35 | 33 |
| 36 # The tools should be run relative to the build dir. | 34 # The tools should be run relative to the build dir. |
| 37 tool_prefix = rebase_path(invoker.tool_prefix, root_build_dir) | 35 tool_prefix = rebase_path(invoker.tool_prefix, root_build_dir) |
| 38 | 36 |
| 39 if (use_goma) { | 37 cc = tool_prefix + "gcc" |
| 40 assert(!use_ccache, "Goma and ccache can't be used together.") | 38 cxx = tool_prefix + "g++" |
| 41 compiler_prefix = "$goma_dir/gomacc " | |
| 42 } else if (use_ccache) { | |
| 43 compiler_prefix = "ccache " | |
| 44 } else { | |
| 45 compiler_prefix = "" | |
| 46 } | |
| 47 | |
| 48 cc = compiler_prefix + tool_prefix + "gcc" | |
| 49 cxx = compiler_prefix + tool_prefix + "g++" | |
| 50 ar = tool_prefix + "ar" | 39 ar = tool_prefix + "ar" |
| 51 ld = cxx | 40 ld = cxx |
| 52 readelf = compiler_prefix + tool_prefix + "readelf" | 41 readelf = tool_prefix + "readelf" |
| 53 nm = compiler_prefix + tool_prefix + "nm" | 42 nm = tool_prefix + "nm" |
| 54 | 43 |
| 55 toolchain_os = "android" | 44 toolchain_os = "android" |
| 56 toolchain_cpu = invoker.toolchain_cpu | 45 toolchain_cpu = invoker.toolchain_cpu |
| 57 | 46 |
| 58 # We make the assumption that the gcc_toolchain will produce a soname with | 47 # We make the assumption that the gcc_toolchain will produce a soname with |
| 59 # the following definition. | 48 # the following definition. |
| 60 soname = "{{target_output_name}}{{output_extension}}" | 49 soname = "{{target_output_name}}{{output_extension}}" |
| 61 | 50 |
| 62 stripped_soname = "lib.stripped/${soname}" | 51 stripped_soname = "lib.stripped/${soname}" |
| 63 temp_stripped_soname = "${stripped_soname}.tmp" | 52 temp_stripped_soname = "${stripped_soname}.tmp" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 toolchain_cpu = "aarch64" | 111 toolchain_cpu = "aarch64" |
| 123 } | 112 } |
| 124 | 113 |
| 125 android_gcc_toolchain("mips64el") { | 114 android_gcc_toolchain("mips64el") { |
| 126 android_ndk_sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" | 115 android_ndk_sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" |
| 127 android_ndk_lib_dir = "usr/lib64" | 116 android_ndk_lib_dir = "usr/lib64" |
| 128 | 117 |
| 129 tool_prefix = "$mips64_android_toolchain_root/bin/mipsel-linux-android-" | 118 tool_prefix = "$mips64_android_toolchain_root/bin/mipsel-linux-android-" |
| 130 toolchain_cpu = "mipsel64el" | 119 toolchain_cpu = "mipsel64el" |
| 131 } | 120 } |
| OLD | NEW |