From c2190f71caf788edd714e057f89d9b76cce5de02 Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 14 Jun 2022 18:13:43 +0300 Subject: [PATCH] SPU/PPU LLVM: fix triple setup (regression fix) (#12228) --- Utilities/JIT.cpp | 3 +-- rpcs3/Emu/Cell/PPUThread.cpp | 2 +- rpcs3/Emu/Cell/SPURecompiler.cpp | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Utilities/JIT.cpp b/Utilities/JIT.cpp index 6b1de49eee..1b751153df 100644 --- a/Utilities/JIT.cpp +++ b/Utilities/JIT.cpp @@ -871,7 +871,6 @@ jit_compiler::jit_compiler(const std::unordered_map& _link, co std::string result; auto null_mod = std::make_unique ("null_", *m_context); - null_mod->setTargetTriple(utils::c_llvm_default_triple); if (_link.empty()) { @@ -884,7 +883,7 @@ jit_compiler::jit_compiler(const std::unordered_map& _link, co else { mem = std::make_unique(); - null_mod->setTargetTriple(utils::c_llvm_default_triple); + null_mod->setTargetTriple(llvm::Triple::normalize(utils::c_llvm_default_triple)); } // Auxiliary JIT (does not use custom memory manager, only writes the objects) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index e25a9dd51f..8ded92fce7 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -3480,7 +3480,7 @@ static void ppu_initialize2(jit_compiler& jit, const ppu_module& module_part, co // Initialize target #if defined(__APPLE__) && defined(ARCH_ARM64) // Force target linux on macOS arm64 to bypass some 64-bit address space linking issues - _module->setTargetTriple(utils::c_llvm_default_triple); + _module->setTargetTriple(Triple::normalize(utils::c_llvm_default_triple)); #else _module->setTargetTriple(Triple::normalize(sys::getProcessTriple())); #endif diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index b4beb750a6..c0a4bcd793 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -4428,7 +4428,7 @@ public: // Create LLVM module std::unique_ptr _module = std::make_unique(m_hash + ".obj", m_context); - _module->setTargetTriple(utils::c_llvm_default_triple); + _module->setTargetTriple(Triple::normalize(utils::c_llvm_default_triple)); _module->setDataLayout(m_jit.get_engine().getTargetMachine()->createDataLayout()); m_module = _module.get(); @@ -5090,7 +5090,7 @@ public: // Create LLVM module std::unique_ptr _module = std::make_unique("spu_interpreter.obj", m_context); - _module->setTargetTriple(utils::c_llvm_default_triple); + _module->setTargetTriple(Triple::normalize(utils::c_llvm_default_triple)); _module->setDataLayout(m_jit.get_engine().getTargetMachine()->createDataLayout()); m_module = _module.get();