| 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") | 5 import("//build/config/sysroot.gni") |
| 6 import("//build/toolchain/ccache.gni") | 6 import("//build/toolchain/ccache.gni") |
| 7 import("//build/toolchain/clang.gni") | 7 import("//build/toolchain/clang.gni") |
| 8 import("//build/toolchain/gcc_toolchain.gni") | 8 import("//build/toolchain/gcc_toolchain.gni") |
| 9 import("//build/toolchain/goma.gni") | 9 import("//build/toolchain/goma.gni") |
| 10 | 10 |
| 11 declare_args() { |
| 12 toolchain_prefix = "" |
| 13 } |
| 14 |
| 11 if (use_goma) { | 15 if (use_goma) { |
| 12 assert(!use_ccache, "Goma and ccache can't be used together.") | 16 assert(!use_ccache, "Goma and ccache can't be used together.") |
| 13 compiler_prefix = "$goma_dir/gomacc " | 17 compiler_prefix = "$goma_dir/gomacc " |
| 14 } else if (use_ccache) { | 18 } else if (use_ccache) { |
| 15 compiler_prefix = "ccache " | 19 compiler_prefix = "ccache " |
| 16 } else { | 20 } else { |
| 17 compiler_prefix = "" | 21 compiler_prefix = "" |
| 18 } | 22 } |
| 19 | 23 |
| 20 gcc_toolchain("arm") { | 24 gcc_toolchain("arm") { |
| 21 cc = "${compiler_prefix}arm-linux-gnueabi-gcc" | 25 cc = "${compiler_prefix}arm-linux-gnueabi-gcc" |
| 22 cxx = "${compiler_prefix}arm-linux-gnueabi-g++" | 26 cxx = "${compiler_prefix}arm-linux-gnueabi-g++" |
| 23 | 27 |
| 24 ar = "arm-linux-gnueabi-ar" | 28 ar = "arm-linux-gnueabi-ar" |
| 25 ld = cxx | 29 ld = cxx |
| 26 readelf = "arm-linux-gnueabi-readelf" | 30 readelf = "arm-linux-gnueabi-readelf" |
| 27 nm = "arm-linux-gnueabi-nm" | 31 nm = "arm-linux-gnueabi-nm" |
| 28 | 32 |
| 29 toolchain_cpu = "arm" | 33 toolchain_cpu = "arm" |
| 30 toolchain_os = "linux" | 34 toolchain_os = "linux" |
| 31 is_clang = false | 35 is_clang = false |
| 32 } | 36 } |
| 33 | 37 |
| 38 gcc_toolchain("arm64") { |
| 39 cc = "${compiler_prefix}aarch64-linux-gnu-gcc" |
| 40 cxx = "${compiler_prefix}aarch64-linux-gnu-g++" |
| 41 |
| 42 ar = "aarch64-linux-gnu-ar" |
| 43 ld = cxx |
| 44 readelf = "aarch64-linux-gnu-readelf" |
| 45 nm = "aarch64-linux-gnu-nm" |
| 46 |
| 47 toolchain_cpu = "arm64" |
| 48 toolchain_os = "linux" |
| 49 is_clang = false |
| 50 } |
| 51 |
| 34 gcc_toolchain("clang_x86") { | 52 gcc_toolchain("clang_x86") { |
| 35 if (use_clang_type_profiler) { | 53 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
| 36 prefix = rebase_path("//third_party/llvm-allocated-type/Linux_ia32/bin", | 54 root_build_dir) |
| 37 root_build_dir) | |
| 38 } else { | |
| 39 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | |
| 40 root_build_dir) | |
| 41 } | |
| 42 cc = "${compiler_prefix}$prefix/clang" | 55 cc = "${compiler_prefix}$prefix/clang" |
| 43 cxx = "${compiler_prefix}$prefix/clang++" | 56 cxx = "${compiler_prefix}$prefix/clang++" |
| 44 readelf = "readelf" | 57 readelf = "readelf" |
| 45 nm = "nm" | 58 nm = "nm" |
| 46 ar = "ar" | 59 ar = "ar" |
| 47 ld = cxx | 60 ld = cxx |
| 48 | 61 |
| 49 toolchain_cpu = "x86" | 62 toolchain_cpu = "x86" |
| 50 toolchain_os = "linux" | 63 toolchain_os = "linux" |
| 51 is_clang = true | 64 is_clang = true |
| 52 } | 65 } |
| 53 | 66 |
| 54 gcc_toolchain("x86") { | 67 gcc_toolchain("x86") { |
| 55 cc = "${compiler_prefix}gcc" | 68 cc = "${compiler_prefix}gcc" |
| 56 cxx = "$compiler_prefix}g++" | 69 cxx = "${compiler_prefix}g++" |
| 57 | 70 |
| 58 readelf = "readelf" | 71 readelf = "readelf" |
| 59 nm = "nm" | 72 nm = "nm" |
| 60 ar = "ar" | 73 ar = "ar" |
| 61 ld = cxx | 74 ld = cxx |
| 62 | 75 |
| 63 toolchain_cpu = "x86" | 76 toolchain_cpu = "x86" |
| 64 toolchain_os = "linux" | 77 toolchain_os = "linux" |
| 65 is_clang = false | 78 is_clang = false |
| 66 } | 79 } |
| 67 | 80 |
| 68 gcc_toolchain("clang_x64") { | 81 gcc_toolchain("clang_x64") { |
| 69 if (use_clang_type_profiler) { | 82 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", |
| 70 prefix = rebase_path("//third_party/llvm-allocated-type/Linux_x64/bin", | 83 root_build_dir) |
| 71 root_build_dir) | |
| 72 } else { | |
| 73 prefix = rebase_path("//third_party/llvm-build/Release+Asserts/bin", | |
| 74 root_build_dir) | |
| 75 } | |
| 76 cc = "${compiler_prefix}$prefix/clang" | 84 cc = "${compiler_prefix}$prefix/clang" |
| 77 cxx = "${compiler_prefix}$prefix/clang++" | 85 cxx = "${compiler_prefix}$prefix/clang++" |
| 78 | 86 |
| 79 readelf = "readelf" | 87 readelf = "readelf" |
| 80 nm = "nm" | 88 nm = "nm" |
| 81 ar = "ar" | 89 ar = "ar" |
| 82 ld = cxx | 90 ld = cxx |
| 83 strip = "strip" | 91 strip = "strip" |
| 84 | 92 |
| 85 toolchain_cpu = "x64" | 93 toolchain_cpu = "x64" |
| 86 toolchain_os = "linux" | 94 toolchain_os = "linux" |
| 87 is_clang = true | 95 is_clang = true |
| 88 } | 96 } |
| 89 | 97 |
| 90 gcc_toolchain("x64") { | 98 gcc_toolchain("x64") { |
| 91 cc = "${compiler_prefix}gcc" | 99 cc = "${compiler_prefix}gcc" |
| 92 cxx = "${compiler_prefix}g++" | 100 cxx = "${compiler_prefix}g++" |
| 93 | 101 |
| 94 readelf = "readelf" | 102 readelf = "readelf" |
| 95 nm = "nm" | 103 nm = "nm" |
| 96 ar = "ar" | 104 ar = "ar" |
| 97 ld = cxx | 105 ld = cxx |
| 98 | 106 |
| 99 toolchain_cpu = "x64" | 107 toolchain_cpu = "x64" |
| 100 toolchain_os = "linux" | 108 toolchain_os = "linux" |
| 101 is_clang = false | 109 is_clang = false |
| 102 } | 110 } |
| 103 | 111 |
| 104 gcc_toolchain("mipsel") { | 112 gcc_toolchain("mipsel") { |
| 105 cc = "mipsel-linux-gnu-gcc" | 113 cc = "${toolchain_prefix}gcc" |
| 106 cxx = "mipsel-linux-gnu-g++" | 114 cxx = "${toolchain_prefix}g++" |
| 107 ar = "mipsel-linux-gnu-ar" | 115 ar = "${toolchain_prefix}ar" |
| 108 ld = cxx | 116 ld = cxx |
| 109 readelf = "mipsel-linux-gnu-readelf" | 117 readelf = "${toolchain_prefix}readelf" |
| 110 nm = "mipsel-linux-gnu-nm" | 118 nm = "${toolchain_prefix}nm" |
| 111 | 119 |
| 112 toolchain_cpu = "mipsel" | 120 toolchain_cpu = "${target_cpu}" |
| 113 toolchain_os = "linux" | 121 toolchain_os = "linux" |
| 114 is_clang = false | 122 is_clang = is_clang |
| 115 } | 123 } |
| OLD | NEW |