Closed Bug 2088596 Opened 11 days ago Closed 5 days ago

[riscv64] Simulator build fails on macOS with an ambiguous call to setCallResult

Categories

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

RISCV64
Unspecified
defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- wontfix
firefox159 --- wontfix
firefox160 --- wontfix
firefox161 --- wontfix
firefox162 --- fixed

People

(Reporter: andrew, Assigned: andrew)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

Building the JS shell with --enable-simulator=riscv64 on a macOS host fails:

js/src/jit/riscv64/Simulator-riscv64.cpp: error: call to member function 'setCallResult' is ambiguous
      ABI_FUNCTION_TYPE_RISCV64_SIM_DISPATCH
note: expanded from macro 'ABI_FUNCTION_TYPE_RISCV64_SIM_DISPATCH'
  setCallResult(ret);
note: candidate function: void Simulator::setCallResult(int64_t res)
note: candidate function: void Simulator::setCallResult(__int128_t res)

The dispatch generated by GenerateABIFunctionType.py since bug 1975350 passes the result of a native call with a General return type, an intptr_t, straight to setCallResult, which has int64_t and __int128 overloads. On Linux intptr_t and int64_t are both long, but on macOS int64_t is long long, so the long result converts equally well to either overload.

Bug 1967367 fixed the same problem in the loong64 and mips64 simulators with a Darwin-only setCallResult(intptr_t) overload. For riscv64 the generator can instead convert General results with I64, as it already does for Int32 results.

The generated simulator dispatch passed General results, which are
intptr_t, straight to setCallResult, which has int64_t and __int128
overloads. On macOS intptr_t is long and int64_t is long long, so the
call is ambiguous and the riscv64 simulator does not compile. Convert
General results with I64, as Int32 results already are.

Assignee: nobody → andrew
Status: NEW → ASSIGNED

Set release status flags based on info from the regressing bug 1975350

Blocks: sm-riscv64
Hardware: Unspecified → RISCV64

Set release status flags based on info from the regressing bug 1975350

Attachment #9673572 - Attachment description: Bug 2088596 - [riscv64] Fix the simulator build on macOS. r?csmantle → Bug 2088596 - [riscv64] Fix the simulator build on macOS. r?csmantle,#spidermonkey-reviewers
Severity: -- → S3
Priority: -- → P2
Pushed by jdemooij@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b620354d5bb0 https://hg.mozilla.org/integration/autoland/rev/e12d2f331b5c [riscv64] Fix the simulator build on macOS. r=csmantle,spidermonkey-reviewers,jandem
Status: ASSIGNED → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: