From bdb58e042be9577b8b8b26ee5036fa75eedd3276 Mon Sep 17 00:00:00 2001 From: Zhenwei Jin <109658203+kylo5aby@users.noreply.github.com> Date: Mon, 23 Mar 2026 09:44:50 +0800 Subject: [PATCH] Fix LLVM ORC JIT relocation failure caused by InternalLinkage stack_sizes (#4880) Signed-off-by: zhenweijin --- core/iwasm/compilation/aot_llvm.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/core/iwasm/compilation/aot_llvm.c b/core/iwasm/compilation/aot_llvm.c index 4e8fd2cf5..1a9da63fa 100644 --- a/core/iwasm/compilation/aot_llvm.c +++ b/core/iwasm/compilation/aot_llvm.c @@ -1834,18 +1834,12 @@ aot_create_stack_sizes(const AOTCompData *comp_data, AOTCompContext *comp_ctx) return false; } - /* - * make the original symbol internal. we mainly use this version to - * avoid creating extra relocations in the precheck functions. - */ - LLVMSetLinkage(stack_sizes, LLVMInternalLinkage); - /* - * for AOT, place it into a dedicated section for the convenience - * of the AOT file generation and symbol resolutions. - * - * for JIT, it doesn't matter. - */ if (!comp_ctx->is_jit_mode) { + LLVMSetLinkage(stack_sizes, LLVMInternalLinkage); + /* + * for AOT, place it into a dedicated section for the convenience + * of the AOT file generation and symbol resolutions. + */ LLVMSetSection(stack_sizes, aot_stack_sizes_section_name); } comp_ctx->stack_sizes_type = stack_sizes_type;