From dd0556a7295b5707c7d3e995400e40ac78dcfa67 Mon Sep 17 00:00:00 2001 From: Wenyong Huang Date: Thu, 16 Nov 2023 11:05:23 +0800 Subject: [PATCH] aot compiler: Disable musttail for thumb (#2771) Error is reported when executing `wamrc --target=thumb -o `: ``` LLVM ERROR: failed to perform tail call elimination on a call site marked musttail Aborted (core dumped) ``` --- core/iwasm/compilation/aot_llvm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c index 41d6e5a8..dacdb83d 100644 --- a/core/iwasm/compilation/aot_llvm.c +++ b/core/iwasm/compilation/aot_llvm.c @@ -153,6 +153,13 @@ aot_target_precheck_can_use_musttail(const AOTCompContext *comp_ctx) */ return false; } + if (strstr(comp_ctx->target_arch, "thumb")) { + /* + * cf. + * https://github.com/bytecodealliance/wasm-micro-runtime/issues/2412 + */ + return false; + } /* * x86-64/i386: true *