Skip to content

Commit 8cf18e5

Browse files
committed
Fixes for proper Linux build
1 parent 2d59a9f commit 8cf18e5

File tree

2 files changed

+104
-34
lines changed

2 files changed

+104
-34
lines changed

patches/libuv_shared.patch

Lines changed: 52 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1+
diff --git forkSrcPrefix/node.gypi forkDstPrefix/node.gypi
2+
index 36ed39f30855ff25c1c79aa3773d1383ddcb84f9..7842648b585602a6246691a8f818f6ae71f7eb7c 100644
3+
--- forkSrcPrefix/node.gypi
4+
+++ forkDstPrefix/node.gypi
5+
@@ -195,13 +195,6 @@
6+
'-Wl,-force_load,<(PRODUCT_DIR)/libuv<(STATIC_LIB_SUFFIX)',
7+
],
8+
},
9+
- 'msvs_settings': {
10+
- 'VCLinkerTool': {
11+
- 'AdditionalOptions': [
12+
- '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/libuv<(STATIC_LIB_SUFFIX)',
13+
- ],
14+
- },
15+
- },
16+
'conditions': [
17+
['OS!="aix" and OS!="os400" and OS!="ios" and node_shared=="false"', {
18+
'ldflags': [
119
diff --git forkSrcPrefix/deps/uv/uv.gyp forkDstPrefix/deps/uv/uv.gyp
2-
index 540445f1f3249b86c6ea15e3111644da206d2e33..2c269832cae676131f804e6d94a86fa159875a6e 100644
20+
index 540445f1f3249b86c6ea15e3111644da206d2e33..eccda72829ca0bcb958e25775d28b0e64fa6bcaf 100644
321
--- forkSrcPrefix/deps/uv/uv.gyp
422
+++ forkDstPrefix/deps/uv/uv.gyp
5-
@@ -151,7 +151,21 @@
23+
@@ -151,7 +151,39 @@
624
],
725
},
826

@@ -20,12 +38,30 @@ index 540445f1f3249b86c6ea15e3111644da206d2e33..2c269832cae676131f804e6d94a86fa1
2038
+ ],
2139
+ }],
2240
+ }],
41+
+ ['OS!="win" and uv_library=="shared_library"', {
42+
+ 'actions': [
43+
+ {
44+
+ 'action_name': 'libuv_shared_archive_alias',
45+
+ 'inputs': [
46+
+ '<(PRODUCT_DIR)/obj.target/deps/uv/libuv.so',
47+
+ ],
48+
+ 'outputs': [
49+
+ '<(PRODUCT_DIR)/obj.target/deps/uv/libuv.a',
50+
+ ],
51+
+ 'action': [
52+
+ '<(python)', '../../tools/copyfile.py',
53+
+ '<@(_inputs)',
54+
+ '<@(_outputs)',
55+
+ ],
56+
+ },
57+
+ ],
58+
+ }],
2359
+ ],
2460
+ },
2561
{
2662
'target_name': 'libuv',
2763
'toolsets': ['host', 'target'],
28-
@@ -251,7 +265,7 @@
64+
@@ -251,7 +283,7 @@
2965
# This will cause gyp to set soname
3066
# Must correspond with UV_VERSION_MAJOR
3167
# in include/uv/version.h
@@ -34,6 +70,19 @@ index 540445f1f3249b86c6ea15e3111644da206d2e33..2c269832cae676131f804e6d94a86fa1
3470
}],
3571
],
3672
}],
73+
diff --git forkSrcPrefix/common.gypi forkDstPrefix/common.gypi
74+
index ae31b372b96358a156761ec7e9c39c9530d1abd1..32aa21e333708d82e137c4eb1ae7888c1f6121b3 100644
75+
--- forkSrcPrefix/common.gypi
76+
+++ forkDstPrefix/common.gypi
77+
@@ -23,7 +23,7 @@
78+
'node_shared_openssl%': 'false',
79+
80+
'node_tag%': '',
81+
- 'uv_library%': 'static_library',
82+
+ 'uv_library%': 'shared_library',
83+
84+
'clang%': 0,
85+
'error_on_warn%': 'false',
3786
diff --git forkSrcPrefix/node.gyp forkDstPrefix/node.gyp
3887
index 0e0071b508f605bb9b7722f8304814dc176d907e..cdcb340ae4025c536f7c95bf77aaa60d4f581b73 100644
3988
--- forkSrcPrefix/node.gyp
@@ -55,34 +104,3 @@ index 0e0071b508f605bb9b7722f8304814dc176d907e..cdcb340ae4025c536f7c95bf77aaa60d
55104
],
56105

57106
'sources': [
58-
diff --git forkSrcPrefix/node.gypi forkDstPrefix/node.gypi
59-
index 36ed39f30855ff25c1c79aa3773d1383ddcb84f9..7842648b585602a6246691a8f818f6ae71f7eb7c 100644
60-
--- forkSrcPrefix/node.gypi
61-
+++ forkDstPrefix/node.gypi
62-
@@ -195,13 +195,6 @@
63-
'-Wl,-force_load,<(PRODUCT_DIR)/libuv<(STATIC_LIB_SUFFIX)',
64-
],
65-
},
66-
- 'msvs_settings': {
67-
- 'VCLinkerTool': {
68-
- 'AdditionalOptions': [
69-
- '/WHOLEARCHIVE:<(PRODUCT_DIR)/lib/libuv<(STATIC_LIB_SUFFIX)',
70-
- ],
71-
- },
72-
- },
73-
'conditions': [
74-
['OS!="aix" and OS!="os400" and OS!="ios" and node_shared=="false"', {
75-
'ldflags': [
76-
diff --git forkSrcPrefix/common.gypi forkDstPrefix/common.gypi
77-
index ae31b372b96358a156761ec7e9c39c9530d1abd1..32aa21e333708d82e137c4eb1ae7888c1f6121b3 100644
78-
--- forkSrcPrefix/common.gypi
79-
+++ forkDstPrefix/common.gypi
80-
@@ -23,7 +23,7 @@
81-
'node_shared_openssl%': 'false',
82-
83-
'node_tag%': '',
84-
- 'uv_library%': 'static_library',
85-
+ 'uv_library%': 'shared_library',
86-
87-
'clang%': 0,
88-
'error_on_warn%': 'false',

patches/linux_build_fix.patch

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
diff --git forkSrcPrefix/deps/v8/src/compiler/wasm-compiler.cc forkDstPrefix/deps/v8/src/compiler/wasm-compiler.cc
2+
index 16f1f1470b782ce3584ba4bb6626501c9f9551b7..db6da83dd1fb046b41a3d6b01b9e87c9878e6ee1 100644
3+
--- forkSrcPrefix/deps/v8/src/compiler/wasm-compiler.cc
4+
+++ forkDstPrefix/deps/v8/src/compiler/wasm-compiler.cc
5+
@@ -8438,10 +8438,11 @@ std::unique_ptr<OptimizedCompilationJob> NewJSToWasmCompilationJob(
6+
wasm::WasmFeatures enabled_features) {
7+
std::unique_ptr<char[]> debug_name = WasmExportedFunction::GetDebugName(sig);
8+
if (v8_flags.turboshaft_wasm_wrappers) {
9+
+ wasm::WrapperCompilationInfo wrapper_info;
10+
+ wrapper_info.code_kind = CodeKind::JS_TO_WASM_FUNCTION;
11+
+ wrapper_info.is_import = is_import;
12+
return Pipeline::NewWasmTurboshaftWrapperCompilationJob(
13+
- isolate, sig,
14+
- wasm::WrapperCompilationInfo{.code_kind = CodeKind::JS_TO_WASM_FUNCTION,
15+
- .is_import = is_import},
16+
+ isolate, sig, wrapper_info,
17+
module, std::move(debug_name), WasmAssemblerOptions());
18+
} else {
19+
std::unique_ptr<Zone> zone = std::make_unique<Zone>(
20+
@@ -8613,11 +8614,12 @@ wasm::WasmCompilationResult CompileWasmImportCallWrapper(
21+
'-');
22+
23+
auto compile_with_turboshaft = [&]() {
24+
+ wasm::WrapperCompilationInfo wrapper_info;
25+
+ wrapper_info.code_kind = CodeKind::WASM_TO_JS_FUNCTION;
26+
+ wrapper_info.import_info = {kind, expected_arity, suspend};
27+
return Pipeline::GenerateCodeForWasmNativeStubFromTurboshaft(
28+
env->module, sig,
29+
- wasm::WrapperCompilationInfo{
30+
- .code_kind = CodeKind::WASM_TO_JS_FUNCTION,
31+
- .import_info = {kind, expected_arity, suspend}},
32+
+ wrapper_info,
33+
func_name, WasmStubAssemblerOptions(), nullptr);
34+
};
35+
auto compile_with_turbofan = [&]() {
36+
@@ -8774,12 +8776,13 @@ MaybeHandle<Code> CompileWasmToJSWrapper(Isolate* isolate,
37+
base::VectorOf(name_buffer.get(), kMaxNameLen) + kNamePrefixLen, sig);
38+
39+
auto compile_with_turboshaft = [&]() {
40+
+ wasm::WrapperCompilationInfo wrapper_info;
41+
+ wrapper_info.code_kind = CodeKind::WASM_TO_JS_FUNCTION;
42+
+ wrapper_info.import_info = {kind, expected_arity, suspend};
43+
std::unique_ptr<turboshaft::TurboshaftCompilationJob> job =
44+
Pipeline::NewWasmTurboshaftWrapperCompilationJob(
45+
isolate, sig,
46+
- wasm::WrapperCompilationInfo{
47+
- .code_kind = CodeKind::WASM_TO_JS_FUNCTION,
48+
- .import_info = {kind, expected_arity, suspend}},
49+
+ wrapper_info,
50+
nullptr, std::move(name_buffer), WasmAssemblerOptions());
51+
52+
// Compile the wrapper

0 commit comments

Comments
 (0)