IoLanguage / io

Io programming language. Inspired by Self, Smalltalk and LISP.
http://iolanguage.org
Other
2.66k stars 298 forks source link

Does not support Apple Silicon #465

Open fxcoudert opened 1 year ago

fxcoudert commented 1 year ago

Compilation on ARM macOS (aka Apple Silicon) leads to a build failure:

/tmp/io-20221111-68531-j5uskf/io-2017.09.06/libs/coroutine/source/asm.S:143:2: error: unrecognized instruction mnemonic
 mflr r0
 ^
/tmp/io-20221111-68531-j5uskf/io-2017.09.06/libs/coroutine/source/asm.S:144:2: error: unrecognized instruction mnemonic
 mfcr r5
 ^
/tmp/io-20221111-68531-j5uskf/io-2017.09.06/libs/coroutine/source/asm.S:145:2: error: unrecognized instruction mnemonic
 mfctr r6
 ^
/tmp/io-20221111-68531-j5uskf/io-2017.09.06/libs/coroutine/source/asm.S:146:2: error: unrecognized instruction mnemonic
 mfxer r7
 ^
/tmp/io-20221111-68531-j5uskf/io-2017.09.06/libs/coroutine/source/asm.S:147:13: error: unexpected token in argument list
 stw r0, 0*4(r3)
            ^
shayneoneill commented 6 months ago

Any chance of getting this fixed? Intel macs are getting closer and closer to EOLed for support, and with that usually comes the end of Rosetta.

PedroBatista commented 6 months ago

I think Rosetta will be around for many years, the problem is ( seems to be ) the assembly code in asm.S. It also blocked me from running this with WASM.

Since assembly programming is a long lost art, my guess would be to tell ChatGPT to translate it ( unlikely ) or to implement #define NEEDARMCONTEXT 1

define SET setmcontext

define GET getmcontext

in C.


@fxcoudert @shayneoneill Just noticed in the original post the build is entering in the #ifdef NEEDPOWERCONTEXT instead of the #ifdef NEEDARMCONTEXT. If you can make it enter the ARM part perhaps there is no problem with the code itself since it's 32bit ARM, I don't know for sure but ARM64 should support 32bit registers?

stevedekorte commented 6 months ago

I thought Apple finally got ucontext working. If so, we can just set the ifdef for that.

stevedekorte commented 6 months ago

I think Rosetta will be around for many years, the problem is ( seems to be ) the assembly code in asm.S. It also blocked me from running this with WASM.

There is an IoWASM project: https://github.com/stevedekorte/ioWasm

And an online REPL demo that uses it: https://iolanguage.org/repl/index.html

Would be great to see some bindings into JS and the DOM.

shayneoneill commented 6 months ago

@PedroBatista Perhaps, but the original Rosetta (for running PowerPC apps on Intel macs) really only was around for about 4-5 years, and we're at year 3 with Rosetta2. So maybe a couple of more years? Its a bit of breathing room, but not much. Theres still a fair few legacy Intel macs out there, and Apple for all its faults, is likely not in a hurry to go kicking its legacy customers out of its software distribution pipelines. But apple does have form for this sort of deprecation too.

That said, Apple will likely give some deprecation notice a version or two of macos before yeeting it.

stevedekorte commented 6 months ago

I'd happy offer a bounty (say $200?) for anyone to do this. I'd do it myself but I'm busy with another project and haven't touched XCode in ages.