mozjs: Fix build for 32bit systems disabling JIT

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj
2021-10-26 10:37:42 -07:00
parent f917e5fe40
commit 7c20920cb6
3 changed files with 22 additions and 10 deletions
@@ -0,0 +1,21 @@
Fix build when JIT is disabled on 32bit systems
This fixes a compile time assert
js/src/wasm/WasmFrame.cpp:57:3: error: static_assert failed due to requirement '(__builtin_offsetof(js::wasm::DebugFrame, frame_) + sizeof(js::wasm::Frame)) % Alignment == 0' "Aligned after pushing DebugFrame"
static_assert((offsetof(DebugFrame, frame_) + sizeof(Frame)) % Alignment == 0,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/js/src/wasm/WasmFrame.h
+++ b/js/src/wasm/WasmFrame.h
@@ -230,6 +230,8 @@ class DebugFrame {
// Avoid -Wunused-private-field warnings.
protected:
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_ARM) || \
+ (defined(JS_CODEGEN_NONE) && \
+ (defined(__riscv) && __riscv_xlen == 32) || defined(__mips__)) || \
defined(JS_CODEGEN_X86) || defined(__wasi__)
// See alignmentStaticAsserts(). For MIPS32, ARM32 and X86 DebugFrame is only
// 4-byte aligned, so we add another word to get up to 8-byte
@@ -43,13 +43,3 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
"riscv64-unknown-linux-gnu": little_endian + {"__riscv": 1, "__riscv_xlen": 64},
"sh4-unknown-linux-gnu": little_endian + {"__sh__": 1},
}
--- a/js/src/wasm/WasmFrame.h
+++ b/js/src/wasm/WasmFrame.h
@@ -230,6 +230,7 @@ class DebugFrame {
// Avoid -Wunused-private-field warnings.
protected:
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_ARM) || \
+ (defined(JS_CODEGEN_NONE) && defined(__riscv) && __riscv_xlen == 32) || \
defined(JS_CODEGEN_X86) || defined(__wasi__)
// See alignmentStaticAsserts(). For MIPS32, ARM32 and X86 DebugFrame is only
// 4-byte aligned, so we add another word to get up to 8-byte
@@ -11,6 +11,7 @@ SRC_URI = "https://archive.mozilla.org/pub/firefox/releases/${PV}esr/source/fire
file://fix-musl-build.patch \
file://0001-build-do-not-use-autoconf-s-config.sub-to-canonicali.patch \
file://riscv32.patch \
file://nojit-32bit-arch-fix.patch \
"
SRC_URI[sha256sum] = "3ef3cfd321d0c2c80ee1b41b8baf7a1ea4daf93c29e1377274933440ff5e42c3"