Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions bazel/external/v8.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From bc2a85e39fd55879b9baed51429c08b27d5514c8 Mon Sep 17 00:00:00 2001
From 3b6a69271801db1b1a411fb969b515c74c459f65 Mon Sep 17 00:00:00 2001
From: Matt Leon <mattleon@google.com>
Date: Wed, 16 Jul 2025 16:55:02 -0400
Subject: [PATCH 1/7] Disable pointer compression
Expand All @@ -11,10 +11,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BUILD.bazel b/BUILD.bazel
index 3f5a87d054e..0a693b7ee10 100644
index b1a54b2b42c..96c8be8901f 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -292,7 +292,7 @@ v8_int(
@@ -296,7 +296,7 @@ v8_int(
# If no explicit value for v8_enable_pointer_compression, we set it to 'none'.
v8_string(
name = "v8_enable_pointer_compression",
Expand All @@ -24,10 +24,10 @@ index 3f5a87d054e..0a693b7ee10 100644

# Default setting for v8_enable_pointer_compression.
--
2.50.0.727.gbf7dc18ff4-goog
2.52.0.457.g6b5491de43-goog


From 61898e9a63ac89a37261c081b84714cfc400a4b1 Mon Sep 17 00:00:00 2001
From aea5afcb03b19af37ed1c04cfdf294e9f4499f6b Mon Sep 17 00:00:00 2001
From: Matt Leon <mattleon@google.com>
Date: Wed, 16 Jul 2025 16:56:31 -0400
Subject: [PATCH 2/7] Restore _allowlist_function_transition
Expand All @@ -43,10 +43,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
2 files changed, 14 insertions(+)

diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index 0539ea176ac..14d7ace5e59 100644
index a7e1e2af786..ba8315bb938 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -485,6 +485,9 @@ _v8_mksnapshot = rule(
@@ -491,6 +491,9 @@ _v8_mksnapshot = rule(
cfg = "exec",
),
"target_os": attr.string(mandatory = True),
Expand Down Expand Up @@ -79,10 +79,10 @@ index 8c929454840..57336154cf7 100644
# Making this executable means it works with "$ bazel run".
executable = True,
--
2.50.0.727.gbf7dc18ff4-goog
2.52.0.457.g6b5491de43-goog


From 4a6e7158fd4ca48c75c8e33ea15760c9beea1d2f Mon Sep 17 00:00:00 2001
From 920ef0496317a512083a09caa905fbf87a01c14b Mon Sep 17 00:00:00 2001
From: Matt Leon <mattleon@google.com>
Date: Wed, 16 Jul 2025 16:56:52 -0400
Subject: [PATCH 3/7] Don't expose Wasm C API (only Wasm C++ API).
Expand All @@ -93,10 +93,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
1 file changed, 4 insertions(+)

diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc
index 05e4029f183..d705be96a16 100644
index e7cf656ade4..660ed06021d 100644
--- a/src/wasm/c-api.cc
+++ b/src/wasm/c-api.cc
@@ -2472,6 +2472,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec<Extern> {
@@ -2481,6 +2481,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec<Extern> {

} // namespace wasm

Expand All @@ -105,17 +105,17 @@ index 05e4029f183..d705be96a16 100644
// BEGIN FILE wasm-c.cc

extern "C" {
@@ -3518,3 +3520,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) {
@@ -3527,3 +3529,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) {
#undef WASM_DEFINE_SHARABLE_REF

} // extern "C"
+
+#endif
--
2.50.0.727.gbf7dc18ff4-goog
2.52.0.457.g6b5491de43-goog


From 7b593eb8086dcfe9012d4fa694d622f21dadb731 Mon Sep 17 00:00:00 2001
From f6379d9391b775f0459c3740302e435421a942c1 Mon Sep 17 00:00:00 2001
From: Matt Leon <mattleon@google.com>
Date: Wed, 16 Jul 2025 16:58:02 -0400
Subject: [PATCH 4/7] Stub out fast_float for bazel-supplied version
Expand All @@ -126,10 +126,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BUILD.bazel b/BUILD.bazel
index 0a693b7ee10..eafd9dad20c 100644
index 96c8be8901f..05630ab7035 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -4438,7 +4438,7 @@ v8_library(
@@ -4557,7 +4557,7 @@ v8_library(
],
deps = [
":lib_dragonbox",
Expand All @@ -139,10 +139,10 @@ index 0a693b7ee10..eafd9dad20c 100644
":simdutf",
":v8_libbase",
--
2.50.0.727.gbf7dc18ff4-goog
2.52.0.457.g6b5491de43-goog


From b442d34b12dd513946f509d9db86839ce8aa4d7f Mon Sep 17 00:00:00 2001
From 98a46e051afa5186a07400c53923367b9bea0ebe Mon Sep 17 00:00:00 2001
From: Matt Leon <mattleon@google.com>
Date: Wed, 16 Jul 2025 20:04:05 -0400
Subject: [PATCH 5/7] Stub out vendored dependencies for bazel-sourced versions
Expand All @@ -153,10 +153,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/BUILD.bazel b/BUILD.bazel
index eafd9dad20c..ce36666e36e 100644
index 05630ab7035..7f14a987148 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -4437,10 +4437,10 @@ v8_library(
@@ -4556,10 +4556,10 @@ v8_library(
":noicu/generated_torque_definitions",
],
deps = [
Expand All @@ -171,10 +171,10 @@ index eafd9dad20c..ce36666e36e 100644
"@abseil-cpp//absl/container:btree",
"@abseil-cpp//absl/container:flat_hash_map",
--
2.50.0.727.gbf7dc18ff4-goog
2.52.0.457.g6b5491de43-goog


From e0b8f32cc057a3c0875437d5d54d012cabcab458 Mon Sep 17 00:00:00 2001
From e3cebe8ca694935302a8c3806ab6398c593f31cd Mon Sep 17 00:00:00 2001
From: Matt Leon <mattleon@google.com>
Date: Wed, 16 Jul 2025 20:29:10 -0400
Subject: [PATCH 6/7] Add build flags to make V8 compile with GCC
Expand All @@ -185,24 +185,24 @@ Signed-off-by: Matt Leon <mattleon@google.com>
1 file changed, 3 insertions(+)

diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index 14d7ace5e59..c7a48d4e805 100644
index ba8315bb938..277a07ef63d 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -117,6 +117,9 @@ def _default_args():
"-Wno-implicit-int-float-conversion",
@@ -123,6 +123,9 @@ def _default_args():
"-Wno-deprecated-copy",
"-Wno-non-virtual-dtor",
"-Wno-unnecessary-virtual-specifier",
+ "-Wno-invalid-offsetof",
+ "-Wno-dangling-pointer",
+ "-Wno-dangling-reference",
"-isystem .",
],
"//conditions:default": [],
--
2.50.0.727.gbf7dc18ff4-goog
2.52.0.457.g6b5491de43-goog


From 7ce2d6bd14b338ab91a8636a8694b9ef180b2f90 Mon Sep 17 00:00:00 2001
From 5f9cd8cf1b1758678d41f96cd22477e052c787f8 Mon Sep 17 00:00:00 2001
From: Matt Leon <mattleon@google.com>
Date: Fri, 18 Jul 2025 17:28:42 -0400
Subject: [PATCH 7/7] Hack out atomic simd support in V8.
Expand Down Expand Up @@ -230,10 +230,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index c7a48d4e805..a73b3812882 100644
index 277a07ef63d..0617ecf1607 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -180,7 +180,7 @@ def _default_args():
@@ -186,7 +186,7 @@ def _default_args():
"Advapi32.lib",
],
"@v8//bazel/config:is_macos": ["-pthread"],
Expand All @@ -243,10 +243,10 @@ index c7a48d4e805..a73b3812882 100644
":should_add_rdynamic": ["-rdynamic"],
"//conditions:default": [],
diff --git a/src/builtins/builtins-typed-array.cc b/src/builtins/builtins-typed-array.cc
index 918cb873481..bc933e8dc1d 100644
index af505a1f729..8c41631f291 100644
--- a/src/builtins/builtins-typed-array.cc
+++ b/src/builtins/builtins-typed-array.cc
@@ -520,17 +520,21 @@ simdutf::result ArrayBufferSetFromBase64(
@@ -506,17 +506,21 @@ simdutf::result ArrayBufferSetFromBase64(
DirectHandle<JSTypedArray> typed_array, size_t& output_length) {
output_length = array_length;
simdutf::result simd_result;
Expand All @@ -268,19 +268,19 @@ index 918cb873481..bc933e8dc1d 100644

return simd_result;
}
@@ -833,15 +837,19 @@ BUILTIN(Uint8ArrayPrototypeToBase64) {
@@ -840,15 +844,19 @@ BUILTIN(Uint8ArrayPrototypeToBase64) {
// 11. Return CodePointsToString(outAscii).

size_t simd_result_size;
+#ifdef WANT_ATOMIC_REF
if (uint8array->buffer()->is_shared()) {
simd_result_size = simdutf::atomic_binary_to_base64(
std::bit_cast<const char*>(uint8array->DataPtr()), length,
reinterpret_cast<const char*>(uint8array->DataPtr()), length,
reinterpret_cast<char*>(output->GetChars(no_gc)), alphabet);
} else {
+#endif
simd_result_size = simdutf::binary_to_base64(
std::bit_cast<const char*>(uint8array->DataPtr()), length,
reinterpret_cast<const char*>(uint8array->DataPtr()), length,
reinterpret_cast<char*>(output->GetChars(no_gc)), alphabet);
+#ifdef WANT_ATOMIC_REF
}
Expand All @@ -289,7 +289,7 @@ index 918cb873481..bc933e8dc1d 100644
USE(simd_result_size);
}
diff --git a/src/objects/simd.cc b/src/objects/simd.cc
index 0ef570ceb7d..9217fa76072 100644
index ef2b8118eec..68115031f1a 100644
--- a/src/objects/simd.cc
+++ b/src/objects/simd.cc
@@ -477,6 +477,7 @@ void Uint8ArrayToHexSlow(const char* bytes, size_t length,
Expand All @@ -308,7 +308,7 @@ index 0ef570ceb7d..9217fa76072 100644

inline uint16_t ByteToHex(uint8_t byte) {
const uint16_t correction = (('a' - '0' - 10) << 8) + ('a' - '0' - 10);
@@ -645,11 +647,15 @@ Tagged<Object> Uint8ArrayToHex(const char* bytes, size_t length, bool is_shared,
@@ -647,11 +649,15 @@ Tagged<Object> Uint8ArrayToHex(const char* bytes, size_t length, bool is_shared,
}
#endif

Expand All @@ -324,7 +324,7 @@ index 0ef570ceb7d..9217fa76072 100644
return *string_output;
}

@@ -1082,12 +1088,16 @@ bool ArrayBufferFromHex(const base::Vector<T>& input_vector, bool is_shared,
@@ -1084,12 +1090,16 @@ bool ArrayBufferFromHex(const base::Vector<T>& input_vector, bool is_shared,
for (uint32_t i = 0; i < output_length * 2; i += 2) {
result = HandleRemainingHexValues(input_vector, i);
if (result.has_value()) {
Expand All @@ -342,5 +342,5 @@ index 0ef570ceb7d..9217fa76072 100644
return false;
}
--
2.50.0.727.gbf7dc18ff4-goog
2.52.0.457.g6b5491de43-goog

18 changes: 6 additions & 12 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,12 @@ def proxy_wasm_cpp_host_repositories():

# Core deps. Keep them updated.

# Note: we depend on Abseil via rules_fuzzing. Remove this pin when we update that.
#
# This is the latest LTS release, which picks up:
# - Build fix: https://github.com/abseil/abseil-cpp/pull/1187
# - A bugfix found in local fuzzing:
# https://github.com/abseil/abseil-cpp/commit/e7858c73279d81cbc005d9c76a385ab535520635
maybe(
http_archive,
name = "com_google_absl",
sha256 = "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc",
strip_prefix = "abseil-cpp-20240116.2",
urls = ["https://github.com/abseil/abseil-cpp/archive/20240116.2.tar.gz"],
sha256 = "1692f77d1739bacf3f94337188b78583cf09bab7e420d2dc6c5605a4f86785a1",
strip_prefix = "abseil-cpp-20250814.1",
urls = ["https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz"],
)

maybe(
Expand Down Expand Up @@ -216,10 +210,10 @@ def proxy_wasm_cpp_host_repositories():
maybe(
git_repository,
name = "v8",
# 13.8.258.26
commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d",
# 14.4.258.16
commit = "ad25f9ae50a53bee50f459bfee25fb1e6f64adc3",
remote = "https://chromium.googlesource.com/v8/v8",
Copy link
Contributor

@mmorel-35 mmorel-35 Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why use chromium source rather than http_archive from https://github.com/v8/v8/releases/tag/14.4.258.16 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good suggestion, I will make this change

shallow_since = "1752074621 -0700",
shallow_since = "1763411376 -0800",
patches = [
"@proxy_wasm_cpp_host//bazel/external:v8.patch",
],
Expand Down
Loading