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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
--- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2023-08-16 19:50:41 UTC
+++ src/3rdparty/chromium/build/config/compiler/BUILD.gn
@@ -243,13 +243,16 @@ config("no_unresolved_symbols") {
# Compiler instrumentation can introduce dependencies in DSOs to symbols in
# the executable they are loaded into, so they are unresolved at link-time.
config("no_unresolved_symbols") {
- if (!using_sanitizer &&
+ if (!using_sanitizer && !is_bsd &&
(is_linux || is_chromeos || is_android || is_fuchsia)) {
ldflags = [
"-Wl,-z,defs",
"-Wl,--as-needed",
]
}
+ if (current_cpu == "x86" && is_openbsd) {
+ ldflags = [ "-Wl,-z,notext" ]
+ }
}
# compiler ---------------------------------------------------------------------
@@ -513,6 +516,10 @@ config("compiler") {
}
}
+ if (is_openbsd) {
+ ldflags += [ "-Wl,-z,wxneeded" ]
+ }
+
# Linux-specific compiler flags setup.
# ------------------------------------
if (use_gold) {
@@ -882,7 +889,7 @@ config("compiler") {
# * Apple platforms (e.g. MacOS, iPhone, iPad) aren't supported because xcode
# lldb doesn't have the needed changes yet.
# TODO(crbug.com/1379070): Remove if the upstream default ever changes.
- if (is_clang && !is_nacl && !is_win && !is_apple) {
+ if (is_clang && !is_nacl && !is_win && !is_apple && !is_bsd) {
cflags_cc += [ "-gsimple-template-names" ]
}
@@ -1065,7 +1072,7 @@ config("compiler_cpu_abi") {
]
}
} else if (current_cpu == "arm") {
- if (is_clang && !is_android && !is_nacl &&
+ if (is_clang && !is_android && !is_nacl && !is_bsd &&
!(is_chromeos_lacros && is_chromeos_device)) {
cflags += [ "--target=arm-linux-gnueabihf" ]
ldflags += [ "--target=arm-linux-gnueabihf" ]
@@ -1083,7 +1090,7 @@ config("compiler_cpu_abi") {
cflags += [ "-mtune=$arm_tune" ]
}
} else if (current_cpu == "arm64") {
- if (is_clang && !is_android && !is_nacl && !is_fuchsia &&
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd &&
!(is_chromeos_lacros && is_chromeos_device)) {
cflags += [ "--target=aarch64-linux-gnu" ]
ldflags += [ "--target=aarch64-linux-gnu" ]
@@ -1418,7 +1425,7 @@ config("compiler_deterministic") {
# different build directory like "out/feature_a" and "out/feature_b" if
# we build same files with same compile flag.
# Other paths are already given in relative, no need to normalize them.
- if (is_nacl) {
+ if (is_nacl || is_bsd) {
# TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
cflags += [
"-Xclang",
@@ -1470,7 +1477,7 @@ config("clang_revision") {
}
config("clang_revision") {
- if (is_clang && clang_base_path == default_clang_base_path) {
+ if (is_clang && !is_bsd && clang_base_path == default_clang_base_path) {
update_args = [
"--print-revision",
"--verify-version=$clang_version",
@@ -1872,7 +1879,7 @@ config("default_warnings") {
"-Wno-ignored-pragma-optimize",
]
- if (!is_nacl) {
+ if (!is_nacl && !is_bsd) {
cflags += [
# TODO(crbug.com/1343975) Evaluate and possibly enable.
"-Wno-deprecated-builtins",
@@ -2054,7 +2061,7 @@ config("no_chromium_code") {
# third-party libraries.
"-Wno-c++11-narrowing",
]
- if (!is_nacl) {
+ if (!is_nacl && !is_freebsd) {
cflags += [
# Disabled for similar reasons as -Wunused-variable.
"-Wno-unused-but-set-variable",
@@ -2570,7 +2577,7 @@ config("afdo") {
# There are some targeted places that AFDO regresses, so we provide a separate
# config to allow AFDO to be disabled per-target.
config("afdo") {
- if (is_clang) {
+ if (is_clang && !is_bsd) {
cflags = []
if (clang_emit_debug_info_for_profiling) {
# Add the following flags to generate debug info for profiling.
@@ -2589,7 +2596,7 @@ config("afdo") {
}
inputs = [ _clang_sample_profile ]
}
- } else if (auto_profile_path != "" && is_a_target_toolchain) {
+ } else if (auto_profile_path != "" && is_a_target_toolchain && !is_bsd) {
cflags = [ "-fauto-profile=${auto_profile_path}" ]
inputs = [ auto_profile_path ]
}
|