1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-25 20:25:28 +03:00
aports/testing/horizon/riscv.patch
2021-07-10 14:19:23 +02:00

24 lines
1.1 KiB
Diff

Seems like horizon has basic RISC-V support, e.g. the valid_arches array
in meta.cc already contains riscv. However, it seems the my_arch
function was not adjusted for riscv yet since the software likekly
wasn't compiled on riscv before. By adding the neccessary
riscv-ifdef-dance to my_arch from meta.cc it compiles fine on riscv.
This patch assumes that riscv means RV32 and riscv64 means RV64.
See also https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md
diff -upr horizon-0.9.6.orig/hscript/meta.cc horizon-0.9.6/hscript/meta.cc
--- horizon-0.9.6.orig/hscript/meta.cc 2021-07-10 19:29:55.073675786 +0200
+++ horizon-0.9.6/hscript/meta.cc 2021-07-10 19:43:31.674242939 +0200
@@ -716,6 +716,10 @@ const std::string my_arch(const Horizon:
return "pmmx";
# elif defined(__x86_64__)
return "x86_64";
+# elif defined(__riscv) && __riscv_xlen == 32
+ return "riscv";
+# elif defined(__riscv) && __riscv_xlen == 64
+ return "riscv64";
# elif defined(__mips64)
# if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
return "mips64el";