Skip to content

Commit ef3558a

Browse files
committed
Fetch fp16 dependency of v8, and patch v8 to find it
Signed-off-by: Michael Warres <[email protected]>
1 parent 4614adf commit ef3558a

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

bazel/external/v8.patch

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
# 3. Revert v8 commit b26554ec368e9553782012c96aa5e99b163eaff2, which removed
44
# use of _allowlist_function_transition from v8 bazel/defs.bzl, since it is
55
# still required by the version of Bazel we currently use (6.5.0).
6+
# 4. Tweak where v8 looks for its fp16 dependency, since it isn't downloaded by
7+
# gn.
68

79
diff --git a/BUILD.bazel b/BUILD.bazel
8-
index 30be47fa333..d03d1e4d522 100644
10+
index 30be47fa333..093599d47df 100644
911
--- a/BUILD.bazel
1012
+++ b/BUILD.bazel
1113
@@ -220,7 +220,7 @@ v8_int(
@@ -17,6 +19,25 @@ index 30be47fa333..d03d1e4d522 100644
1719
)
1820

1921
# Default setting for v8_enable_pointer_compression.
22+
@@ -3698,13 +3698,14 @@ filegroup(
23+
24+
v8_library(
25+
name = "lib_fp16",
26+
- srcs = ["third_party/fp16/src/include/fp16.h"],
27+
+ srcs = ["@fp16//:include/fp16.h"],
28+
hdrs = [
29+
- "third_party/fp16/src/include/fp16/fp16.h",
30+
- "third_party/fp16/src/include/fp16/bitcasts.h",
31+
+ "@fp16//:include/fp16/fp16.h",
32+
+ "@fp16//:include/fp16/bitcasts.h",
33+
],
34+
+ include_prefix = "third_party/fp16/src",
35+
includes = [
36+
- "third_party/fp16/src/include",
37+
+ "@fp16//:include",
38+
],
39+
)
40+
2041
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
2142
index 520a311595e..246c4ecf27a 100644
2243
--- a/bazel/defs.bzl

bazel/repositories.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ def proxy_wasm_cpp_host_repositories():
196196
actual = "@com_google_absl//absl/container:flat_hash_set",
197197
)
198198

199+
maybe(
200+
git_repository,
201+
name = "fp16",
202+
commit = "0a92994d729ff76a58f692d3028ca1b64b145d91",
203+
build_file_content = "exports_files(glob([\"**\"]))",
204+
remote = "https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git",
205+
)
206+
199207
# WAMR with dependencies.
200208

201209
maybe(

0 commit comments

Comments
 (0)