From df908048de3990c9a74056d44c0870c5efb9dd04 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Wed, 8 Oct 2025 22:33:11 -0700 Subject: [PATCH] Switch from deprecated overload of createTargetMachine (#4650) The overload accepting the string version of a triple will be removed soon, so switch over to the one that accepts a triple object. https://github.com/llvm/llvm-project/pull/161053 --- 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 5e1fdf6ce..bc49c54bb 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. //