Closed Bug 1747738 Opened 4 years ago Closed 4 years ago

Build failure with --disable-optimize and --disable-jit

Categories

(Core :: JavaScript Engine: JIT, defect)

Firefox 97
defect

Tracking

()

RESOLVED DUPLICATE of bug 1747087

People

(Reporter: tjc, Assigned: tjc)

Details

Attachments

(1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36

Steps to reproduce:

I tried to build bookmarks-central (commit 56d042fb65e64c578add3fdf91198824e52802a7 ) with the following flags in my .mozconfig:

ac_add_options --disable-jit --enable-warnings-as-errors --disable-optimize

Actual results:

I got the following linker error:

'js/src/build/libjs_static.a
js/src/build/libmozjs-97a1.so
ld.lld: error: undefined hidden symbol: js::jit::LIRGeneratorShared::lowerWasmCompareAndSelect(js::jit::MWasmSelect*, js::jit::MDefinition*, js::jit::MDefinition*, js::jit::MCompare::CompareType, JSOp)

referenced by Lowering.cpp:6490 (/home/tjc/gecko-fork/js/src/jit/Lowering.cpp:6490)
/home/tjc/gecko-fork/obj/js/src/build/../jit/Unified_cpp_js_src_jit7.o:(js::jit::LIRGenerator::visitWasmSelect(js::jit::MWasmSelect*))
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)'

I don't see the error unless I have both --disable-jit and --disable-optimize in my .mozconfig.

Expected results:

The build should have succeeded.

If I make the following change to js/src/jit/Lowering.cpp:

`
diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp
index 5ace05dcb545c..e3580684a413f 100644
--- a/js/src/jit/Lowering.cpp
+++ b/js/src/jit/Lowering.cpp
@@ -6469,6 +6469,7 @@ void LIRGenerator::visitIonToWasmCall(MIonToWasmCall* ins) {
assignSafepoint(lir, ins);
}

+#ifndef JS_CODEGEN_NONE
void LIRGenerator::visitWasmSelect(MWasmSelect* ins) {
MDefinition* condExpr = ins->condExpr();

@@ -6499,6 +6500,7 @@ void LIRGenerator::visitWasmSelect(MWasmSelect* ins) {

lowerWasmSelectI(ins);
}
+#endif
`

that fixes the problem. I'll submit a patch, but I don't know if that's the right thing.

Because visitWasmSelect() depends on the architecture-specific
lowerWasmCompareAndSelect() method, it was causing a compilation failure when
the flags --disable-jit and --disable-optimize were both supplied.
Ifdef this out if JS_CODEGEN_NONE is defined (JIT is disabled).

Assignee: nobody → tjc
Attachment #9256922 - Attachment description: WIP: Bug 1747738 -- Don't define LIRGenerator::visitWasmSelect if JIT is disabled → Bug 1747738 -- Don't define LIRGenerator::visitWasmSelect if JIT is disabled r=arai

I filed Bug 1747766 to add a CI target with this combination of flags, so this bug can just track fixing the specific build failure.

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
Attachment #9256922 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: