From 2a0aedf03f1933caa924ca8eaed6c1f7b24dacf7 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Sun, 28 Sep 2025 00:10:30 -0700 Subject: [PATCH] Switch from deprecated overload of createTargetMachine The overload accepting the string version of a triple will be removed soon, so switch over to the one that accepts a triple object. --- core/iwasm/compilation/aot_llvm_extra2.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/iwasm/compilation/aot_llvm_extra2.cpp b/core/iwasm/compilation/aot_llvm_extra2.cpp index 5e1fdf6ce6..bc49c54bbb 100644 --- a/core/iwasm/compilation/aot_llvm_extra2.cpp +++ b/core/iwasm/compilation/aot_llvm_extra2.cpp @@ -157,8 +157,13 @@ LLVMCreateTargetMachineWithOpts(LLVMTargetRef ctarget, const char *triple, auto ol = convert(opt_level); bool jit; auto cm = convert(code_model, &jit); +#if LLVM_VERSION_MAJOR >= 21 + auto targetmachine = target->createTargetMachine( + llvm::Triple(triple), cpu, features, opts, rm, cm, ol, jit); +#else auto targetmachine = target->createTargetMachine(triple, cpu, features, opts, rm, cm, ol, jit); +#endif #if LLVM_VERSION_MAJOR >= 18 // always place data in normal data section. //