From f5a7024c0f846834fbf1340808f2ea8ec03b8cc3 Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Tue, 9 Dec 2025 15:25:06 -0500 Subject: [PATCH] `v8`: update to 14.3.127.16 Signed-off-by: Matt Leon --- bazel/external/v8.patch | 76 ++++++++++++++++++++--------------------- bazel/repositories.bzl | 24 +++++-------- 2 files changed, 47 insertions(+), 53 deletions(-) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index a124cf9a..c665acbb 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -1,4 +1,4 @@ -From bc2a85e39fd55879b9baed51429c08b27d5514c8 Mon Sep 17 00:00:00 2001 +From 2626f194c5368aa51b93e4d558dcc4de493ad9a0 Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Wed, 16 Jul 2025 16:55:02 -0400 Subject: [PATCH 1/7] Disable pointer compression @@ -11,10 +11,10 @@ Signed-off-by: Matt Leon 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel -index 3f5a87d054e..0a693b7ee10 100644 +index d49da552c42..02a599386f4 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", @@ -24,10 +24,10 @@ index 3f5a87d054e..0a693b7ee10 100644 # Default setting for v8_enable_pointer_compression. -- -2.50.0.727.gbf7dc18ff4-goog +2.52.0.239.gd5f0c6e74e-goog -From 61898e9a63ac89a37261c081b84714cfc400a4b1 Mon Sep 17 00:00:00 2001 +From cbc8ec687fda83030be2e322e5ccd96058b21a9f Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Wed, 16 Jul 2025 16:56:31 -0400 Subject: [PATCH 2/7] Restore _allowlist_function_transition @@ -43,10 +43,10 @@ Signed-off-by: Matt Leon 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), @@ -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.239.gd5f0c6e74e-goog -From 4a6e7158fd4ca48c75c8e33ea15760c9beea1d2f Mon Sep 17 00:00:00 2001 +From 670535cf36232fd6907979941b4df47fdd85f54a Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Wed, 16 Jul 2025 16:56:52 -0400 Subject: [PATCH 3/7] Don't expose Wasm C API (only Wasm C++ API). @@ -93,10 +93,10 @@ Signed-off-by: Matt Leon 1 file changed, 4 insertions(+) diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc -index 05e4029f183..d705be96a16 100644 +index 0f8a374840b..b8dd6bf12cd 100644 --- a/src/wasm/c-api.cc +++ b/src/wasm/c-api.cc -@@ -2472,6 +2472,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec { +@@ -2480,6 +2480,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec { } // namespace wasm @@ -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) { +@@ -3526,3 +3528,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.239.gd5f0c6e74e-goog -From 7b593eb8086dcfe9012d4fa694d622f21dadb731 Mon Sep 17 00:00:00 2001 +From ebdb202f6d6a3182afbdfa50167323d0794f56ec Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Wed, 16 Jul 2025 16:58:02 -0400 Subject: [PATCH 4/7] Stub out fast_float for bazel-supplied version @@ -126,10 +126,10 @@ Signed-off-by: Matt Leon 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD.bazel b/BUILD.bazel -index 0a693b7ee10..eafd9dad20c 100644 +index 02a599386f4..96326070dc1 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -4438,7 +4438,7 @@ v8_library( +@@ -4531,7 +4531,7 @@ v8_library( ], deps = [ ":lib_dragonbox", @@ -139,10 +139,10 @@ index 0a693b7ee10..eafd9dad20c 100644 ":simdutf", ":v8_libbase", -- -2.50.0.727.gbf7dc18ff4-goog +2.52.0.239.gd5f0c6e74e-goog -From b442d34b12dd513946f509d9db86839ce8aa4d7f Mon Sep 17 00:00:00 2001 +From c9c069992e9472b0d91203bddea083d264ef1317 Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Wed, 16 Jul 2025 20:04:05 -0400 Subject: [PATCH 5/7] Stub out vendored dependencies for bazel-sourced versions @@ -153,10 +153,10 @@ Signed-off-by: Matt Leon 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BUILD.bazel b/BUILD.bazel -index eafd9dad20c..ce36666e36e 100644 +index 96326070dc1..48b2824c107 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -4437,10 +4437,10 @@ v8_library( +@@ -4530,10 +4530,10 @@ v8_library( ":noicu/generated_torque_definitions", ], deps = [ @@ -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.239.gd5f0c6e74e-goog -From e0b8f32cc057a3c0875437d5d54d012cabcab458 Mon Sep 17 00:00:00 2001 +From b4050d95d32dbcbd43d3c205b8b424d43757becd Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Wed, 16 Jul 2025 20:29:10 -0400 Subject: [PATCH 6/7] Add build flags to make V8 compile with GCC @@ -185,13 +185,13 @@ Signed-off-by: Matt Leon 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", @@ -199,10 +199,10 @@ index 14d7ace5e59..c7a48d4e805 100644 ], "//conditions:default": [], -- -2.50.0.727.gbf7dc18ff4-goog +2.52.0.239.gd5f0c6e74e-goog -From 7ce2d6bd14b338ab91a8636a8694b9ef180b2f90 Mon Sep 17 00:00:00 2001 +From 1d9136af513e84f9874f3b816159e9d5f67cc66e Mon Sep 17 00:00:00 2001 From: Matt Leon Date: Fri, 18 Jul 2025 17:28:42 -0400 Subject: [PATCH 7/7] Hack out atomic simd support in V8. @@ -230,10 +230,10 @@ Signed-off-by: Matt Leon 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"], @@ -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 146e3f28541..4924e8137c4 100644 --- a/src/builtins/builtins-typed-array.cc +++ b/src/builtins/builtins-typed-array.cc -@@ -520,17 +520,21 @@ simdutf::result ArrayBufferSetFromBase64( +@@ -505,17 +505,21 @@ simdutf::result ArrayBufferSetFromBase64( DirectHandle typed_array, size_t& output_length) { output_length = array_length; simdutf::result simd_result; @@ -268,19 +268,19 @@ index 918cb873481..bc933e8dc1d 100644 return simd_result; } -@@ -833,15 +837,19 @@ BUILTIN(Uint8ArrayPrototypeToBase64) { +@@ -835,15 +839,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(uint8array->DataPtr()), length, + reinterpret_cast(uint8array->DataPtr()), length, reinterpret_cast(output->GetChars(no_gc)), alphabet); } else { +#endif simd_result_size = simdutf::binary_to_base64( - std::bit_cast(uint8array->DataPtr()), length, + reinterpret_cast(uint8array->DataPtr()), length, reinterpret_cast(output->GetChars(no_gc)), alphabet); +#ifdef WANT_ATOMIC_REF } @@ -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, @@ -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 Uint8ArrayToHex(const char* bytes, size_t length, bool is_shared, +@@ -647,11 +649,15 @@ Tagged Uint8ArrayToHex(const char* bytes, size_t length, bool is_shared, } #endif @@ -324,7 +324,7 @@ index 0ef570ceb7d..9217fa76072 100644 return *string_output; } -@@ -1082,12 +1088,16 @@ bool ArrayBufferFromHex(const base::Vector& input_vector, bool is_shared, +@@ -1084,12 +1090,16 @@ bool ArrayBufferFromHex(const base::Vector& 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()) { @@ -342,5 +342,5 @@ index 0ef570ceb7d..9217fa76072 100644 return false; } -- -2.50.0.727.gbf7dc18ff4-goog +2.52.0.239.gd5f0c6e74e-goog diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 09939a70..aba3e23e 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -43,9 +43,9 @@ def proxy_wasm_cpp_host_repositories(): maybe( http_archive, name = "rules_cc", - sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", - strip_prefix = "rules_cc-0.0.9", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], + sha256 = "b8b918a85f9144c01f6cfe0f45e4f2838c7413961a8ff23bc0c6cdf8bb07a3b6", + strip_prefix = "rules_cc-0.1.5", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.1.5/rules_cc-0.1.5.tar.gz"], ) maybe( @@ -112,18 +112,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( @@ -177,10 +171,10 @@ def proxy_wasm_cpp_host_repositories(): maybe( git_repository, name = "v8", - # 13.8.258.26 - commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d", + # 14.3.127.16 + commit = "beee9f5cafde91bbd086077a11db16cb9768e62a", remote = "https://chromium.googlesource.com/v8/v8", - shallow_since = "1752074621 -0400", + shallow_since = "1752074621 -0700", patches = [ "@proxy_wasm_cpp_host//bazel/external:v8.patch", ],