1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
build / config / chromeos / BUILD.gn [blame]
# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
assert(is_chromeos)
config("compiler_cpu_abi") {
# These flags are added by the Chrome OS toolchain compiler wrapper,
# or are implicitly passed by Chome OS's toolchain's clang due to
# the cmake flags that clang was built with. Passing them redundantly
# is harmless and prepares for using Chromium's toolchain.
if (is_chromeos_device) {
if (current_cpu == "x64") {
asmflags = [ "--target=x86_64-cros-linux-gnu" ]
cflags = [
"--target=x86_64-cros-linux-gnu",
"-mno-movbe",
]
ldflags = [
"--target=x86_64-cros-linux-gnu",
"-mno-movbe",
]
} else if (current_cpu == "arm") {
asmflags = [ "--target=armv7a-cros-linux-gnueabihf" ]
cflags = [ "--target=armv7a-cros-linux-gnueabihf" ]
ldflags = [ "--target=armv7a-cros-linux-gnueabihf" ]
} else if (current_cpu == "arm64") {
asmflags = [ "--target=aarch64-cros-linux-gnu" ]
cflags = [ "--target=aarch64-cros-linux-gnu" ]
ldflags = [ "--target=aarch64-cros-linux-gnu" ]
} else {
assert(false, "add support for $current_cpu here")
}
}
}
config("runtime_library") {
# These flags are added by the Chrome OS toolchain compiler wrapper,
# or are implicitly passed by Chome OS's toolchain's clang due to
# the cmake flags that clang was built with. Passing them redundantly
# is harmless and prepares for using Chromium's toolchain.
if (is_chromeos_device) {
ldflags = [
"--rtlib=compiler-rt",
"--unwindlib=libunwind",
]
}
}