odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.17k stars 550 forks source link

Support for riscv64 #3458

Open edubart opened 2 months ago

edubart commented 2 months ago

I am working on a fantasy console where its emulator is based on RISC-V architecture. I would like to allow people to use Odin to code games for it, but I noticed there is no support for riscv64 yet.

I saw that there was a PR about this at https://github.com/odin-lang/Odin/pull/743 but it was closed.

So this is a request to support riscv64 at some point in the future.

When trying to build using a RISC-V 64 Docker shell with QEMU emulator, the build fails with:

In file included from src/main.cpp:2:
In file included from src/common.cpp:19:
src/gb/gb.h:144:3: error: Unknown CPU Type
  144 |         #error Unknown CPU Type
      |          ^
src/gb/gb.h:6225:2: error: "gb_rdtsc not supported"
 6225 | #error "gb_rdtsc not supported"
      |  ^
In file included from src/main.cpp:2:
In file included from src/common.cpp:63:
src/threading.cpp:517:2: error: Unknown architecture
  517 | #error Unknown architecture
      |  ^
3 errors generated.
In file included from src/libtommath.cpp:99:
src/libtommath/mp_set_double.c:44:6: warning: "mp_set_double implementation is only available on platforms with IEEE754 floating point format" [-W#warnings]
   44 | #    warning "mp_set_double implementation is only available on platforms with IEEE754 floating point format"
      |      ^
1 warning generated.
gingerBill commented 2 months ago

If someone wants to support RISCV64, they will have to do it themselves and then make a PR. The other PR was closed for loads of reasons which I don't want to get into right now.