-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchromium.build.visionos.patch
More file actions
197 lines (192 loc) · 7.25 KB
/
chromium.build.visionos.patch
File metadata and controls
197 lines (192 loc) · 7.25 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
diff --git a/config/apple/codesign.py b/config/apple/codesign.py
index 0c9298ed6..2c74b71ce 100644
--- a/config/apple/codesign.py
+++ b/config/apple/codesign.py
@@ -102,6 +102,8 @@ class Bundle(object):
def Kind(platform, extension):
if platform in ('iphoneos', 'iphonesimulator'):
return 'ios'
+ if platform == 'xros' or platform == 'xrsimulator':
+ return 'xros'
if platform == 'macosx':
if extension == '.framework':
return 'mac_framework'
diff --git a/config/apple/mobile_config.gni b/config/apple/mobile_config.gni
index 48e80f216..f778ac967 100644
--- a/config/apple/mobile_config.gni
+++ b/config/apple/mobile_config.gni
@@ -8,6 +8,7 @@ declare_args() {
# Configure the environment for which to build. Could be either "device",
# "simulator" or "catalyst". Must be specified.
target_environment = ""
+ target_os_variation = ""
# Valid values: "iphoneos" (default), "tvos", "watchos".
# Indicates the kind of iOS or iOS-based platform that is being targeted.
@@ -75,6 +76,7 @@ if (is_ios || is_watchos) {
_target_platforms += [
"iphoneos",
"tvos",
+ "xros",
]
} else if (is_watchos) {
_target_platforms += [
diff --git a/config/apple/sdk_info.py b/config/apple/sdk_info.py
index bbadc1247..8f06db59d 100755
--- a/config/apple/sdk_info.py
+++ b/config/apple/sdk_info.py
@@ -141,6 +141,8 @@ def main():
'macosx',
'watchos',
'watchsimulator',
+ 'xros',
+ 'xrsimulator',
])
args = parser.parse_args()
if args.developer_dir:
diff --git a/config/clang/BUILD.gn b/config/clang/BUILD.gn
index 0d648fa31..79296b18a 100644
--- a/config/clang/BUILD.gn
+++ b/config/clang/BUILD.gn
@@ -273,6 +273,14 @@ clang_lib("compiler_builtins") {
} else {
assert(false, "unsupported target_environment=$target_environment")
}
+ } else if (target_platform == "xros") {
+ if (target_environment == "simulator") {
+ libname = "xrossim"
+ } else if (target_environment == "device") {
+ libname = "xros"
+ } else {
+ assert(false, "unsupported target_environment=$target_environment")
+ }
} else {
assert(false, "unsupported target_platform=$target_platform")
}
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
index 2cf8d3c7e..ddada66db 100644
--- a/config/compiler/BUILD.gn
+++ b/config/compiler/BUILD.gn
@@ -591,24 +591,6 @@ config("compiler") {
}
}
- # TODO(crbug.com/40283598): This causes binary size growth and potentially
- # other problems.
- # TODO(crbug.com/40284925): This isn't supported by Cronet's mainline llvm version.
- if (default_toolchain != "//build/toolchain/cros:target" &&
- !llvm_android_mainline) {
- cflags += [
- "-mllvm",
- "-split-threshold-for-reg-with-hint=0",
- ]
- if (use_thin_lto && is_a_target_toolchain) {
- if (is_win) {
- ldflags += [ "-mllvm:-split-threshold-for-reg-with-hint=0" ]
- } else {
- ldflags += [ "-Wl,-mllvm,-split-threshold-for-reg-with-hint=0" ]
- }
- }
- }
-
# TODO(crbug.com/40192287): Investigate why/if this should be needed.
if (is_win) {
cflags += [ "/clang:-ffp-contract=off" ]
@@ -1939,6 +1921,7 @@ config("default_warnings") {
# Disables.
"-Wno-missing-field-initializers", # "struct foo f = {0};"
"-Wno-unused-parameter", # Unused function parameters.
+ "-Wno-deprecated-declarations",
]
cflags_cc += [
diff --git a/config/ios/BUILD.gn b/config/ios/BUILD.gn
index 444a7a2e0..923d481ef 100644
--- a/config/ios/BUILD.gn
+++ b/config/ios/BUILD.gn
@@ -48,6 +48,8 @@ config("compiler") {
triplet_os = "apple-ios"
} else if (target_platform == "tvos") {
triplet_os = "apple-tvos"
+ } else if (target_platform == "xros") {
+ triplet_os = "apple-xros"
}
# Set target.
diff --git a/config/ios/ios_sdk.gni b/config/ios/ios_sdk.gni
index 9a0ea63dd..f832f4336 100644
--- a/config/ios/ios_sdk.gni
+++ b/config/ios/ios_sdk.gni
@@ -86,6 +86,16 @@ if (ios_sdk_path == "") {
} else {
assert(false, "unsupported target_environment=$target_environment")
}
+ } else if (target_platform == "xros") {
+ if (target_environment == "simulator") {
+ ios_sdk_name = "xrsimulator"
+ ios_sdk_platform = "XRSimulator"
+ } else if (target_environment == "device") {
+ ios_sdk_name = "xros"
+ ios_sdk_platform = "XROS"
+ } else {
+ assert(false, "unsupported environment: $target_environment")
+ }
} else {
assert(false, "unsupported target_platform=$target_platform")
}
diff --git a/config/ios/rules.gni b/config/ios/rules.gni
index 302d37efc..bff253b8a 100644
--- a/config/ios/rules.gni
+++ b/config/ios/rules.gni
@@ -95,7 +95,7 @@ template("ios_info_plist") {
if (defined(invoker.extra_substitutions)) {
extra_substitutions += invoker.extra_substitutions
}
- if (target_platform == "iphoneos") {
+ if (target_platform == "iphoneos" || target_platform == "xros") {
_build_info_plist = "//build/config/ios/BuildInfo.plist"
} else if (target_platform == "tvos") {
_build_info_plist = "//build/config/tvos/BuildInfo.plist"
diff --git a/config/rust.gni b/config/rust.gni
index 4b66d4e80..71048aa29 100644
--- a/config/rust.gni
+++ b/config/rust.gni
@@ -294,6 +294,16 @@ if (is_linux || is_chromeos) {
} else {
assert(false, "unsupported target_environment=$target_environment")
}
+ } else if (target_platform == "xros") {
+ if (target_environment == "simulator") {
+ rust_abi_target = "aarch64-apple-xros-sim"
+ cargo_target_abi = "sim"
+ } else if (target_environment == "device") {
+ rust_abi_target = "aarch64-apple-xros"
+ cargo_target_abi = "sim"
+ } else {
+ assert(false, "unsupported target_environment=$target_environment")
+ }
} else {
assert(false, "unsupported target_platform=$target_platform")
}
@@ -318,6 +328,13 @@ if (is_linux || is_chromeos) {
} else {
assert(false, "unsupported target_environment=$target_environment")
}
+ } else if (target_platform == "xros") {
+ if (target_environment == "simulator") {
+ rust_abi_target = "x86_64-apple-xros-sim"
+ cargo_target_abi = "sim"
+ } else {
+ assert(false, "unsupported target_environment=$target_environment")
+ }
} else {
assert(false, "unsupported target_platform=$target_platform")
}
diff --git a/toolchain/apple/toolchain.gni b/toolchain/apple/toolchain.gni
index 384375fbd..486ed32cb 100644
--- a/toolchain/apple/toolchain.gni
+++ b/toolchain/apple/toolchain.gni
@@ -459,7 +459,7 @@ template("single_apple_toolchain") {
command = "rm -f {{output}} && TOOL_VERSION=${tool_versions.filter_libtool} $python_path $script $libtool -static -D {{arflags}} -o {{output}} @$rspfile"
description = "LIBTOOL-STATIC {{output}}"
} else {
- ar = "${prefix}llvm-ar"
+ ar = "../../../third_party/llvm-build/Release+Asserts/bin/llvm-ar"
command = "\"$ar\" {{arflags}} -r -c -s -D {{output}} @$rspfile"
# Remove the output file first so that ar doesn't try to modify the