Skip to content
File

Blob: patches/v8/0017-Enable-V8-shared-linkage.patch

3.7 KB
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Felix Hanau <felix@cloudflare.com>
3Date: Sun, 9 Jul 2023 18:46:20 -0400
4Subject: Enable V8 shared linkage
5 
6Signed-off-by: James M Snell <jsnell@cloudflare.com>
7 
8diff --git a/BUILD.bazel b/BUILD.bazel
9index 23f52ed12cecfcd7383cc3d389935ca487b8533e..8049d631cc50f2ca1059f81b59f5955337189d47 100644
10--- a/BUILD.bazel
11+++ b/BUILD.bazel
12@@ -1505,6 +1505,7 @@ filegroup(
13 "src/builtins/constants-table-builder.cc",
14 "src/builtins/constants-table-builder.h",
15 "src/builtins/data-view-ops.h",
16+ "src/builtins/profile-data-reader.cc",
17 "src/builtins/profile-data-reader.h",
18 "src/builtins/superspread.h",
19 "src/codegen/aligned-slot-allocator.cc",
20@@ -1690,7 +1691,6 @@ filegroup(
21 "src/execution/futex-emulation.h",
22 "src/execution/interrupts-scope.cc",
23 "src/execution/interrupts-scope.h",
24- "src/execution/isolate.cc",
25 "src/execution/isolate.h",
26 "src/execution/isolate-data.h",
27 "src/execution/isolate-data-fields.h",
28@@ -3314,7 +3314,6 @@ filegroup(
29 filegroup(
30 name = "v8_compiler_files",
31 srcs = [
32- "src/builtins/profile-data-reader.h",
33 "src/compiler/access-builder.cc",
34 "src/compiler/access-builder.h",
35 "src/compiler/access-info.cc",
36@@ -3920,8 +3919,6 @@ filegroup(
37 "src/builtins/growable-fixed-array-gen.cc",
38 "src/builtins/growable-fixed-array-gen.h",
39 "src/builtins/number-builtins-reducer-inl.h",
40- "src/builtins/profile-data-reader.cc",
41- "src/builtins/profile-data-reader.h",
42 "src/builtins/setup-builtins-internal.cc",
43 "src/builtins/torque-csa-header-includes.h",
44 "src/codegen/turboshaft-builtins-assembler-inl.h",
45@@ -4193,6 +4190,7 @@ filegroup(
46 "src/snapshot/snapshot-empty.cc",
47 "src/snapshot/static-roots-gen.cc",
48 "src/snapshot/static-roots-gen.h",
49+ "src/execution/isolate.cc",
50 ],
51 )
52
53@@ -4303,6 +4301,10 @@ filegroup(
54 name = "noicu/snapshot_files",
55 srcs = [
56 "src/init/setup-isolate-deserialize.cc",
57+ # Not a snapshot file per se, but depends on symbols only present in the snapshot (or
58+ # through a placeholder when building the snapshot itself); having it here makes using
59+ # shared linkage for the main v8 target possible.
60+ "src/execution/isolate.cc",
61 ] + select({
62 "@v8//bazel/config:v8_target_arm": [
63 "google3/snapshots/arm/noicu/embedded.S",
64@@ -4320,6 +4322,7 @@ filegroup(
65 name = "icu/snapshot_files",
66 srcs = [
67 "src/init/setup-isolate-deserialize.cc",
68+ "src/execution/isolate.cc",
69 ] + select({
70 "@v8//bazel/config:v8_target_arm": [
71 "google3/snapshots/arm/icu/embedded.S",
72diff --git a/bazel/defs.bzl b/bazel/defs.bzl
73index 7dcf0f8646b73d860e247e51f72da71924227d56..d86fc1b7ac9dd9151e7e7202876c4953b1c38ea7 100644
74--- a/bazel/defs.bzl
75+++ b/bazel/defs.bzl
76@@ -304,7 +304,6 @@ def v8_library(
77 copts = copts + default.copts,
78 linkopts = linkopts + default.linkopts,
79 alwayslink = 1,
80- linkstatic = 1,
81 **kwargs
82 )
83
84@@ -323,7 +322,6 @@ def v8_library(
85 copts = copts + default.copts + ENABLE_I18N_SUPPORT_DEFINES,
86 linkopts = linkopts + default.linkopts,
87 alwayslink = 1,
88- linkstatic = 1,
89 **kwargs
90 )
91
92@@ -343,7 +341,6 @@ def v8_library(
93 copts = copts + default.copts,
94 linkopts = linkopts + default.linkopts,
95 alwayslink = 1,
96- linkstatic = 1,
97 **kwargs
98 )
99