Skip to content

Commit c45cc02

Browse files
add patch until upstream arm64 cross compilation is fixed
see nodejs/node#45756
1 parent a0feac6 commit c45cc02

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

recipes/arm64-glibc-227/run.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,40 @@ cd /home/node
1717
tar -xf node.tar.xz
1818
cd "node-${fullversion}"
1919

20+
# see https://github.com/nodejs/node/pull/45756
21+
cat << "EOF" > correct-cflags.patch
22+
diff --git a/configure.py b/configure.py
23+
index a6dae354d4233..e2bb9dce12795 100755
24+
--- a/configure.py
25+
+++ b/configure.py
26+
@@ -1247,9 +1247,7 @@ def configure_node(o):
27+
28+
o['variables']['want_separate_host_toolset'] = int(cross_compiling)
29+
30+
- # Enable branch protection for arm64
31+
if target_arch == 'arm64':
32+
- o['cflags']+=['-msign-return-address=all']
33+
o['variables']['arm_fpu'] = options.arm_fpu or 'neon'
34+
35+
if options.node_snapshot_main is not None:
36+
diff --git a/node.gyp b/node.gyp
37+
index 448cb8a8c7cd4..6cec024ffe722 100644
38+
--- a/node.gyp
39+
+++ b/node.gyp
40+
@@ -109,6 +109,9 @@
41+
},
42+
43+
'conditions': [
44+
+ ['target_arch=="arm64"', {
45+
+ 'cflags': ['-msign-return-address=all'], # Pointer authentication.
46+
+ }],
47+
['OS in "aix os400"', {
48+
'ldflags': [
49+
'-Wl,-bnoerrmsg',
50+
EOF
51+
git apply correct-cflags.patch --verbose
52+
rm -f correct-cflags.patch
53+
2054
export CC_host="ccache gcc-8"
2155
export CXX_host="ccache g++-8"
2256
export CC="ccache aarch64-linux-gnu-gcc-8"

0 commit comments

Comments
 (0)