You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The -mbranch-protection=standard compiler flag only exists on ARM64 versions of GCC/G++.
This bug happens because as declared in node.gyp the build system passes the -mbranch-protection=standard flag to the compiler when targeting an ARM64 machine which was introduced by this issue and particularly this PR. This is not a problem when the host machine is an ARM64 device and compiles for ARM64, but it is problematic when the host is not an ARM64 device but is trying to compile for an ARM64 device. The solution to this would be to not pass this compiler flag for targets that are meant to be compiled with the host toolchain which is js2c (reference) in this case considering the host not being an ARM64 device.
The text was updated successfully, but these errors were encountered:
devraymondsh
changed the title
Cross-compilation bug when compiling for ARM64 on a non-ARM64 host
Cross-compilation bug when compiling for ARM64 on a non-ARM64 host with Linux
Apr 24, 2024
Version
v21.7.3
Platform
Linux raymond 6.8.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 05 Apr 2024 00:14:23 +0000 x86_64 GNU/Linux
What steps will reproduce the bug?
Cross-compiling for Linux ARM64 on a Linux x86_64 machine.
What is the expected behavior? Why is that the expected behavior?
Should compile.
What do you see instead?
Here's the log:
Additional information
The
-mbranch-protection=standard
compiler flag only exists on ARM64 versions of GCC/G++.This bug happens because as declared in node.gyp the build system passes the
-mbranch-protection=standard
flag to the compiler when targeting an ARM64 machine which was introduced by this issue and particularly this PR. This is not a problem when the host machine is an ARM64 device and compiles for ARM64, but it is problematic when the host is not an ARM64 device but is trying to compile for an ARM64 device. The solution to this would be to not pass this compiler flag for targets that are meant to be compiled with the host toolchain which is js2c (reference) in this case considering the host not being an ARM64 device.The text was updated successfully, but these errors were encountered: