v8: update to 14.0.210

- rebase some patches
- disable external startup data (using internal instead)
- enable monolithic library
This commit is contained in:
Raed Rizqie 2025-07-07 01:30:34 +08:00 committed by Maksim Bondarenkov
parent 4874b89c5e
commit bf99396a2e
17 changed files with 1028 additions and 770 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,29 @@
diff --git a/.gn b/.gn
index e13ae6d5..332b811a 100644
--- a/.gn
+++ b/.gn
@@ -41,5 +41,5 @@ default_args = {
# These are the list of GN files that run exec_script. This whitelist exists
# to force additional review for new uses of exec_script, which is strongly
# discouraged except for gypi_to_gn calls.
-exec_script_allowlist = build_dotfile_settings.exec_script_allowlist +
- [ "//build_overrides/build.gni" ]
+#exec_script_allowlist = build_dotfile_settings.exec_script_allowlist +
+# [ "//build_overrides/build.gni" ]
diff --git a/BUILD.gn b/BUILD.gn
index 2cc9e36..8c70f78 100644
index 905d947c..01f1f415 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -39,10 +39,10 @@ declare_args() {
v8_enable_future = false
@@ -26,7 +26,7 @@ if (is_ios) {
}
# Sets -DENABLE_SYSTEM_INSTRUMENTATION. Enables OS-dependent event tracing
- v8_enable_system_instrumentation = (is_win || is_mac) && !v8_use_perfetto
+ v8_enable_system_instrumentation = (is_msvc || is_mac) && !v8_use_perfetto
# For faster Windows builds. See https://crbug.com/v8/8475.
-emit_builtins_as_inline_asm = is_win && is_clang
+emit_builtins_as_inline_asm = is_msvc && is_clang
# Sets -DV8_ENABLE_ETW_STACK_WALKING. Enables ETW Stack Walking
- v8_enable_etw_stack_walking = is_win
+ v8_enable_etw_stack_walking = is_msvc
# Sets the GUID for the ETW provider
v8_etw_guid = ""
@@ -1363,7 +1363,12 @@ config("toolchain") {
declare_args() {
# Print to stdout on Android.
@@ -1633,12 +1633,16 @@ config("toolchain") {
defines += [ "V8_TARGET_ARCH_IA32" ]
if (is_win) {
# Ensure no surprising artifacts from 80bit double math with x86.
@ -24,25 +32,17 @@ index 2cc9e36..8c70f78 100644
+ cflags += [ "/arch:SSE2" ]
+ } else {
+ cflags += [ "-msse2" ]
+ defines += [ "V8_SWISS_TABLE_HAVE_SSE2_HOST=1" ]
+ }
}
}
if (v8_current_cpu == "x64") {
@@ -1372,7 +1377,11 @@ config("toolchain") {
defines += [ "V8_TARGET_ARCH_X64" ]
- if (is_win) {
+ if (is_msvc) {
# Increase the initial stack size. The default is 1MB, this is 2MB. This
# applies only to executables and shared libraries produced by V8 since
# ldflags are not pushed to dependants.
- ldflags += [ "/STACK:2097152" ]
+ if (is_msvc) {
+ ldflags += [ "/STACK:2097152" ]
+ } else {
+ ldflags += [ "-Wl,--stack,2097152" ]
+ }
}
}
if (is_android && v8_android_log_stdout) {
@@ -1430,7 +1439,7 @@ config("toolchain") {
@@ -1670,7 +1674,7 @@ config("toolchain") {
}
if (v8_no_inline) {
@ -51,34 +51,7 @@ index 2cc9e36..8c70f78 100644
cflags += [ "/Ob0" ]
} else {
cflags += [
@@ -1474,7 +1483,7 @@ config("toolchain") {
]
}
- if (is_win) {
+ if (is_msvc) {
cflags += [
"/wd4245", # Conversion with signed/unsigned mismatch.
"/wd4267", # Conversion with possible loss of data.
@@ -1496,7 +1505,7 @@ config("toolchain") {
]
}
- if (!is_clang && is_win) {
+ if (!is_clang && is_msvc) {
cflags += [
"/wd4506", # Benign "no definition for inline function"
@@ -1637,7 +1646,7 @@ config("toolchain") {
]
}
- if (!is_clang && !is_win) {
+ if (!is_clang && !is_msvc) {
cflags += [
# Disable gcc warnings for optimizations based on the assumption that
# signed overflow does not occur. Generates false positives (see
@@ -6158,9 +6167,9 @@ v8_component("v8_libbase") {
@@ -6858,9 +6862,9 @@ v8_component("v8_libbase") {
defines += [ "_CRT_RAND_S" ] # for rand_s()
libs = [
@ -91,21 +64,34 @@ index 2cc9e36..8c70f78 100644
]
if (v8_enable_etw_stack_walking) {
@@ -6374,7 +6383,7 @@ v8_source_set("v8_heap_base") {
"src/heap/base/worklist.cc",
@@ -7089,7 +7093,7 @@ v8_source_set("v8_heap_base") {
]
- if (is_clang || !is_win) {
+ if (is_clang || !is_msvc) {
if (current_cpu == "x64") {
sources += [ "src/heap/base/asm/x64/push_registers_asm.cc" ]
} else if (current_cpu == "x86") {
@@ -6394,7 +6403,7 @@ v8_source_set("v8_heap_base") {
} else if (current_cpu == "riscv64" || current_cpu == "riscv32") {
sources += [ "src/heap/base/asm/riscv/push_registers_asm.cc" ]
}
- } else if (is_win) {
+ } else if (is_msvc) {
if (current_cpu == "x64") {
if (current_cpu == "x64") {
- if (is_win) {
+ if (is_msvc) {
# Prefer a masm version with unwind directives.
sources += [ "src/heap/base/asm/x64/push_registers_masm.asm" ]
} else if (current_cpu == "x86") {
} else {
@@ -7495,7 +7499,7 @@ if (current_toolchain == v8_snapshot_toolchain) {
# disable it while taking a V8 snapshot.
config("disable_icf") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
- if (is_win) {
+ if (is_msvc) {
ldflags = [ "/OPT:NOICF" ] # link.exe, but also lld-link.exe.
} else if (is_apple && !use_lld) {
ldflags = [ "-Wl,-no_deduplicate" ] # ld64.
diff --git a/gni/v8.gni b/gni/v8.gni
index f13f530b..a8aa6d0b 100644
--- a/gni/v8.gni
+++ b/gni/v8.gni
@@ -333,7 +333,7 @@ if (target_cpu == "mips64el" || target_cpu == "mips64") {
v8_add_configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
-if (!build_with_chromium && is_clang) {
+if (!build_with_chromium && is_clang && !is_mingw) {
v8_remove_configs += [ "//build/config/clang:find_bad_constructs" ]
}

View File

@ -1,8 +1,8 @@
diff --git a/src/base/macros.h b/src/base/macros.h
index 25a533c..fe2f37a 100644
index e5e020d9..53af2187 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -266,8 +266,12 @@ V8_INLINE A implicit_cast(A x) {
@@ -316,8 +316,12 @@ V8_INLINE A implicit_cast(A x) {
# else
# define V8_PTR_PREFIX ""
# endif // V8_HOST_ARCH_64_BIT
@ -18,10 +18,10 @@ index 25a533c..fe2f37a 100644
# define V8_PTR_PREFIX "l"
#else
diff --git a/src/base/platform/platform-win32.cc b/src/base/platform/platform-win32.cc
index 152fbbf..e711182 100644
index 11402689..ae2d7c08 100644
--- a/src/base/platform/platform-win32.cc
+++ b/src/base/platform/platform-win32.cc
@@ -77,7 +77,6 @@ inline void MemoryFence() {
@@ -81,7 +81,6 @@ inline void MemoryFence() {
__asm__ __volatile__("xchgl %%eax,%0 ":"=r" (barrier));
}
@ -29,7 +29,7 @@ index 152fbbf..e711182 100644
int localtime_s(tm* out_tm, const time_t* time) {
@@ -130,6 +129,7 @@ int strncpy_s(char* dest, size_t dest_size, const char* source, size_t count) {
@@ -134,6 +133,7 @@ int strncpy_s(char* dest, size_t dest_size, const char* source, size_t count) {
return 0;
}
@ -37,3 +37,73 @@ index 152fbbf..e711182 100644
#endif // __MINGW32__
namespace v8 {
diff --git a/src/bigint/mul-karatsuba.cc b/src/bigint/mul-karatsuba.cc
index 7df03401..67691f03 100644
--- a/src/bigint/mul-karatsuba.cc
+++ b/src/bigint/mul-karatsuba.cc
@@ -48,7 +48,7 @@ uint32_t RoundUpLen(uint32_t len) {
// Round up, unless we're only just above the threshold. This smoothes
// the steps by which time goes up as input size increases.
uint32_t additive = ((1 << shift) - 1);
- if (shift >= 2 && (len & additive) < (1 << (shift - 2))) {
+ if (shift >= 2 && ((int)len & (int)additive) < (1 << (shift - 2))) {
return len;
}
return ((len + additive) >> shift) << shift;
diff --git a/src/libplatform/default-platform.cc b/src/libplatform/default-platform.cc
index 09ef613a..791adfa2 100644
--- a/src/libplatform/default-platform.cc
+++ b/src/libplatform/default-platform.cc
@@ -24,10 +24,12 @@ namespace platform {
namespace {
void PrintStackTrace() {
+#ifdef DEBUG
v8::base::debug::StackTrace trace;
trace.Print();
// Avoid dumping duplicate stack trace on abort signal.
v8::base::debug::DisableSignalStackDump();
+#endif
}
constexpr int kMaxThreadPoolSize = 16;
@@ -47,9 +49,11 @@ std::unique_ptr<v8::Platform> NewDefaultPlatform(
InProcessStackDumping in_process_stack_dumping,
std::unique_ptr<v8::TracingController> tracing_controller,
PriorityMode priority_mode) {
+#ifdef DEBUG
if (in_process_stack_dumping == InProcessStackDumping::kEnabled) {
v8::base::debug::EnableInProcessStackDumping();
}
+#endif
thread_pool_size = GetActualThreadPoolSize(thread_pool_size);
auto platform = std::make_unique<DefaultPlatform>(
thread_pool_size, idle_task_support, std::move(tracing_controller),
@@ -61,9 +65,11 @@ std::unique_ptr<v8::Platform> NewSingleThreadedDefaultPlatform(
IdleTaskSupport idle_task_support,
InProcessStackDumping in_process_stack_dumping,
std::unique_ptr<v8::TracingController> tracing_controller) {
+#ifdef DEBUG
if (in_process_stack_dumping == InProcessStackDumping::kEnabled) {
v8::base::debug::EnableInProcessStackDumping();
}
+#endif
auto platform = std::make_unique<DefaultPlatform>(
0, idle_task_support, std::move(tracing_controller));
return platform;
diff --git a/src/objects/swiss-hash-table-helpers.h b/src/objects/swiss-hash-table-helpers.h
index f346c333..c5a0ba0f 100644
--- a/src/objects/swiss-hash-table-helpers.h
+++ b/src/objects/swiss-hash-table-helpers.h
@@ -20,8 +20,9 @@
// The following #defines are taken from Abseil's have_sse.h (but renamed).
#ifndef V8_SWISS_TABLE_HAVE_SSE2_HOST
#if (defined(__SSE2__) || \
- (defined(_MSC_VER) && \
- (defined(_M_X64) || (defined(_M_IX86) && _M_IX86_FP >= 2))))
+ (defined(_WIN32) && \
+ (defined(__x86_64__) || defined(__i686__) || \
+ defined(_M_X64) || (defined(_M_IX86) && _M_IX86_FP >= 2))))
#define V8_SWISS_TABLE_HAVE_SSE2_HOST 1
#else
#define V8_SWISS_TABLE_HAVE_SSE2_HOST 0

View File

@ -1,8 +1,8 @@
diff --git a/src/base/macros.h b/src/base/macros.h
index 25a533c..324df63 100644
index e5e020d9..e9ee1e30 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -176,7 +176,7 @@ V8_INLINE Dest bit_cast(Source const& source) {
@@ -199,7 +199,7 @@ V8_INLINE Dest bit_cast(Source const& source) {
// DISABLE_CFI_ICALL -- Disable Control Flow Integrity indirect call checks,
// useful because calls into JITed code can not be CFI verified. Same for
// UBSan's function pointer type checks.
@ -12,10 +12,10 @@ index 25a533c..324df63 100644
#define DISABLE_CFI_ICALL \
V8_CLANG_NO_SANITIZE("cfi-icall") \
diff --git a/src/profiler/heap-snapshot-generator.cc b/src/profiler/heap-snapshot-generator.cc
index a9fd215..d8c5693 100644
index 40ee39d7..fda19f27 100644
--- a/src/profiler/heap-snapshot-generator.cc
+++ b/src/profiler/heap-snapshot-generator.cc
@@ -411,11 +411,11 @@ HeapSnapshot::HeapSnapshot(HeapProfiler* profiler,
@@ -427,11 +427,11 @@ HeapSnapshot::HeapSnapshot(HeapProfiler* profiler,
static_assert(kSystemPointerSize != 4 || sizeof(HeapGraphEdge) == 12);
static_assert(kSystemPointerSize != 8 || sizeof(HeapGraphEdge) == 24);
static_assert(kSystemPointerSize != 4 || sizeof(HeapEntry) == 32);

View File

@ -1,8 +1,8 @@
diff --git a/include/v8config.h b/include/v8config.h
index 33bb3f9..546830d 100644
index 57b537e6..e3467c72 100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -340,6 +340,13 @@ path. Add it with -I<path> to the command line
@@ -372,6 +372,13 @@ path. Add it with -I<path> to the command line
#if defined(__GNUC__) // Clang in gcc mode.
# define V8_CC_GNU 1
@ -16,7 +16,7 @@ index 33bb3f9..546830d 100644
#endif
# define V8_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
@@ -749,7 +756,7 @@ V8 shared library set USING_V8_SHARED.
@@ -870,7 +877,7 @@ V8 shared library set USING_V8_SHARED.
#elif defined(_M_IX86) || defined(__i386__)
#define V8_HOST_ARCH_IA32 1
#define V8_HOST_ARCH_32_BIT 1
@ -25,7 +25,7 @@ index 33bb3f9..546830d 100644
#define V8_HOST_ARCH_ARM64 1
#define V8_HOST_ARCH_64_BIT 1
#elif defined(__ARMEL__)
@@ -802,7 +809,7 @@ V8 shared library set USING_V8_SHARED.
@@ -916,7 +923,7 @@ V8 shared library set USING_V8_SHARED.
#define V8_TARGET_ARCH_X64 1
#elif defined(_M_IX86) || defined(__i386__)
#define V8_TARGET_ARCH_IA32 1
@ -34,4 +34,3 @@ index 33bb3f9..546830d 100644
#define V8_TARGET_ARCH_ARM64 1
#elif defined(__ARMEL__)
#define V8_TARGET_ARCH_ARM 1

View File

@ -1,17 +1,17 @@
diff --git a/src/base/platform/time.cc b/src/base/platform/time.cc
index b6da0a6..b1f5a55 100644
index c2d36cc2..0b724fcc 100644
--- a/src/base/platform/time.cc
+++ b/src/base/platform/time.cc
@@ -814,6 +814,8 @@ ThreadTicks ThreadTicks::Now() {
#endif
@@ -802,6 +802,8 @@ ThreadTicks ThreadTicks::Now() {
UNREACHABLE();
#elif V8_OS_DARWIN
return ThreadTicks(ComputeThreadTicks());
+#elif V8_OS_WIN
+ return ThreadTicks::GetForThread(::GetCurrentThread());
#elif V8_OS_FUCHSIA
return ThreadTicks(GetFuchsiaThreadTicks());
#elif(defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \
@@ -821,8 +823,6 @@ ThreadTicks ThreadTicks::Now() {
#elif (defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \
@@ -809,8 +811,6 @@ ThreadTicks ThreadTicks::Now() {
return ThreadTicks(ClockNow(CLOCK_THREAD_CPUTIME_ID));
#elif V8_OS_SOLARIS
return ThreadTicks(gethrvtime() / Time::kNanosecondsPerMicrosecond);

View File

@ -1,5 +1,5 @@
diff --git a/src/base/debug/stack_trace_win.cc b/src/base/debug/stack_trace_win.cc
index f981bec..16655d5 100644
index f981bec6..16655d51 100644
--- a/src/base/debug/stack_trace_win.cc
+++ b/src/base/debug/stack_trace_win.cc
@@ -81,7 +81,7 @@ bool InitializeSymbols() {
@ -12,10 +12,10 @@ index f981bec..16655d5 100644
// To get the path without the filename, we just need to remove the final
// slash and everything after it.
diff --git a/src/base/platform/platform-win32.cc b/src/base/platform/platform-win32.cc
index 152fbbf..2b7dea5 100644
index 11402689..b8cfb30d 100644
--- a/src/base/platform/platform-win32.cc
+++ b/src/base/platform/platform-win32.cc
@@ -760,13 +760,13 @@ void OS::EnsureWin32MemoryAPILoaded() {
@@ -802,13 +802,13 @@ void OS::EnsureWin32MemoryAPILoaded() {
static bool loaded = false;
if (!loaded) {
VirtualAlloc2 = (VirtualAlloc2_t)GetProcAddress(
@ -32,7 +32,7 @@ index 152fbbf..2b7dea5 100644
loaded = true;
}
@@ -1043,7 +1043,7 @@ bool OS::DiscardSystemPages(void* address, size_t size) {
@@ -1097,7 +1097,7 @@ bool OS::DiscardSystemPages(void* address, size_t size) {
reinterpret_cast<DiscardVirtualMemoryFunction>(-1))
discard_virtual_memory =
reinterpret_cast<DiscardVirtualMemoryFunction>(GetProcAddress(
@ -42,10 +42,10 @@ index 152fbbf..2b7dea5 100644
// MEM_RESET.
DiscardVirtualMemoryFunction discard_function = discard_virtual_memory.load();
diff --git a/src/diagnostics/unwinding-info-win64.cc b/src/diagnostics/unwinding-info-win64.cc
index a71b866..5c8c601 100644
index 1312609e..0290c5a0 100644
--- a/src/diagnostics/unwinding-info-win64.cc
+++ b/src/diagnostics/unwinding-info-win64.cc
@@ -471,7 +471,7 @@ static decltype(
@@ -473,7 +473,7 @@ static decltype(
void LoadNtdllUnwindingFunctionsOnce() {
// Load functions from the ntdll.dll module.
HMODULE ntdll_module =

View File

@ -1,8 +1,8 @@
diff --git a/src/base/platform/time.cc b/src/base/platform/time.cc
index b6da0a6..34e7e38 100644
index c2d36cc2..1948d0db 100644
--- a/src/base/platform/time.cc
+++ b/src/base/platform/time.cc
@@ -876,6 +876,12 @@ void ThreadTicks::WaitUntilInitializedWin() {
@@ -864,6 +864,12 @@ void ThreadTicks::WaitUntilInitializedWin() {
#endif
}

View File

@ -1,47 +1,5 @@
diff --git a/include/v8-fast-api-calls.h b/include/v8-fast-api-calls.h
index e40f106..c70808a 100644
--- a/include/v8-fast-api-calls.h
+++ b/include/v8-fast-api-calls.h
@@ -328,7 +328,7 @@ class CTypeInfo {
struct FastApiTypedArrayBase {
public:
// Returns the length in number of elements.
- size_t V8_EXPORT length() const { return length_; }
+ size_t length() const { return length_; }
// Checks whether the given index is within the bounds of the collection.
void V8_EXPORT ValidateIndex(size_t index) const;
diff --git a/src/common/assert-scope.h b/src/common/assert-scope.h
index 42d9649..064c33d 100644
--- a/src/common/assert-scope.h
+++ b/src/common/assert-scope.h
@@ -147,7 +147,7 @@ class CombinationAssertScope;
template <typename Scope>
class V8_NODISCARD CombinationAssertScope<Scope> : public Scope {
public:
- V8_EXPORT_PRIVATE static bool IsAllowed() {
+ static bool IsAllowed() {
// Define IsAllowed() explicitly rather than with using Scope::IsAllowed, to
// allow SFINAE removal of IsAllowed() when it's not defined (under debug).
return Scope::IsAllowed();
@@ -164,12 +164,12 @@ class CombinationAssertScope<Scope, Scopes...>
public:
// Constructor for per-thread scopes.
- V8_EXPORT_PRIVATE CombinationAssertScope() : Scope(), NextScopes() {}
+ CombinationAssertScope() : Scope(), NextScopes() {}
// Constructor for per-isolate scopes.
- V8_EXPORT_PRIVATE explicit CombinationAssertScope(Isolate* isolate)
+ explicit CombinationAssertScope(Isolate* isolate)
: Scope(isolate), NextScopes(isolate) {}
- V8_EXPORT_PRIVATE static bool IsAllowed() {
+ static bool IsAllowed() {
return Scope::IsAllowed() && NextScopes::IsAllowed();
}
diff --git a/src/execution/interrupts-scope.h b/src/execution/interrupts-scope.h
index 8be3ce9..76815c3 100644
index 8be3ce98..76815c32 100644
--- a/src/execution/interrupts-scope.h
+++ b/src/execution/interrupts-scope.h
@@ -19,7 +19,7 @@ class V8_NODISCARD InterruptsScope {
@ -53,50 +11,63 @@ index 8be3ce9..76815c3 100644
Mode mode)
: stack_guard_(nullptr),
intercept_mask_(intercept_mask),
diff --git a/src/heap/new-spaces.h b/src/heap/new-spaces.h
index dc57faf..ec08364 100644
--- a/src/heap/new-spaces.h
+++ b/src/heap/new-spaces.h
@@ -516,7 +516,7 @@ class V8_EXPORT_PRIVATE SemiSpaceNewSpace final : public NewSpace {
// -----------------------------------------------------------------------------
// PagedNewSpace
-class V8_EXPORT_PRIVATE PagedSpaceForNewSpace final : public PagedSpaceBase {
+class PagedSpaceForNewSpace final : public PagedSpaceBase {
diff --git a/src/heap/conservative-stack-visitor.h b/src/heap/conservative-stack-visitor.h
index d5f92c35..ae75dd12 100644
--- a/src/heap/conservative-stack-visitor.h
+++ b/src/heap/conservative-stack-visitor.h
@@ -33,7 +33,7 @@ class RootVisitor;
// 5) OnlyScanMainV8Heap() - returns true if the visitor does not handle the
// external code and trusted spaces.
template <typename ConcreteVisitor>
-class V8_EXPORT_PRIVATE ConservativeStackVisitorBase
+class ConservativeStackVisitorBase
: public ::heap::base::StackVisitor {
public:
// Creates an old space object. The constructor does not allocate pages
// from OS.
ConservativeStackVisitorBase(Isolate* isolate, RootVisitor* root_visitor);
diff --git a/src/objects/js-objects.h b/src/objects/js-objects.h
index e0cd974..b9edff1 100644
index 5900e514..14ea5b53 100644
--- a/src/objects/js-objects.h
+++ b/src/objects/js-objects.h
@@ -663,7 +663,7 @@ class JSObject : public TorqueGeneratedJSObject<JSObject, JSReceiver> {
Isolate* isolate, Handle<JSObject> object, PropertyNormalizationMode mode,
int expected_additional_properties, bool use_cache, const char* reason);
@@ -745,7 +745,7 @@ class JSObject : public TorqueGeneratedJSObject<JSObject, JSReceiver> {
PropertyNormalizationMode mode, int expected_additional_properties,
bool use_cache, const char* reason);
- V8_EXPORT_PRIVATE static void NormalizeProperties(
+ static void NormalizeProperties(
Isolate* isolate, Handle<JSObject> object, PropertyNormalizationMode mode,
int expected_additional_properties, const char* reason) {
const bool kUseCache = true;
Isolate* isolate, DirectHandle<JSObject> object,
PropertyNormalizationMode mode, int expected_additional_properties,
const char* reason) {
diff --git a/src/objects/map.h b/src/objects/map.h
index 46930be..c0ff7e5 100644
index 73838fa6..2021427b 100644
--- a/src/objects/map.h
+++ b/src/objects/map.h
@@ -549,7 +549,7 @@ class Map : public TorqueGeneratedMap<Map, HeapObject> {
V8_EXPORT_PRIVATE static Handle<Map> Normalize(
Isolate* isolate, Handle<Map> map, ElementsKind new_elements_kind,
PropertyNormalizationMode mode, bool use_cache, const char* reason);
- V8_EXPORT_PRIVATE static Handle<Map> Normalize(Isolate* isolate,
+ static Handle<Map> Normalize(Isolate* isolate,
Handle<Map> map,
ElementsKind new_elements_kind,
PropertyNormalizationMode mode,
@@ -601,7 +601,7 @@ class Map : public TorqueGeneratedMap<Map, HeapObject> {
Isolate* isolate, DirectHandle<Map> map, ElementsKind new_elements_kind,
DirectHandle<JSPrototype> new_prototype, PropertyNormalizationMode mode,
bool use_cache, const char* reason);
- V8_EXPORT_PRIVATE static Handle<Map> Normalize(
+ static Handle<Map> Normalize(
Isolate* isolate, DirectHandle<Map> map, ElementsKind new_elements_kind,
DirectHandle<JSPrototype> new_prototype, PropertyNormalizationMode mode,
const char* reason) {
diff --git a/src/objects/string-inl.h b/src/objects/string-inl.h
index c1bbd1ea..1eb93ba9 100644
--- a/src/objects/string-inl.h
+++ b/src/objects/string-inl.h
@@ -851,7 +851,7 @@ const Char* String::GetDirectStringChars(
// static
template <template <typename> typename HandleType>
requires(std::is_convertible_v<HandleType<String>, DirectHandle<String>>)
-V8_EXPORT_PRIVATE HandleType<String> String::SlowFlatten(
+HandleType<String> String::SlowFlatten(
Isolate* isolate, HandleType<ConsString> cons, AllocationType allocation) {
DCHECK(!cons->IsFlat());
DCHECK_NE(cons->second()->length(), 0); // Equivalent to !IsFlat.
diff --git a/src/utils/address-map.h b/src/utils/address-map.h
index 2f7c633..e672b1e 100644
index cd09209d..88fec7ab 100644
--- a/src/utils/address-map.h
+++ b/src/utils/address-map.h
@@ -59,7 +59,7 @@ class RootIndexMap {
@@ -61,7 +61,7 @@ class RootIndexMap {
RootIndexMap& operator=(const RootIndexMap&) = delete;
// Returns true on successful lookup and sets *|out_root_list|.
@ -105,15 +76,3 @@ index 2f7c633..e672b1e 100644
RootIndex* out_root_list) const {
Maybe<uint32_t> maybe_index = map_->Get(obj);
if (maybe_index.IsJust()) {
diff -aurp a/src/logging/runtime-call-stats.h b/src/logging/runtime-call-stats.h
--- a/src/logging/runtime-call-stats.h 2023-10-08 16:27:48.000000000 +0200
+++ b/src/logging/runtime-call-stats.h 2023-10-08 16:27:52.000000000 +0200
@@ -794,7 +794,7 @@ class WorkerThreadRuntimeCallStats {};
class RuntimeCallStats {
public:
enum ThreadType { kMainIsolateThread, kWorkerThread };
- explicit V8_EXPORT_PRIVATE RuntimeCallStats(ThreadType thread_type) {}
+ explicit RuntimeCallStats(ThreadType thread_type) {}
};
class WorkerThreadRuntimeCallStatsScope {

View File

@ -1,24 +0,0 @@
diff --git a/src/base/macros.h b/src/base/macros.h
index 25a533c..5591276 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -7,6 +7,7 @@
#include <limits>
#include <type_traits>
+#include <cstdint>
#include "src/base/compiler-specific.h"
#include "src/base/logging.h"
diff --git a/src/base/logging.h b/src/base/logging.h
index 4c129ab..600c00b 100644
--- a/src/base/logging.h
+++ b/src/base/logging.h
@@ -9,6 +9,7 @@
#include <cstring>
#include <sstream>
#include <string>
+#include <cstdint>
#include "src/base/base-export.h"
#include "src/base/build_config.h"

View File

@ -0,0 +1,61 @@
diff --git a/src/heap/base/asm/x64/push_registers_asm.cc b/src/heap/base/asm/x64/push_registers_asm.cc
index 554caddf..61c3e2f7 100644
--- a/src/heap/base/asm/x64/push_registers_asm.cc
+++ b/src/heap/base/asm/x64/push_registers_asm.cc
@@ -21,8 +21,48 @@
// Source: https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-1.0.pdf
#ifdef _WIN64
-#error "The masm based version must be used for Windows"
-#endif
+
+asm(".globl PushAllRegistersAndIterateStack \n"
+ "PushAllRegistersAndIterateStack: \n"
+ // rbp is callee-saved. Maintain proper frame pointer for debugging.
+ " push %rbp \n"
+ " mov %rsp, %rbp \n"
+ // Dummy for alignment.
+ " push $0xCDCDCD \n"
+ " push %rsi \n"
+ " push %rdi \n"
+ " push %rbx \n"
+ " push %r12 \n"
+ " push %r13 \n"
+ " push %r14 \n"
+ " push %r15 \n"
+ " sub $160, %rsp \n"
+ // Use aligned instrs as we are certain that the stack is properly aligned.
+ " movdqa %xmm6, 144(%rsp) \n"
+ " movdqa %xmm7, 128(%rsp) \n"
+ " movdqa %xmm8, 112(%rsp) \n"
+ " movdqa %xmm9, 96(%rsp) \n"
+ " movdqa %xmm10, 80(%rsp) \n"
+ " movdqa %xmm11, 64(%rsp) \n"
+ " movdqa %xmm12, 48(%rsp) \n"
+ " movdqa %xmm13, 32(%rsp) \n"
+ " movdqa %xmm14, 16(%rsp) \n"
+ " movdqa %xmm15, (%rsp) \n"
+ // Pass 1st parameter (rcx) unchanged (Stack*).
+ // Pass 2nd parameter (rdx) unchanged (StackVisitor*).
+ // Save 3rd parameter (r8; IterateStackCallback)
+ " mov %r8, %r9 \n"
+ // Pass 3rd parameter as rsp (stack pointer).
+ " mov %rsp, %r8 \n"
+ // Call the callback.
+ " call *%r9 \n"
+ // Pop the callee-saved registers.
+ " add $224, %rsp \n"
+ // Restore rbp as it was used as frame pointer.
+ " pop %rbp \n"
+ " ret \n");
+
+#else // !_WIN64
asm(
#ifdef __APPLE__
@@ -64,3 +104,5 @@ asm(
".Lfunc_end0-PushAllRegistersAndIterateStack \n"
#endif // !defined(__APPLE__)
);
+
+#endif // !_WIN64

View File

@ -1,10 +1,10 @@
diff --git a/BUILD.gn b/BUILD.gn
index 9d4cb6a..be3cf21 100644
index f227c834..9f3b4a60 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -20,39 +20,8 @@ config("absl_component_build") {
assert(!is_nacl || is_nacl_saigo,
"base must not be built in most nacl toolchains")
@@ -16,39 +16,8 @@ config("absl_component_build") {
defines = [ "ABSL_CONSUME_DLL" ]
}
-component("absl") {
+static_library("absl") {
@ -44,40 +44,34 @@ index 9d4cb6a..be3cf21 100644
group("absl_component_deps") {
diff --git a/absl.gni b/absl.gni
index cf8a39e..5fc078d 100644
index 48e1ce78..a4721461 100644
--- a/absl.gni
+++ b/absl.gni
@@ -30,14 +30,6 @@ template("absl_source_set") {
"//third_party/abseil-cpp:absl_define_config",
]
- if (is_component_build) {
- defines = [ "ABSL_BUILD_DLL" ]
- if (!is_win) {
- configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
- configs += [ "//build/config/gcc:symbol_visibility_default" ]
- }
- }
-
if (!defined(public_configs)) {
public_configs = []
}
@@ -40,7 +40,7 @@ template("absl_source_set") {
if (!defined(defines)) {
defines = []
}
- if (is_component_build) {
+ if (!is_mingw && is_component_build) {
defines += [ "ABSL_BUILD_DLL" ]
if (!is_win && current_os != "aix") {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
diff --git a/absl/base/BUILD.gn b/absl/base/BUILD.gn
index 800dfd6..a3f1dc9 100644
index 98e75941..c4aa2f85 100644
--- a/absl/base/BUILD.gn
+++ b/absl/base/BUILD.gn
@@ -178,6 +178,9 @@ absl_source_set("base") {
@@ -190,6 +190,9 @@ absl_source_set("base") {
":spinlock_wait",
"//third_party/abseil-cpp/absl/meta:type_traits",
]
+ if (is_mingw) {
+ libs = [ "pthread" ]
+ libs = [ ":libpthread.a" ]
+ }
}
absl_source_set("throw_delegate") {
absl_test("attributes_test") {
diff --git a/absl/base/internal/thread_identity.h b/absl/base/internal/thread_identity.h
index b6e917c..8b298c6 100644
index acfc15a8..a3f3df78 100644
--- a/absl/base/internal/thread_identity.h
+++ b/absl/base/internal/thread_identity.h
@@ -20,7 +20,7 @@
@ -90,10 +84,10 @@ index b6e917c..8b298c6 100644
// Defines __GOOGLE_GRTE_VERSION__ (via glibc-specific features.h) when
// supported.
diff --git a/absl/random/internal/BUILD.gn b/absl/random/internal/BUILD.gn
index 54754f7..0e74fb5 100644
index 46dcff5a..4182eed6 100644
--- a/absl/random/internal/BUILD.gn
+++ b/absl/random/internal/BUILD.gn
@@ -39,7 +39,7 @@ absl_source_set("seed_material") {
@@ -40,7 +40,7 @@ absl_source_set("seed_material") {
sources = [ "seed_material.cc" ]
if (is_win) {
# TODO(mbonadei): In the bazel file this is -DEFAULTLIB:bcrypt.lib.
@ -103,16 +97,15 @@ index 54754f7..0e74fb5 100644
deps = [
":fast_uniform_bits",
diff --git a/absl/time/internal/cctz/src/time_zone_lookup.cc b/absl/time/internal/cctz/src/time_zone_lookup.cc
index d22691b..a7e4fa7 100644
index e8f1d930..9f238db6 100644
--- a/absl/time/internal/cctz/src/time_zone_lookup.cc
+++ b/absl/time/internal/cctz/src/time_zone_lookup.cc
@@ -43,7 +43,7 @@
// MinGW did not add it until NTDDI_WIN10_NI (SDK version 10.0.22621.0).
#if ((defined(_WIN32_WINNT_WIN10) && !defined(__MINGW32__)) || \
(defined(NTDDI_WIN10_NI) && NTDDI_VERSION >= NTDDI_WIN10_NI)) && \
- (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
+ (_WIN32_WINNT >= _WIN32_WINNT_WINXP) && !defined(__MINGW32__)
#define USE_WIN32_LOCAL_TIME_ZONE
#include <roapi.h>
#include <tchar.h>
@@ -32,7 +32,7 @@
#include <zircon/types.h>
#endif
-#if defined(_WIN32)
+#if defined(_MSC_VER)
// Include only when <icu.h> is available.
// https://learn.microsoft.com/en-us/windows/win32/intl/international-components-for-unicode--icu-
// https://devblogs.microsoft.com/oldnewthing/20210527-00/?p=105255

View File

@ -4,8 +4,8 @@
_realname=v8
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=11.9.169.6
pkgrel=5
pkgver=14.0.210
pkgrel=1
pkgdesc="Fast and modern Javascript engine (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
@ -13,6 +13,7 @@ url="https://v8.dev"
msys2_references=(
"cpe: cpe:/a:google:v8"
)
msys2_repository_url='https://github.com/v8/v8'
license=('spdx:BSD-3-Clause')
depends=("${MINGW_PACKAGE_PREFIX}-icu"
"${MINGW_PACKAGE_PREFIX}-zlib")
@ -22,15 +23,19 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-python"
"git")
source=("https://github.com/v8/v8/archive/${pkgver}/${_realname}-${pkgver}.tar.gz"
"bare-clones/build::git+https://chromium.googlesource.com/chromium/src/build.git#commit=e14e0cc3b60c6ba8901741da3f9c18b7fa983880"
"bare-clones/abseil-cpp::git+https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git#commit=7affa303ea4ebf4d4de65b3f20f230c7bb16a2ed"
"bare-clones/zlib::git+https://chromium.googlesource.com/chromium/src/third_party/zlib.git#commit=f5fd0ad2663e239a31184ad4c9919991dda16f46"
"bare-clones/common::git+https://chromium.googlesource.com/chromium/src/base/trace_event/common.git#commit=147f65333c38ddd1ebf554e89965c243c8ce50b3"
"bare-clones/googletest::git+https://chromium.googlesource.com/external/github.com/google/googletest.git#commit=af29db7ec28d6df1c7f0f745186884091e602e07"
"bare-clones/jinja2::git+https://chromium.googlesource.com/chromium/src/third_party/jinja2.git#commit=515dd10de9bf63040045902a4a310d2ba25213a0"
"bare-clones/markupsafe::git+https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git#commit=006709ba3ed87660a17bd4548c45663628f5ed85"
"bare-clones/clang::git+https://chromium.googlesource.com/chromium/src/tools/clang.git#commit=9fc887ccded86c9355f1abbe80c651271c59632f"
source=("https://github.com/v8/v8/archive/refs/tags/${pkgver}.tar.gz"
"bare-clones/build::git+https://chromium.googlesource.com/chromium/src/build.git#commit=cb592905b1f94a0c315dccb59939f91ef869592c"
"bare-clones/clang::git+https://chromium.googlesource.com/chromium/src/tools/clang.git#commit=d6072980974f9a4922d2eb27e4fd244ca3017031"
"bare-clones/abseil-cpp::git+https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git#commit=cae4b6a3990e1431caa09c7b2ed1c76d0dfeab17"
"bare-clones/dragonbox::git+https://chromium.googlesource.com/external/github.com/jk-jeon/dragonbox.git#commit=6c7c925b571d54486b9ffae8d9d18a822801cbda"
"bare-clones/fast_float::git+https://chromium.googlesource.com/external/github.com/fastfloat/fast_float.git#commit=cb1d42aaa1e14b09e1452cfdef373d051b8c02a4"
"bare-clones/fp16::git+https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git#commit=0a92994d729ff76a58f692d3028ca1b64b145d91"
"bare-clones/googletest::git+https://chromium.googlesource.com/external/github.com/google/googletest.git#commit=309dab8d4bbfcef0ef428762c6fec7172749de0f"
"bare-clones/highway::git+https://chromium.googlesource.com/external/github.com/google/highway.git#commit=00fe003dac355b979f36157f9407c7c46448958e"
"bare-clones/jinja2::git+https://chromium.googlesource.com/chromium/src/third_party/jinja2.git#commit=c3027d884967773057bf74b957e3fea87e5df4d7"
"bare-clones/markupsafe::git+https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git#commit=4256084ae14175d38a3ff7d739dca83ae49ccec6"
"bare-clones/simdutf::git+https://chromium.googlesource.com/chromium/src/third_party/simdutf.git#commit=a1046f20f7099b4f7dd72d7127bb4dc05252ec5c"
"bare-clones/zlib::git+https://chromium.googlesource.com/chromium/src/third_party/zlib.git#commit=bf1e8de6cc305fdab82db1b65bed76b70bd96c8b"
"001-add-mingw-toolchain.patch"
"002-buildflags-fixes.patch"
"003-fix-macros-and-functions.patch"
@ -44,44 +49,56 @@ source=("https://github.com/v8/v8/archive/${pkgver}/${_realname}-${pkgver}.tar.g
"011-make-sure-that-__rdtsc-is-declared.patch"
"012-remove-dllimport-attributes.patch"
"013-builtin-deps-fixes.patch"
"014-fix-missing-include.patch"
"014-heap-use-proper-sources.patch"
"015-abseil-build-as-static-lib.patch"
"016-zlib-use-sytem-lib.patch"
"016-zlib-use-system-lib.patch"
"icu.gn"
"zlib.gn"
"v8_libbase.pc"
"v8_libplatform.pc"
"v8.pc")
sha256sums=('e74668eb4fd26269915e3736dd1a5ce6269c545e4a49ec09f1f6932593f6b675'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'cc5ba47426936ff9027acd2f9493c4dd52c83f2e0b3c46e56cf7582915c3572b'
'28092f71029393b52aa4315a9d38b59faee221220d5f380a16438e7a2d650337'
'06b5ac9c0389291aff7d0c8fe096af50713385f3be9df0326535208e49e1a0f4'
'bd1976ddb9ca8387c125ee578c9b66d85e27f989544e53e4ca0598bbd7ce52e9'
sha256sums=('a8d553be4130bc5e95e4bb7635958e8f79ecd34aef32de23d3bd7db0b3203760'
'5eb934ca43dfaccad43358820d8a84f1b8229d6330d2e0db1e827081b6858b99'
'f58b2605f036b8c9c7992635ad5f2070abe4d527314915874766d654ae4eb429'
'812f67ab2c4269b101df3af90a452867398a668b46c4997cbbde4fffe6c5cbfa'
'7a6c373f8694e540f5a767b315670ccef5526baa41f5427f02db2e4bf261765c'
'be05ebb53b7468e246aac2a22d1ce748c25e2e0cc5d0227e16272a00827092ff'
'5d0c4f261d36707f926fa9ef9a39349f1cccac8ae6443a8f8571c1625eb90c41'
'716f953b914f025dacce3860f0329a49b08c24c7d3ae9bcecd315ecd6781637b'
'5f359dae10e80599f26483879b879d7a6808520d4a56c98ee0879373a6339619'
'79aa2b70328acdbf62fa738743f32cd7a9eb13c7a236f63ec7b77e955893d163'
'81daaa3fe38b4b5569a18bff4daf06dea57e46fb1fd3b4930f9f9c423243c7b5'
'238f5601a483dd886c0200b3e5a5d5c78751288bc37de81680b73fdf982a33be'
'6478d94a8295db87759f756c99a7c079d7f3710e4fb996f9851d7f9ca8982f11'
'1d01845d0092582fe329b93e319e6338b17e8598c89ada70bfc9a4d407cdd3f9'
'ebd7b8e2b91e02879cb6c83154cb276be2a820f939b6d166e98b39c175b0eb51'
'274d4cfc5a8a4f99699e67fed36565f315dd3bc0d1335bbf5070ba7052d99541'
'aa7255002773aa3944027e0aab19627eee089c2ec3893713c8c7ff082e214553'
'75a0d6fbf04cb9bbb724230104cf28595cd9b1169a0e91a4090bd0d3b6f80a8c'
'2b738a7bccf26cc650bb85c68eb2bea7b66b27006f15c85b7583372a15e2654d'
'c860f43dfaeb77b7567044a45bcbc6d5508e1571fbb31cb49cfdfbe86a031916'
'1fca982ec6ede3b29d2692231569944ce0ad33519b47fd6fb01b0975c10eb6bd'
'3855f5d7b81c2df37f31de09ae9638d7247b78c5798ac18a58ab6e6be3befe5c'
'e46320e6b09c9d7d822ee6ff37b4ceb828de98b57f2b8eb988ab3e5e6ad493bb'
'3c7b480cd4c19e8120c9adb27d7fd45b8d98c5bfc13c153479afa0636c319153'
'4edcd5f7d2f9b52c8783e81b7f06f6e5b386aa6c0143cc2f9054754db53919cf'
'e4d8e57914cfcf6c0ea299d0556d7b747271e5a7ec66e1d8d52394fcd0da34b6'
'c7d119eb59aa34898efda6fdaf5b2eabeb3390d527531ad54f210fc1e733c75a'
'399bdc454bf119c1b4034147382e58a5bbe51ee9b0380a326c639844c85e123a'
'1ef6854b6a68101ab177a7a95389e9b03e7b8c4e3223320dfc9ce4405cbf5bfe'
'1d03e6c517528a31f6ff38d251b011e34a667f0b60968817b573677501dc20c1'
'37a29668fb02d4fa60062c02f0d24dce4ab9b7fce4d7f5a8e6eca745fa125be2'
'0b142b795a4db7d063825d9578503f275632eb0139b5ab4a7fc75e45201ab04a'
'53f5a7a29608f305d4f7cab708aabe63e3cc686ff337f40bae16004e8edf7f00'
'5b1c2a1c4faefdbb918640b394a100b08c5b9940547d4ce5a04b8d9dc40559a7'
'7e3555a4128d8b69cd9733b14b114d27063667ae0687b693c51fd1881f847e93'
'a4275f41723cc990f2f43559ce716100830a8ce3f38e4878f6bf36d70d47b646'
'e1bc88af48143f29f5805b8ac5d77addef1b09318d1f5f127a9281872c00303b'
'7e1e39a3dc69632f7bf9182c92405186ce709aca921cf0abefadb6fa8b825510'
'fbddbe4849b623afb320472aab316c9a08b54182161b6b4911cb7ef7d65e2b0e'
'ca81528892f0e02fe7ecd159568610221fb8d0df109d9d0dbdfa00c1284dd0fc'
'579e199a798ff76b72a5b17380a3cd09d361cb7cee99403090c3a266d1b2e527')
'71ac09cff81a983c63cbeee405a18b092655e6c608da1ede3aacc568edb80b39'
'aaeb6759ccbe875babdc48ab394e1a0cc8485731c9311827b3981ba6e85ee688'
'75a1f195164d830524b02801c82f39628cd51fa15ba59472e37dde4ce97aecd5')
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -p1 -i "${srcdir}/${_patch}"
done
}
prepare() {
echo ":: Patching build directory"
@ -90,7 +107,7 @@ prepare() {
python "${srcdir}"/build/util/lastchange.py -o "${srcdir}"/build/util/LASTCHANGE
rm -rf "${srcdir}"/${_realname}-${pkgver}/build
ln -sf "${srcdir}"/build "${srcdir}"/${_realname}-${pkgver}
echo "checkout_google_benchmark = false" > "${srcdir}"/${_realname}-${pkgver}/build/config/gclient_args.gni
echo "build_with_chromium = false" > "${srcdir}"/${_realname}-${pkgver}/build/config/gclient_args.gni
echo ":: Patching abseil-cpp directory"
cd "${srcdir}"/abseil-cpp
@ -99,52 +116,56 @@ prepare() {
echo ":: Patching zlib directory"
cd "${srcdir}"/zlib
patch -p1 -i "${srcdir}"/016-zlib-use-sytem-lib.patch
patch -p1 -i "${srcdir}"/016-zlib-use-system-lib.patch
mkdir -p "${srcdir}"/${_realname}-${pkgver}/third_party/zlib
ln -sf "${srcdir}"/zlib.gn "${srcdir}"/${_realname}-${pkgver}/third_party/zlib/BUILD.gn
rm -rf "${srcdir}"/${_realname}-${pkgver}/third_party/zlib/google
ln -sf "${srcdir}"/zlib/google "${srcdir}"/${_realname}-${pkgver}/third_party/zlib
echo ":: Patching icu directory"
mkdir -p "${srcdir}"/${_realname}-${pkgver}/third_party/icu
ln -sf "${srcdir}"/icu.gn "${srcdir}"/${_realname}-${pkgver}/third_party/icu/BUILD.gn
echo "icu_use_data_file = false" > "${srcdir}"/${_realname}-${pkgver}/third_party/icu/config.gni
echo ":: Soft linking extra repos"
mkdir -p "${srcdir}"/${_realname}-${pkgver}/base/trace_event
ln -sf "${srcdir}"/common "${srcdir}"/${_realname}-${pkgver}/base/trace_event
mkdir -p "${srcdir}"/${_realname}-${pkgver}/third_party/googletest/src
mkdir -p "${srcdir}"/${_realname}-${pkgver}/third_party/{dragonbox,fast_float,fp16,googletest,highway}/src
ln -sf "${srcdir}"/dragonbox/* "${srcdir}"/${_realname}-${pkgver}/third_party/dragonbox/src
ln -sf "${srcdir}"/fast_float/* "${srcdir}"/${_realname}-${pkgver}/third_party/fast_float/src
ln -sf "${srcdir}"/fp16/* "${srcdir}"/${_realname}-${pkgver}/third_party/fp16/src
ln -sf "${srcdir}"/googletest/* "${srcdir}"/${_realname}-${pkgver}/third_party/googletest/src
ln -sf "${srcdir}"/jinja2 "${srcdir}"/${_realname}-${pkgver}/third_party
ln -sf "${srcdir}"/markupsafe "${srcdir}"/${_realname}-${pkgver}/third_party
ln -sf "${srcdir}"/highway/* "${srcdir}"/${_realname}-${pkgver}/third_party/highway/src
ln -sf "${srcdir}"/simdutf "${srcdir}"/${_realname}-${pkgver}/third_party
ln -sf "${srcdir}"/clang "${srcdir}"/${_realname}-${pkgver}/tools
echo ":: Patching v8 source"
cd "${srcdir}"/${_realname}-${pkgver}
patch -p1 -i "${srcdir}"/002-buildflags-fixes.patch
patch -p1 -i "${srcdir}"/003-fix-macros-and-functions.patch
patch -p1 -i "${srcdir}"/004-fix-static-assert-implementations.patch
patch -p1 -i "${srcdir}"/005-fix-conflicting-macros.patch
patch -p1 -i "${srcdir}"/006-support-clang-in-mingw-mode.patch
patch -p1 -i "${srcdir}"/007-snapshot-use-system-zlib-header.patch
patch -p1 -i "${srcdir}"/008-prioritized-native-thread-on-windows.patch
patch -p1 -i "${srcdir}"/009-unicode-for-wide-char-functions.patch
patch -p1 -i "${srcdir}"/010-disable-msvc-hack.patch
patch -p1 -i "${srcdir}"/011-make-sure-that-__rdtsc-is-declared.patch
patch -p1 -i "${srcdir}"/012-remove-dllimport-attributes.patch
patch -p1 -i "${srcdir}"/013-builtin-deps-fixes.patch
patch -p1 -i "${srcdir}"/014-fix-missing-include.patch
apply_patch_with_msg \
002-buildflags-fixes.patch \
003-fix-macros-and-functions.patch \
004-fix-static-assert-implementations.patch \
005-fix-conflicting-macros.patch \
006-support-clang-in-mingw-mode.patch \
007-snapshot-use-system-zlib-header.patch \
008-prioritized-native-thread-on-windows.patch \
009-unicode-for-wide-char-functions.patch \
010-disable-msvc-hack.patch \
011-make-sure-that-__rdtsc-is-declared.patch \
012-remove-dllimport-attributes.patch \
013-builtin-deps-fixes.patch \
014-heap-use-proper-sources.patch
sed -e "s|@VERSION@|${pkgver}|g" \
-e "s|@CFLAGS@|${_cflags}|g" \
-e "s|^prefix=.*|prefix=${MINGW_PREFIX}|g" -i "${srcdir}/v8_libbase.pc"
-e "s|@PREFIX@|${MINGW_PREFIX}|g" -i "${srcdir}/v8_libbase.pc"
sed -e "s|@VERSION@|${pkgver}|g" \
-e "s|@CFLAGS@|${_cflags}|g" \
-e "s|^prefix=.*|prefix=${MINGW_PREFIX}|g" -i "${srcdir}/v8_libplatform.pc"
-e "s|@PREFIX@|${MINGW_PREFIX}|g" -i "${srcdir}/v8_libplatform.pc"
sed -e "s|@VERSION@|${pkgver}|g" \
-e "s|@CFLAGS@|${_cflags}|g" \
-e "s|^prefix=.*|prefix=${MINGW_PREFIX}|g" -i "${srcdir}/v8.pc"
-e "s|@PREFIX@|${MINGW_PREFIX}|g" -i "${srcdir}/v8.pc"
}
build() {
@ -152,9 +173,11 @@ build() {
local _buildtype=Release
local _debug=false
local _symbol=0
if check_option "debug" "y"; then
_buildtype=Debug
_debug=true
_symbol=2
fi
local _arch=x64
@ -169,22 +192,38 @@ build() {
_clang=true
fi
# generate build files
${MINGW_PREFIX}/bin/gn gen out/${_buildtype}-${MSYSTEM} --args="
local _gn_args="
target_cpu=\"${_arch}\"
is_debug=${_debug}
is_clang=${_clang}
is_component_build=true
use_custom_libcxx=false
use_libcxx_modules=false
use_lld=false
use_siso=false
use_sysroot=false
v8_enable_etw_stack_walking=false
v8_enable_fuzztest=false
v8_enable_system_instrumentation=false
v8_enable_temporal_support=false
v8_enable_verify_heap=false
icu_use_data_file=false
win_enable_cfg_guards=${_cfg}
v8_symbol_level=${_symbol}
v8_use_external_startup_data=false
chrome_pgo_phase=0
clang_use_chrome_plugins=false
enable_iterator_debugging=${_debug}
enable_rust=false
win_enable_cfg_guards=${_cfg}
treat_warnings_as_errors=false"
${MINGW_PREFIX}/bin/ninja -C out/${_buildtype}-${MSYSTEM} v8_libbase v8_libplatform v8 d8 torque torque-language-server mksnapshot
# generate build files for shared library
gn gen out/${_buildtype}-${MSYSTEM} --args="${_gn_args} is_component_build=true"
ninja -C out/${_buildtype}-${MSYSTEM} v8 d8 torque torque-language-server mksnapshot
# generate build files for static library
gn gen out/${_buildtype}-${MSYSTEM}-static --args="${_gn_args} is_component_build=false v8_enable_i18n_support=false v8_monolithic=true"
ninja -C out/${_buildtype}-${MSYSTEM}-static v8_monolith
}
package() {
@ -196,17 +235,21 @@ package() {
fi
install -d "${pkgdir}"${MINGW_PREFIX}/{bin,include/{cppgc/internal,libplatform},lib/pkgconfig,share/licenses/${_realname}}
install -Dm755 out/${_buildtype}-${MSYSTEM}/d8.exe "${pkgdir}"${MINGW_PREFIX}/bin/d8.exe
install -Dm755 out/${_buildtype}-${MSYSTEM}/torque.exe "${pkgdir}"${MINGW_PREFIX}/bin/torque.exe
install -Dm755 out/${_buildtype}-${MSYSTEM}/torque-language-server.exe "${pkgdir}"${MINGW_PREFIX}/bin/torque-language-server.exe
install -Dm755 out/${_buildtype}-${MSYSTEM}/mksnapshot.exe "${pkgdir}"${MINGW_PREFIX}/bin/mksnapshot.exe
install -Dm755 out/${_buildtype}-${MSYSTEM}/*.dll "${pkgdir}"${MINGW_PREFIX}/bin/
install -Dm644 out/${_buildtype}-${MSYSTEM}/snapshot_blob.bin "${pkgdir}"${MINGW_PREFIX}/bin/snapshot_blob.bin
install -Dm755 out/${_buildtype}-${MSYSTEM}/*.a "${pkgdir}"${MINGW_PREFIX}/lib/
install -Dm644 $srcdir/*.pc "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/
install -Dm755 out/${_buildtype}-${MSYSTEM}-static/obj/libv8_monolith.a "${pkgdir}"${MINGW_PREFIX}/lib/
install -Dm644 "${srcdir}"/*.pc "${pkgdir}"${MINGW_PREFIX}/lib/pkgconfig/
install -Dm644 include/*.h "${pkgdir}"${MINGW_PREFIX}/include/
install -Dm644 include/cppgc/*.h "${pkgdir}"${MINGW_PREFIX}/include/cppgc/
install -Dm644 include/cppgc/internal/*.h "${pkgdir}"${MINGW_PREFIX}/include/cppgc/internal/
install -Dm644 include/libplatform/*.h "${pkgdir}"${MINGW_PREFIX}/include/libplatform/
install -Dm644 LICENSE* "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/
}

View File

@ -1,4 +1,4 @@
prefix=
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

View File

@ -1,4 +1,4 @@
prefix=
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

View File

@ -1,4 +1,4 @@
prefix=
prefix=@PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include