-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help on compiling for iOS #151
Comments
That's weird, in theory it's more likely to pass compilation if JIT is disabled. BTW it's 2024 now, have you got around this issue? |
Try changing this code in machine.h so that it always returns false. #if defined(NOLINEAR) || defined(__SANITIZE_THREAD__) || \
defined(__CYGWIN__) || defined(__NetBSD__) || defined(__COSMOPOLITAN__)
#define CanHaveLinearMemory() false
#else
#define CanHaveLinearMemory() CAN_64BIT
#endif |
Thanks for the reply! The current version compiles for iOS with |
I spoke too fast.
|
That's the first instruction of your program. Something inside Blink is possibly crashing. Try to install libunwind and get blink to depend on libunwind, so that when it crashes, it can print a backtrace into blink. Maybe add printf() statements to loader.c and argv.c. It's probably crashing around there. I'm particularly interested in knowing what number blink detected for |
Thanks for the help. I'm going to investigate where you said. |
You're making sure that the linear memory optimization is disabled, correct? |
I've been compiling with |
So far, I've tracked it to Line 89 in 222064a
The first entry read from memory when executing is 0x6000010398cc05 for goodhello.elf , and 0x8060000120024c07 for tinyhello.elf . Since mask (PAGE_XD ) is 0x8000000000000000 , that makes this test in LookupAddress2 fail (need is 0):Line 279 in 222064a
I'll keep investigating. |
Continuing my investigation: the first difference between Line 215 in 222064a
which is just before this warning: Line 216 in 222064a
So we use LoaderCopy() to load the binary content instead of what is used for goodhello.elf .
So (tentative hypothesis) it would be the copy operator that has an issue with iOS. I'll keep investigating. |
If I change the value of This is probably connected to a specificity of iOS: there are several ways to check if a file is executable in Unix. On iOS, some of these work (they check the executable bit), while other methods will always return false. Which makes sense from the system point of view, since files are not supposed to be executed. |
If I replace this protection in a call to Line 72 in 222064a
with: PROT_READ | PROT_WRITE | PROT_EXEC , false)); then |
Hi,
I've been trying to cross-compile blink for iOS. Part of the problem is that, from the compiler viewpoint, it is very difficult to separate iOS from a M1 Mac: both have
__APPLE__
and__aarch64__
defined.(There are other issues, such as
/tmp
not being accessible, the need to redirect standard output, and the fact that many files don't have the X-bit set even though they're executable, but I'm used to these by now).So far, my efforts have resulted into:
-m
flag when launching blink:-m
flag: it crashes the entire app (that's expected) andblink.log
contains the following:Compiling for OSX with
--disable-jit
does work, it's just with iOS that I have this weird issue. I don't understand what is happening; I'd appreciate if anyone could point me in the right direction.The text was updated successfully, but these errors were encountered: