diff --git a/core/iwasm/compilation/aot_llvm_extra2.cpp b/core/iwasm/compilation/aot_llvm_extra2.cpp index ccbccd1e0..5e1fdf6ce 100644 --- a/core/iwasm/compilation/aot_llvm_extra2.cpp +++ b/core/iwasm/compilation/aot_llvm_extra2.cpp @@ -159,6 +159,17 @@ LLVMCreateTargetMachineWithOpts(LLVMTargetRef ctarget, const char *triple, auto cm = convert(code_model, &jit); auto targetmachine = target->createTargetMachine(triple, cpu, features, opts, rm, cm, ol, jit); +#if LLVM_VERSION_MAJOR >= 18 + // always place data in normal data section. + // + // note that: + // - our aot file emitter/loader doesn't support x86-64 large data + // sections. (eg .lrodata) + // - for our purposes, "data" is usually something the compiler + // generated. (eg. jump tables) we probably never benefit from + // large data sections. + targetmachine->setLargeDataThreshold(UINT64_MAX); +#endif return reinterpret_cast(targetmachine); }