nodejs-mobile / nodejs-mobile

Full-fledged Node.js on Android and iOS
https://nodejs-mobile.github.io
Other
458 stars 44 forks source link

EXC_BAD_INSTRUCTION on iPhone 7 #62

Open Porizm opened 6 months ago

Porizm commented 6 months ago

Version

18.17.2

Platform

iOS 15.7.8

Subsystem

No response

What steps will reproduce the bug?

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

-Run without errors

What do you see instead?

Screenshot 2023-10-31 at 3 04 50 PM

Additional information

I think it's related to arm version. Is there a way to fix it? like compiling for armv8-a ?

Note: release build in repo works on iPhone 7, but when i rebuild it cause the error.

Thank you in advance

staltz commented 6 months ago

This happens because you built NodeMobile from a MacBook M1 machine, which will use ARM instructions available to M1, which is armv8.2 and has assembly instructions such as FJCVTZS which doesn't exist on iPhone 7 with the Apple A10 chip which has armv8.1 instruction set.

The actual issue here is that we need to find a way to compile NodeMobile iOS from M1 hosts, in a way that uses only armv8.0 instructions. But I haven't found a way for that yet.

Porizm commented 6 months ago

@staltz I compiled node 16.17.1 on same machine few months ago and it works on iPhone 7 (had xcode 14 that time)

Could it be some configurations changed in 18.17.2 ?

staltz commented 6 months ago

I recall having this same EXC_BAD_INSTRUCTION problem on Mac M1s also when working on NodeMobile 16.17.1

Porizm commented 6 months ago

That's strange. I already compiled and it's on apple store, and it works on iphone 7