Files
video/libs/wpewebkit/patches/129-bmalloc-enable-libpas-on-Linux-RISCV64.patch
T
Daniel Golle df0b899123 wpewebkit: update to version 2.52.3
Update WPEWebKit to the 2.52 stable major release branch.

Includes a pending patchset to get WASM BBQJIT working on RISCV64,
upstream PR https://github.com/WebKit/WebKit/pull/65621

Alltogether this brings acceptable performance (even with LLVMPipe
Mesa software renderer) on RISCV64.

Link: https://wpewebkit.org/release/wpewebkit-2.52.0.html
Link: https://wpewebkit.org/release/wpewebkit-2.52.1.html
Link: https://wpewebkit.org/release/wpewebkit-2.52.2.html
Link: https://wpewebkit.org/release/wpewebkit-2.52.3.html
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-05-27 19:27:26 +01:00

48 lines
1.9 KiB
Diff

From: Daniel Golle <daniel@makrotopia.org>
Subject: [PATCH] bmalloc: enable libpas on Linux/RISCV64
bmalloc's BPlatform.h enabled the libpas-backed bmalloc only on a
small allow-list of 64-bit Linux architectures (X86_64 and ARM64).
RISCV64 was missing from that list, so LIBPAS_ENABLED ended up 0 and
the inline allocator entry points bmalloc_*_inline (declared inside
'#if LIBPAS_ENABLED' in bmalloc_heap_inlines.h) were not available.
JSC consumers - e.g. StructureAlignedMemoryAllocator.cpp calling
bmalloc_try_allocate_auxiliary_with_alignment_inline /
bmalloc_deallocate_inline - then fail to compile with "was not
declared in this scope".
RISCV64 is just another 64-bit Linux target as far as libpas is
concerned, so:
* Add a BCPU(RISCV64) macro alongside the existing BCPU(X86_64) /
BCPU(ARM64) definitions, gated on __riscv && __riscv_xlen == 64.
* Add BCPU(RISCV64) to the BENABLE(LIBPAS) allow-list for Linux.
This is what gives RISCV64 the same libpas-backed bmalloc as the
other supported 64-bit Linux targets.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- a/Source/bmalloc/bmalloc/BPlatform.h
+++ b/Source/bmalloc/bmalloc/BPlatform.h
@@ -172,6 +172,11 @@
#endif
#endif
+/* BCPU(RISCV64) - RISC-V 64-bit */
+#if defined(__riscv) && __riscv_xlen == 64
+#define BCPU_RISCV64 1
+#endif
+
/* BCPU(ARM) - ARM, any version*/
#define BARM_ARCH_AT_LEAST(N) (BCPU(ARM) && BARM_ARCH_VERSION >= N)
@@ -379,7 +384,7 @@
/* BENABLE(LIBPAS) is enabling libpas build. But this does not mean we use libpas for bmalloc replacement. */
#if !defined(BENABLE_LIBPAS)
-#if BCPU(ADDRESS64) && (BOS(DARWIN) || BOS(WINDOWS) || (BOS(LINUX) && (BCPU(X86_64) || BCPU(ARM64))) || BPLATFORM(PLAYSTATION))
+#if BCPU(ADDRESS64) && (BOS(DARWIN) || BOS(WINDOWS) || (BOS(LINUX) && (BCPU(X86_64) || BCPU(ARM64) || BCPU(RISCV64))) || BPLATFORM(PLAYSTATION))
#define BENABLE_LIBPAS 1
#ifndef PAS_BMALLOC
#define PAS_BMALLOC 1