|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH v2 11/20] util/cacheflush.c: Update cache flushing mechanism for Emscripten |
Date: | Tue, 22 Apr 2025 08:48:34 +0200 |
User-agent: | Mozilla Thunderbird |
On 22/4/25 07:27, Kohei Tokunaga wrote:
Although __builtin___clear_cache is used to flush the instruction cache for a specified memory region[1], this operation doesn't apply to wasm, as its memory isn't executable. Moreover, Emscripten does not support this builtin and fails to compile it with the following error.fatal error: error in backend: llvm.clear_cache is not supported on wasm
Note, you mix LLVM error ...
To resolve this, this commit removes the call to __builtin___clear_cache for Emscripten build. [1] https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Other-Builtins.html#index-_005f_005fbuiltin_005f_005f_005fclear_005fcache
... with this GCC documentation: If the target does not require instruction cache flushes, __builtin___clear_cache has no effect. I'd expect __builtin___clear_cache() to be OK, having no effect on a GCC WASM implementation.
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com> --- include/qemu/cacheflush.h | 7 +++++++ util/cacheflush.c | 4 ++++ 2 files changed, 11 insertions(+)
[Prev in Thread] | Current Thread | [Next in Thread] |