Skip to content

Commit 5d9a106

Browse files
committed
Fix aarch64 cross-compile by dropping -msign-return-address on host
1 parent 6c2970b commit 5d9a106

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

libexec/build-libv8

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,11 @@ ${CXX} -v
3838
make BUILDTYPE="${BUILDTYPE}" config.gypi
3939
make BUILDTYPE="${BUILDTYPE}" "out/Makefile"
4040

41+
# workaround for node specifying `-msign-return-address=all` in ALL `CFLAGS` for aarch64 builds
42+
# (if the host isn't also aarch64, this flag causes a compiler error)
43+
if [ "$host_platform" != "$target_platform" ] && [ "${target_platform%%-*}" = "aarch64" ]; then
44+
find -iname "*.host.mk" -exec sed -i '/-msign-return-address/d' {} ';'
45+
fi
46+
4147
export PATH="${PWD}/out/tools/bin:${PATH}"
4248
make -j"${NJOBS}" -C out BUILDTYPE="${BUILDTYPE}" V=0

0 commit comments

Comments
 (0)