mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-16 05:38:57 +00:00
103 lines
3.6 KiB
Diff
103 lines
3.6 KiB
Diff
From https://chromium-review.googlesource.com/c/v8/v8/+/7769990
|
|
From: Tmalone1250 <malonetrevor12@gmail.com>
|
|
Date: Wed, 15 Apr 2026 21:07:53 -0500
|
|
Subject: [PATCH] build, v8: fix Temporal compilation with system or no ICU
|
|
|
|
---
|
|
deps/v8/src/objects/js-temporal-zoneinfo64.cc | 11 ++++--
|
|
tools/v8_gypfiles/v8.gyp | 37 +++++++++++++++++++
|
|
2 files changed, 44 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/deps/v8/src/objects/js-temporal-zoneinfo64.cc b/deps/v8/src/objects/js-temporal-zoneinfo64.cc
|
|
index 99dd3a84c1e54f..149138671e0770 100644
|
|
--- a/deps/v8/src/objects/js-temporal-zoneinfo64.cc
|
|
+++ b/deps/v8/src/objects/js-temporal-zoneinfo64.cc
|
|
@@ -10,9 +10,12 @@
|
|
#include "temporal_rs/Provider.hpp"
|
|
#include "temporal_rs/TimeZone.hpp"
|
|
|
|
-#ifdef V8_INTL_SUPPORT
|
|
+#if defined(V8_INTL_SUPPORT) && defined(__has_include) && __has_include("udatamem.h")
|
|
#include "udatamem.h"
|
|
-#else
|
|
+#define V8_TEMPORAL_USE_ICU_RAW_MEMORY
|
|
+#endif
|
|
+
|
|
+#ifndef V8_TEMPORAL_USE_ICU_RAW_MEMORY
|
|
// Defined in builtins-temporal-zoneinfo64-data.cc, generated by
|
|
// include-file-as-bytes.py
|
|
extern "C" uint32_t zoneinfo64_static_data[];
|
|
@@ -22,7 +25,7 @@ extern "C" size_t zoneinfo64_static_data_len;
|
|
namespace v8::internal {
|
|
|
|
ZoneInfo64Provider::ZoneInfo64Provider() {
|
|
-#ifdef V8_INTL_SUPPORT
|
|
+#ifdef V8_TEMPORAL_USE_ICU_RAW_MEMORY
|
|
UErrorCode status = U_ZERO_ERROR;
|
|
memory = udata_open(0, "res", "zoneinfo64", &status);
|
|
if (U_FAILURE(status)) {
|
|
@@ -74,7 +77,7 @@ ZoneInfo64Provider::~ZoneInfo64Provider() {
|
|
|
|
// Then clean up memory
|
|
// This ideally is a no-op when using static data
|
|
-#ifdef V8_INTL_SUPPORT
|
|
+#ifdef V8_TEMPORAL_USE_ICU_RAW_MEMORY
|
|
if (memory) {
|
|
udata_close(memory);
|
|
}
|
|
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
|
|
index e09fcc1ce8c59f..2f0fd30771881b 100644
|
|
--- a/tools/v8_gypfiles/v8.gyp
|
|
+++ b/tools/v8_gypfiles/v8.gyp
|
|
@@ -1379,6 +1379,9 @@
|
|
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_i18n_support.*?sources -= ")',
|
|
],
|
|
}],
|
|
+ ['v8_enable_temporal_support==1', {
|
|
+ 'dependencies': ['make_temporal_zoneinfo_cpp'],
|
|
+ }],
|
|
['v8_postmortem_support', {
|
|
'dependencies': ['postmortem-metadata#target'],
|
|
}],
|
|
@@ -1955,6 +1958,40 @@
|
|
"<(V8_ROOT)/src/regexp/special-case.h",
|
|
],
|
|
}, # gen-regexp-special-case
|
|
+ {
|
|
+ 'target_name': 'make_temporal_zoneinfo_cpp',
|
|
+ 'type': 'none',
|
|
+ 'toolsets': ['host', 'target'],
|
|
+ 'conditions': [
|
|
+ ['v8_enable_temporal_support==1', {
|
|
+ 'actions': [
|
|
+ {
|
|
+ 'action_name': 'make_temporal_zoneinfo_cpp_action',
|
|
+ 'inputs': [
|
|
+ '<(V8_ROOT)/tools/include-file-as-bytes.py',
|
|
+ '<(V8_ROOT)/../crates/vendor/zoneinfo64/src/data/zoneinfo64.res',
|
|
+ ],
|
|
+ 'outputs': [
|
|
+ '<(SHARED_INTERMEDIATE_DIR)/src/builtins/builtins-temporal-zoneinfo64-data.cc',
|
|
+ ],
|
|
+ 'action': [
|
|
+ '<(python)',
|
|
+ '<(V8_ROOT)/tools/include-file-as-bytes.py',
|
|
+ '<(V8_ROOT)/../crates/vendor/zoneinfo64/src/data/zoneinfo64.res',
|
|
+ '<@(_outputs)',
|
|
+ 'zoneinfo64_static_data',
|
|
+ ],
|
|
+ 'message': 'Generating temporal zoneinfo static data',
|
|
+ },
|
|
+ ],
|
|
+ }],
|
|
+ ],
|
|
+ 'direct_dependent_settings': {
|
|
+ 'sources': [
|
|
+ '<(SHARED_INTERMEDIATE_DIR)/src/builtins/builtins-temporal-zoneinfo64-data.cc',
|
|
+ ],
|
|
+ },
|
|
+ },
|
|
{
|
|
'target_name': 'run_gen-regexp-special-case',
|
|
'type': 'none',
|