Skip to content

Commit 7a25b87

Browse files
committed
Set torque generator path to location where Bazel can find outputs
Signed-off-by: Michael Warres <[email protected]>
1 parent ef3558a commit 7a25b87

File tree

1 file changed

+76
-2
lines changed

1 file changed

+76
-2
lines changed

bazel/external/v8.patch

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# still required by the version of Bazel we currently use (6.5.0).
66
# 4. Tweak where v8 looks for its fp16 dependency, since it isn't downloaded by
77
# gn.
8+
# 5. Set torque generator path to location where Bazel can find outputs.
89

910
diff --git a/BUILD.bazel b/BUILD.bazel
1011
index 30be47fa333..093599d47df 100644
@@ -39,10 +40,72 @@ index 30be47fa333..093599d47df 100644
3940
)
4041

4142
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
42-
index 520a311595e..246c4ecf27a 100644
43+
index 520a311595e..06cc7806203 100644
4344
--- a/bazel/defs.bzl
4445
+++ b/bazel/defs.bzl
45-
@@ -480,6 +480,9 @@ _v8_mksnapshot = rule(
46+
@@ -6,8 +6,10 @@
47+
This module contains helper functions to compile V8.
48+
"""
49+
50+
-FlagInfo = provider("The value of an option.",
51+
-fields = ["value"])
52+
+FlagInfo = provider(
53+
+ "The value of an option.",
54+
+ fields = ["value"],
55+
+)
56+
57+
def _options_impl(ctx):
58+
return FlagInfo(value = ctx.build_setting_value)
59+
@@ -109,7 +111,7 @@ def _default_args():
60+
"-Werror",
61+
"-Wextra",
62+
"-Wno-unneeded-internal-declaration",
63+
- "-Wno-unknown-warning-option", # b/330781959
64+
+ "-Wno-unknown-warning-option", # b/330781959
65+
"-Wno-cast-function-type-mismatch", # b/330781959
66+
"-Wno-bitwise-instead-of-logical",
67+
"-Wno-builtin-assume-aligned-alignment",
68+
@@ -160,7 +162,7 @@ def _default_args():
69+
"-fno-integrated-as",
70+
],
71+
"//conditions:default": [],
72+
- }) + select({
73+
+ }) + select({
74+
"@v8//bazel/config:is_opt_android": [
75+
"-fvisibility=hidden",
76+
"-fvisibility-inlines-hidden",
77+
@@ -192,7 +194,7 @@ ENABLE_I18N_SUPPORT_DEFINES = [
78+
]
79+
80+
def _should_emit_noicu_and_icu(noicu_srcs, noicu_deps, noicu_defines, icu_srcs, icu_deps, icu_defines):
81+
- return noicu_srcs != [] or noicu_deps != [] or noicu_defines != [] or icu_srcs != [] or icu_deps != [] or icu_defines != []
82+
+ return noicu_srcs != [] or noicu_deps != [] or noicu_defines != [] or icu_srcs != [] or icu_deps != [] or icu_defines != []
83+
84+
# buildifier: disable=function-docstring
85+
def v8_binary(
86+
@@ -316,7 +318,7 @@ def v8_library(
87+
# split the set of outputs by using OutputGroupInfo, that way we do not need to
88+
# run the torque generator twice.
89+
def _torque_files_impl(ctx):
90+
- v8root = "."
91+
+ v8root = "external/v8"
92+
93+
# Arguments
94+
args = []
95+
@@ -408,9 +410,9 @@ def v8_torque_files(name, noicu_srcs, icu_srcs, args, definition_extras, initial
96+
}),
97+
)
98+
99+
-def _v8_target_cpu_transition_impl(settings,
100+
- attr, # @unused
101+
- ):
102+
+def _v8_target_cpu_transition_impl(
103+
+ settings,
104+
+ attr): # @unused
105+
# Check for an existing v8_target_cpu flag.
106+
if "@v8//bazel/config:v8_target_cpu" in settings:
107+
if settings["@v8//bazel/config:v8_target_cpu"] != "none":
108+
@@ -480,6 +482,9 @@ _v8_mksnapshot = rule(
46109
cfg = "exec",
47110
),
48111
"target_os": attr.string(mandatory = True),
@@ -52,6 +115,17 @@ index 520a311595e..246c4ecf27a 100644
52115
"prefix": attr.string(mandatory = True),
53116
"suffix": attr.string(mandatory = True),
54117
},
118+
@@ -529,8 +534,8 @@ def _json(kv_pairs):
119+
120+
def build_config_content(cpu, icu):
121+
arch = cpu
122+
- if cpu == 'x86':
123+
- arch = 'ia32'
124+
+ if cpu == "x86":
125+
+ arch = "ia32"
126+
return _json([
127+
("arch", arch),
128+
("asan", "false"),
55129
diff --git a/bazel/v8-non-pointer-compression.bzl b/bazel/v8-non-pointer-compression.bzl
56130
index 8c929454840..57336154cf7 100644
57131
--- a/bazel/v8-non-pointer-compression.bzl

0 commit comments

Comments
 (0)