mratsim / weave

A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead
Other
532 stars 22 forks source link

Weave doesn't compile on MacOS with arm64 #185

Closed its5Q closed 1 year ago

its5Q commented 1 year ago

I can't compile any program with Weave on a M1 Macbook. I'm using Nim 1.6.8. Here's the error:

/Users/admin/.cache/nim/scan_r/@m..@s..@s..@s.nimble@spkgs@sweave-0.4.0@sweave@smemory@smemory_pools.nim.c:313:14: error: unknown token in expression
        asm(        "movq %%gs:0, %0":"=r"(result)::
                    ^
<inline asm>:1:7: note: instantiated into assembly here
        movq %gs:0, x8
             ^
/Users/admin/.cache/nim/scan_r/@m..@s..@s..@s.nimble@spkgs@sweave-0.4.0@sweave@smemory@smemory_pools.nim.c:313:14: error: invalid operand
        asm(        "movq %%gs:0, %0":"=r"(result)::
                    ^
<inline asm>:1:7: note: instantiated into assembly here
        movq %gs:0, x8
             ^
/Users/admin/.cache/nim/scan_r/@m..@s..@s..@s.nimble@spkgs@sweave-0.4.0@sweave@smemory@smemory_pools.nim.c:313:14: error: unknown token in expression
        asm(        "movq %%gs:0, %0":"=r"(result)::
                    ^
<inline asm>:1:7: note: instantiated into assembly here
        movq %gs:0, x8
             ^
/Users/admin/.cache/nim/scan_r/@m..@s..@s..@s.nimble@spkgs@sweave-0.4.0@sweave@smemory@smemory_pools.nim.c:313:14: error: invalid operand
        asm(        "movq %%gs:0, %0":"=r"(result)::
                    ^
<inline asm>:1:7: note: instantiated into assembly here
        movq %gs:0, x8

I've tried gcc and clang.

its5Q commented 1 year ago

As a workaround for now, I compile a x86-64 executable that runs through Rosetta, but that's not ideal

mratsim commented 1 year ago

This should hopefully be fixed via #187 but I don't have an Apple M1 to confirm