Skip to content

Commit

Permalink
add patch until upstream arm64 cross compilation is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
theofficialgman committed Jul 18, 2023
1 parent 74fd9ac commit 87a44f5
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions recipes/arm64/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,40 @@ cd /home/node
tar -xf node.tar.xz
cd "node-${fullversion}"

# see https://github.com/nodejs/node/pull/45756
cat << "EOF" > correct-cflags.patch
diff --git a/configure.py b/configure.py
index a6dae354d4233..e2bb9dce12795 100755
--- a/configure.py
+++ b/configure.py
@@ -1247,9 +1247,7 @@ def configure_node(o):
o['variables']['want_separate_host_toolset'] = int(cross_compiling)
- # Enable branch protection for arm64
if target_arch == 'arm64':
- o['cflags']+=['-msign-return-address=all']
o['variables']['arm_fpu'] = options.arm_fpu or 'neon'
if options.node_snapshot_main is not None:
diff --git a/node.gyp b/node.gyp
index 448cb8a8c7cd4..6cec024ffe722 100644
--- a/node.gyp
+++ b/node.gyp
@@ -109,6 +109,9 @@
},
'conditions': [
+ ['target_arch=="arm64"', {
+ 'cflags': ['-msign-return-address=all'], # Pointer authentication.
+ }],
['OS in "aix os400"', {
'ldflags': [
'-Wl,-bnoerrmsg',
EOF
git apply correct-cflags.patch --verbose
rm -f correct-cflags.patch

export CC_host="ccache gcc-8"
export CXX_host="ccache g++-8"
export CC="ccache aarch64-linux-gnu-gcc-8"
Expand Down

0 comments on commit 87a44f5

Please sign in to comment.