Skip to content

Commit cb0ec6c

Browse files
committed
aot_create_comp_context: disable small data section
I observed errors like the following when trying to upgrade our LLVM from 15 to 19. ``` AOT module load failed: resolve symbol .srodata.cst8 failed ``` The concept itself has been available since LLVM 9. I don't know what exactly happened to trigger the use of it. cf. https://reviews.llvm.org/D57493
1 parent cdd9485 commit cb0ec6c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/iwasm/compilation/aot_llvm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,6 +2617,15 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
26172617
goto fail;
26182618
}
26192619

2620+
#if LLVM_VERSION_MAJOR >= 9
2621+
/* Disable small data section as our emitter/loader doesn't support it.
2622+
* https://reviews.llvm.org/D57493 */
2623+
LLVMAddModuleFlag(
2624+
comp_ctx->module, LLVMModuleFlagBehaviorWarning, "SmallDataLimit",
2625+
strlen("SmallDataLimit"),
2626+
LLVMValueAsMetadata(LLVMConstInt(LLVMInt32Type(), 0, false)));
2627+
#endif
2628+
26202629
#if WASM_ENABLE_DEBUG_AOT != 0
26212630
if (!(comp_ctx->debug_builder = LLVMCreateDIBuilder(comp_ctx->module))) {
26222631
aot_set_last_error("create LLVM Debug Infor builder failed.");

0 commit comments

Comments
 (0)