• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3# found in the LICENSE file.
4
5import("//build/config/sysroot.gni")
6import("//build/toolchain/gcc_toolchain.gni")
7
8if (!is_arkui_x) {
9  import("//build/rust/rustc_toolchain.gni")
10}
11
12clang_toolchain("clang_arm") {
13  toolprefix = "arm-linux-gnueabihf-"
14  toolchain_args = {
15    current_cpu = "arm"
16    current_os = "linux"
17  }
18}
19
20clang_toolchain("clang_arm64") {
21  if (host_cpu == "arm64") {
22    # Output linker map files for binary size analysis.
23    enable_linker_map = true
24
25    strip = rebase_path("${clang_base_path}/bin/llvm-strip", root_build_dir)
26    shlib_extension = ".so"
27  } else {
28    toolprefix = "aarch64-linux-gnu-"
29  }
30  toolchain_args = {
31    current_cpu = "arm64"
32    current_os = "linux"
33  }
34}
35
36clang_toolchain("clang_riscv64") {
37  toolprefix = "riscv64-unknown-linux-gnu-"
38  toolchain_args = {
39    current_cpu = "riscv64"
40    current_os = "linux"
41  }
42}
43
44gcc_toolchain("arm64") {
45  if (host_cpu == "arm64") {
46    toolprefix = ""
47
48    # Output linker map files for binary size analysis.
49    enable_linker_map = true
50  } else {
51    toolprefix = "aarch64-linux-gnu-"
52  }
53
54  cc = "${toolprefix}gcc"
55  cxx = "${toolprefix}g++"
56
57  ar = "${toolprefix}ar"
58  ld = cxx
59  readelf = "${toolprefix}readelf"
60  nm = "${toolprefix}nm"
61
62  toolchain_args = {
63    current_cpu = "arm64"
64    current_os = "linux"
65    is_clang = false
66  }
67}
68
69gcc_toolchain("arm") {
70  toolprefix = "arm-linux-gnueabihf-"
71
72  cc = "${toolprefix}gcc"
73  cxx = "${toolprefix}g++"
74
75  ar = "${toolprefix}ar"
76  ld = cxx
77  readelf = "${toolprefix}readelf"
78  nm = "${toolprefix}nm"
79
80  toolchain_args = {
81    current_cpu = "arm"
82    current_os = "linux"
83    is_clang = false
84  }
85}
86
87gcc_toolchain("riscv64") {
88  toolprefix = "riscv64-unknown-linux-gnu-"
89
90  cc = "${toolprefix}gcc"
91  cxx = "${toolprefix}g++"
92
93  ar = "${toolprefix}ar"
94  ld = cxx
95  readelf = "${toolprefix}readelf"
96  nm = "${toolprefix}nm"
97
98  toolchain_args = {
99    current_cpu = "riscv64"
100    current_os = "linux"
101    is_clang = false
102  }
103}
104
105clang_toolchain("clang_x86") {
106  # Output linker map files for binary size analysis.
107  enable_linker_map = true
108
109  toolchain_args = {
110    current_cpu = "x86"
111    current_os = "linux"
112  }
113}
114
115gcc_toolchain("x86") {
116  cc = "gcc"
117  cxx = "g++"
118
119  readelf = "readelf"
120  nm = "nm"
121  ar = "ar"
122  ld = cxx
123
124  # Output linker map files for binary size analysis.
125  enable_linker_map = true
126
127  toolchain_args = {
128    current_cpu = "x86"
129    current_os = "linux"
130    is_clang = false
131  }
132}
133
134clang_toolchain("clang_x64") {
135  # Output linker map files for binary size analysis.
136  enable_linker_map = true
137
138  strip = rebase_path("${clang_base_path}/bin/llvm-strip", root_build_dir)
139  toolchain_args = {
140    current_cpu = "x64"
141    current_os = "linux"
142  }
143  shlib_extension = ".so"
144  if (!is_arkui_x) {
145    rust_abi_target = "x86_64-unknown-linux-gnu"
146  }
147}
148
149gcc_toolchain("x64") {
150  cc = "gcc"
151  cxx = "g++"
152
153  readelf = "readelf"
154  nm = "nm"
155  ar = "ar"
156  ld = cxx
157
158  # Output linker map files for binary size analysis.
159  enable_linker_map = true
160
161  toolchain_args = {
162    current_cpu = "x64"
163    current_os = "linux"
164    is_clang = false
165  }
166}
167