-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchromium.build.visionos.patch
147 lines (140 loc) · 5.33 KB
/
chromium.build.visionos.patch
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
diff --git a/config/apple/codesign.py b/config/apple/codesign.py
index be6afb5af..c6795656e 100644
--- a/config/apple/codesign.py
+++ b/config/apple/codesign.py
@@ -91,6 +91,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 3c1219b32..6c269316e 100644
--- a/config/apple/mobile_config.gni
+++ b/config/apple/mobile_config.gni
@@ -9,6 +9,7 @@ declare_args() {
# default is only there for compatibility reasons and will be removed (see
# crbug.com/1138425 for more details).
target_environment = ""
+ target_os_variation = ""
# Control whether codesiging is enabled (ignored for simulator builds).
# TODO(crbug.com/378918882): Prefix with apple_mobile_ instead of ios_.
diff --git a/config/apple/sdk_info.py b/config/apple/sdk_info.py
index 3308c10a9..563616648 100755
--- a/config/apple/sdk_info.py
+++ b/config/apple/sdk_info.py
@@ -136,7 +136,7 @@ def main():
parser.add_argument('platform',
choices=[
'iphoneos', 'iphonesimulator', 'macosx', 'watchos',
- 'watchsimulator'
+ 'watchsimulator', 'xros', 'xrsimulator'
])
args = parser.parse_args()
if args.developer_dir:
diff --git a/config/clang/BUILD.gn b/config/clang/BUILD.gn
index f27d52c3b..1ddf4cc77 100644
--- a/config/clang/BUILD.gn
+++ b/config/clang/BUILD.gn
@@ -216,7 +216,13 @@ clang_lib("compiler_builtins") {
if (is_mac) {
libname = "osx"
} else if (is_ios) {
- if (target_environment == "simulator") {
+ if (target_os_variation == "visionos") {
+ if (target_environment == "simulator") {
+ libname = "xrossim"
+ } else {
+ libname = "xros"
+ }
+ } else if (target_environment == "simulator") {
libname = "iossim"
} else if (target_environment == "catalyst") {
libname = "osx"
diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn
index fccd8daec..065eb3462 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" ]
@@ -1927,6 +1909,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 8a912beb1..cf7f711d2 100644
--- a/config/ios/BUILD.gn
+++ b/config/ios/BUILD.gn
@@ -42,7 +42,11 @@ config("compiler") {
}
# OS.
- triplet_os = "apple-ios"
+ if (target_os_variation == "visionos") {
+ triplet_os = "apple-xros"
+ } else {
+ triplet_os = "apple-ios"
+ }
# Set target.
common_flags = [
diff --git a/config/ios/ios_sdk.gni b/config/ios/ios_sdk.gni
index 448f82718..b7641a183 100644
--- a/config/ios/ios_sdk.gni
+++ b/config/ios/ios_sdk.gni
@@ -63,7 +63,17 @@ ios_use_xcode_symlinks =
if (ios_sdk_path == "") {
# Compute default target.
- if (target_environment == "simulator") {
+ if (target_os_variation == "visionos") {
+ 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 if (target_environment == "simulator") {
ios_sdk_name = "iphonesimulator"
ios_sdk_platform = "iPhoneSimulator"
} else if (target_environment == "device") {
diff --git a/toolchain/apple/toolchain.gni b/toolchain/apple/toolchain.gni
index 5cf427c25..d35cceebe 100644
--- a/toolchain/apple/toolchain.gni
+++ b/toolchain/apple/toolchain.gni
@@ -450,7 +450,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