• 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  toolprefix = "aarch64-linux-gnu-"
22  toolchain_args = {
23    current_cpu = "arm64"
24    current_os = "linux"
25  }
26}
27
28gcc_toolchain("arm64") {
29  toolprefix = "aarch64-linux-gnu-"
30
31  cc = "${toolprefix}gcc"
32  cxx = "${toolprefix}g++"
33
34  ar = "${toolprefix}ar"
35  ld = cxx
36  readelf = "${toolprefix}readelf"
37  nm = "${toolprefix}nm"
38
39  toolchain_args = {
40    current_cpu = "arm64"
41    current_os = "linux"
42    is_clang = false
43  }
44}
45
46gcc_toolchain("arm") {
47  toolprefix = "arm-linux-gnueabihf-"
48
49  cc = "${toolprefix}gcc"
50  cxx = "${toolprefix}g++"
51
52  ar = "${toolprefix}ar"
53  ld = cxx
54  readelf = "${toolprefix}readelf"
55  nm = "${toolprefix}nm"
56
57  toolchain_args = {
58    current_cpu = "arm"
59    current_os = "linux"
60    is_clang = false
61  }
62}
63
64clang_toolchain("clang_x86") {
65  # Output linker map files for binary size analysis.
66  enable_linker_map = true
67
68  toolchain_args = {
69    current_cpu = "x86"
70    current_os = "linux"
71  }
72}
73
74gcc_toolchain("x86") {
75  cc = "gcc"
76  cxx = "g++"
77
78  readelf = "readelf"
79  nm = "nm"
80  ar = "ar"
81  ld = cxx
82
83  # Output linker map files for binary size analysis.
84  enable_linker_map = true
85
86  toolchain_args = {
87    current_cpu = "x86"
88    current_os = "linux"
89    is_clang = false
90  }
91}
92
93clang_toolchain("clang_x64") {
94  # Output linker map files for binary size analysis.
95  enable_linker_map = true
96
97  strip = rebase_path("${clang_base_path}/bin/llvm-strip", root_build_dir)
98  toolchain_args = {
99    current_cpu = "x64"
100    current_os = "linux"
101  }
102  shlib_extension = ".so"
103  if (!is_arkui_x) {
104    rust_abi_target = "x86_64-unknown-linux-gnu"
105  }
106}
107
108gcc_toolchain("x64") {
109  cc = "gcc"
110  cxx = "g++"
111
112  readelf = "readelf"
113  nm = "nm"
114  ar = "ar"
115  ld = cxx
116
117  # Output linker map files for binary size analysis.
118  enable_linker_map = true
119
120  toolchain_args = {
121    current_cpu = "x64"
122    current_os = "linux"
123    is_clang = false
124  }
125}
126