Open Bug 2049559 Opened 3 months ago Updated 3 months ago

Firefox 152 does not compile correctly on riscv64.

Categories

(Core :: JavaScript Engine: JIT, defect, P5)

Firefox 152
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jason, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0

Steps to reproduce:

Tried to build firefox 152.0 on Fedora Linux riscv64. The build log is here:
https://riscv-kojipkgs.fedoraproject.org//work/tasks/7616/227616/build.log

This is a regression. 151.0.3 builds fine. https://riscv-kojipkgs.fedoraproject.org/koji/buildinfo?buildID=91316

Starting with this commit jit/riscv64/Simulator-riscv64.h causes a build failure if JS_SIMULATOR_RISCV64 is not defined.
https://github.com/mozilla-firefox/firefox/commit/50ee31654072305236581ecd5e1bb87a4411af49#diff-153ebaad3fd2c836795d9d8e687e096329ade2021f0c57fc2e8d2c79b7c07458R31-R33

js/src/jit/riscv64/constant/Base-constant-riscv.cpp unconditionally includes jit/riscv64/Simulator-riscv64.h even if JS_SIMULATOR_RISCV64 is not defined.

Adding an ifdef allows the build to succeed.
diff --git a/js/src/jit/riscv64/constant/Base-constant-riscv.cpp b/js/src/jit/riscv64/constant/Base-constant-riscv.cpp
--- a/js/src/jit/riscv64/constant/Base-constant-riscv.cpp
+++ b/js/src/jit/riscv64/constant/Base-constant-riscv.cpp
@@ -13,7 +13,9 @@
#include "jit/riscv64/constant/Constant-riscv-v.h"
#include "jit/riscv64/constant/Constant-riscv-zicsr.h"
#include "jit/riscv64/constant/Constant-riscv-zifencei.h"
+#ifdef JS_SIMULATOR_RISCV64
#include "jit/riscv64/Simulator-riscv64.h"
+#endif
namespace js {
namespace jit {

Successful scratch build with this patched
https://riscv-kojipkgs.fedoraproject.org/koji/taskinfo?taskID=227669

Actual results:

The build fails.

Expected results:

The build should have succeeded.

The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine: JIT' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → JavaScript Engine: JIT
Product: Firefox → Core

I have also experienced the same before; CC'ing :anba.

This seems to be a transient state between two series of patches, the first of which managed to get onto Fx152 train while the later one didn't.

I used https://github.com/AOSC-Dev/aosc-os-abbs/blob/a2b3abf61f9244342b88a2f1dd19e9fada1825bd/app-web/firefox/autobuild/patches/0005-AOSCOS-Guard-stray-inclusion-of-Simulator-riscv64.h.patch as a solution which is similar to what Jason proposed.

This could just be an uplift needed.

Blocks: sm-riscv64
Severity: -- → S4
Priority: -- → P5
See Also: → 2038968
You need to log in before you can comment on or make changes to this bug.