Skip to content

Commit 139aa8f

Browse files
committed
patches: add cross compiling fix to node 19
based on suggested change from nodejs/node#45756
1 parent f4b954e commit 139aa8f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

patches/node.v19.6.1.cpp.patch

+28
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ index b3718cff39..6a4a664ba0 100644
1111
}, {
1212
'lto': ' -flto ', # Clang
1313
}],
14+
diff --git node/configure.py node/configure.py
15+
index 215aee5d80..ccb59bd304 100755
16+
--- node/configure.py
17+
+++ node/configure.py
18+
@@ -1259,9 +1259,7 @@ def configure_node(o):
19+
20+
o['variables']['want_separate_host_toolset'] = int(cross_compiling)
21+
22+
- # Enable branch protection for arm64
23+
if target_arch == 'arm64':
24+
- o['cflags']+=['-msign-return-address=all']
25+
o['variables']['arm_fpu'] = options.arm_fpu or 'neon'
26+
27+
if options.node_snapshot_main is not None:
1428
diff --git node/deps/v8/include/v8-initialization.h node/deps/v8/include/v8-initialization.h
1529
index d3e35d6ec5..6e9bbe3849 100644
1630
--- node/deps/v8/include/v8-initialization.h
@@ -300,6 +314,20 @@ index dea0121566..d8618f3edb 100644
300314
} catch (e) {
301315
throw e; /* node-do-not-add-exception-line */
302316
}
317+
diff --git node/node.gyp node/node.gyp
318+
index b0f132efd8..3a43b724dc 100644
319+
--- node/node.gyp
320+
+++ node/node.gyp
321+
@@ -110,6 +110,9 @@
322+
},
323+
324+
'conditions': [
325+
+ ['target_arch=="arm64"', {
326+
+ 'cflags': ['-msign-return-address=all'], # Pointer authentication.
327+
+ }],
328+
['OS=="aix"', {
329+
'ldflags': [
330+
'-Wl,-bnoerrmsg',
303331
diff --git node/src/inspector_agent.cc node/src/inspector_agent.cc
304332
index decd9f748a..4e5afbee4f 100644
305333
--- node/src/inspector_agent.cc

0 commit comments

Comments
 (0)