On 17/4/25 11:27, Kohei Tokunaga wrote:
Hi Philippe,

 > The "why?" isn't clearly described.


I'm happy with the following ...

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

To resolve this, I've removed the call to __builtin___clear_cache.

... used as commit description,


I'll update this patch to include an explicit "#elif" branch with an
explanation, like the following:

+#elif defined(EMSCRIPTEN)
+
+/* Wasm does not have an executable memory region. */
+

and this comment in the code. Thanks!


Please let me know if I'm missing something or if there is a preferred way
to handle this case.

[1] https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Other- Builtins.html#index-_005f_005fbuiltin_005f_005f_005fclear_005fcache <https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Other- Builtins.html#index-_005f_005fbuiltin_005f_005f_005fclear_005fcache>



Reply via email to