Bug 1994624 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I'm just the messenger as i don't have such hardware, but the build fails in the JIT engine since its been enabled by default in 1982266:
```
/local/pobj/firefox-143.0.3/firefox-143.0.3/js/src/jit/riscv64/Architecture-riscv64.cpp:89:4: error: "Unsupported platform" 89
 | #  error "Unsupported platform"
```
i suppose it might affect the other BSDs.

a simple fix (from jca, in cc) is inlined below, which i can push if deemed acceptable :
```
--- js/src/jit/riscv64/Architecture-riscv64.cpp.orig
+++ js/src/jit/riscv64/Architecture-riscv64.cpp
@@ -76,7 +76,7 @@ void FlushICache(void* code, size_t size) {
 #if defined(JS_SIMULATOR)
   js::jit::SimulatorProcess::FlushICache(code, size);
 
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__OpenBSD__)
 #  if defined(__GNUC__)
   intptr_t end = reinterpret_cast<intptr_t>(code) + size;
   __builtin___clear_cache(reinterpret_cast<char*>(code),
--- js/src/wasm/WasmSignalHandlers.cpp.orig
+++ js/src/wasm/WasmSignalHandlers.cpp
@@ -100,6 +100,12 @@ using namespace js::wasm;
 #      define RLR_sig(p) ((p)->sc_lr)
 #      define R31_sig(p) ((p)->sc_sp)
 #    endif
+#    if defined(__riscv)
+#      define RPC_sig(p) ((p)->sc_sepc)
+#      define RRA_sig(p) ((p)->sc_ra)
+#      define RFP_sig(p) ((p)->sc_s[0])
+#      define R02_sig(p) ((p)->sc_sp)
+#    endif
 #    if defined(__mips__)
 #      define EPC_sig(p) ((p)->sc_pc)
 #      define RFP_sig(p) ((p)->sc_regs[30])
```

given the full list of riscv64 bugs (https://bugzilla.mozilla.org/buglist.cgi?quicksearch=riscv64&list_id=17728043) we might disable the jit on OpenBSD/riscv64 until it's been more battle tested - or at least someone (tm) has run the full jit testsuite and compared the results with other platforms.
I'm just the messenger as i don't have such hardware, but the build fails in the JIT engine since its been enabled by default in bug 1982266:
```
/local/pobj/firefox-143.0.3/firefox-143.0.3/js/src/jit/riscv64/Architecture-riscv64.cpp:89:4: error: "Unsupported platform" 89
 | #  error "Unsupported platform"
```
i suppose it might affect the other BSDs.

a simple fix (from jca, in cc) is inlined below, which i can push if deemed acceptable :
```
--- js/src/jit/riscv64/Architecture-riscv64.cpp.orig
+++ js/src/jit/riscv64/Architecture-riscv64.cpp
@@ -76,7 +76,7 @@ void FlushICache(void* code, size_t size) {
 #if defined(JS_SIMULATOR)
   js::jit::SimulatorProcess::FlushICache(code, size);
 
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__OpenBSD__)
 #  if defined(__GNUC__)
   intptr_t end = reinterpret_cast<intptr_t>(code) + size;
   __builtin___clear_cache(reinterpret_cast<char*>(code),
--- js/src/wasm/WasmSignalHandlers.cpp.orig
+++ js/src/wasm/WasmSignalHandlers.cpp
@@ -100,6 +100,12 @@ using namespace js::wasm;
 #      define RLR_sig(p) ((p)->sc_lr)
 #      define R31_sig(p) ((p)->sc_sp)
 #    endif
+#    if defined(__riscv)
+#      define RPC_sig(p) ((p)->sc_sepc)
+#      define RRA_sig(p) ((p)->sc_ra)
+#      define RFP_sig(p) ((p)->sc_s[0])
+#      define R02_sig(p) ((p)->sc_sp)
+#    endif
 #    if defined(__mips__)
 #      define EPC_sig(p) ((p)->sc_pc)
 #      define RFP_sig(p) ((p)->sc_regs[30])
```

given the full list of riscv64 bugs (https://bugzilla.mozilla.org/buglist.cgi?quicksearch=riscv64&list_id=17728043) we might disable the jit on OpenBSD/riscv64 until it's been more battle tested - or at least someone (tm) has run the full jit testsuite and compared the results with other platforms.

Back to Bug 1994624 Comment 0