Closed Bug 1967367 Opened 1 year ago Closed 1 year ago

[macOS] riscv64, mips64 and loong64 simulators fail to build

Categories

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

Firefox 140
defect

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: chenx97, Assigned: chenx97)

References

Details

Attachments

(1 external file)

Steps to reproduce:

Build with a simulator-building mozconfig, e.g.:

ac_add_options --enable-project=js
ac_add_options --enable-simulator=loong64
ac_add_options --disable-wasm-jspi
ac_add_options --enable-debug

Then try to build mips64 and riscv64 simulators.

Actual results:

Lots of errors come from mixing intptr_t and int64_t as they are defined differently on macOS.

error: format specifies type 'unsigned long *' but the argument has type 'uint64_t *' (aka 'unsigned long long ') [-Werror,-Wformat]
0:59.70 807 | return sscanf(desc + 2, "%lx", reinterpret_cast<uint64_t
>(value)) == 1;
0:59.70 | ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0:59.71 | %llx

Expected results:

These errors shouldn't exist.

error: format specifies type 'unsigned long *' but the argument has type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wformat]
 0:59.70   807 |     return sscanf(desc + 2, "%lx", reinterpret_cast<uint64_t*>(value)) == 1;
 0:59.70       |                              ~~~   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 0:59.71       |                              %llx

On macOS, int64_t is long long while intptr_t is long. Many of the
simulators have only been tested on Linux, so the mixed use of both
types haven't been caught. This problem also affects format strings
as the underlying types of int64_t changes, so macros like PRIx64
have to be used here instead.

Assignee: nobody → chenx97
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by andre.bargull@gmail.com: https://hg.mozilla.org/integration/autoland/rev/eca166bc919d [macOS] Fix build of various simulators. r=anba
Severity: -- → S4
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
QA Whiteboard: [qa-triage-done-c141/b140]
See Also: → 2088596
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: