diff options
| author | 2022-06-12 17:14:27 -0400 | |
|---|---|---|
| committer | 2022-06-13 20:09:32 -0400 | |
| commit | ebecdd3a7458dd5a353524dc161f4050d019b7be (patch) | |
| tree | 0328113f3ceef6a4ccbfd6a98d121cd3c03e1626 | |
| parent | common/assert: add unlikely (diff) | |
| download | yuzu-ebecdd3a7458dd5a353524dc161f4050d019b7be.tar.gz yuzu-ebecdd3a7458dd5a353524dc161f4050d019b7be.tar.xz yuzu-ebecdd3a7458dd5a353524dc161f4050d019b7be.zip | |
general: fix compilation on MinGW GCC 12
| -rw-r--r-- | externals/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/core/loader/nso.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/macro/macro_jit_x64.cpp | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index 64361de5f..bd01f4c4d 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt | |||
| @@ -40,6 +40,11 @@ target_include_directories(mbedtls PUBLIC ./mbedtls/include) | |||
| 40 | add_library(microprofile INTERFACE) | 40 | add_library(microprofile INTERFACE) |
| 41 | target_include_directories(microprofile INTERFACE ./microprofile) | 41 | target_include_directories(microprofile INTERFACE ./microprofile) |
| 42 | 42 | ||
| 43 | # GCC bugs | ||
| 44 | if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND MINGW) | ||
| 45 | target_compile_options(microprofile INTERFACE "-Wno-array-bounds") | ||
| 46 | endif() | ||
| 47 | |||
| 43 | # libusb | 48 | # libusb |
| 44 | if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB) | 49 | if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB) |
| 45 | add_subdirectory(libusb) | 50 | add_subdirectory(libusb) |
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp index 8a938aa83..8dd956fc6 100644 --- a/src/core/loader/nso.cpp +++ b/src/core/loader/nso.cpp | |||
| @@ -128,11 +128,10 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::KProcess& process, Core:: | |||
| 128 | 128 | ||
| 129 | // Apply patches if necessary | 129 | // Apply patches if necessary |
| 130 | if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) { | 130 | if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) { |
| 131 | std::vector<u8> pi_header; | 131 | std::vector<u8> pi_header(sizeof(NSOHeader) + program_image.size()); |
| 132 | pi_header.insert(pi_header.begin(), reinterpret_cast<u8*>(&nso_header), | 132 | std::memcpy(pi_header.data(), &nso_header, sizeof(NSOHeader)); |
| 133 | reinterpret_cast<u8*>(&nso_header) + sizeof(NSOHeader)); | 133 | std::memcpy(pi_header.data() + sizeof(NSOHeader), program_image.data(), |
| 134 | pi_header.insert(pi_header.begin() + sizeof(NSOHeader), program_image.data(), | 134 | program_image.size()); |
| 135 | program_image.data() + program_image.size()); | ||
| 136 | 135 | ||
| 137 | pi_header = pm->PatchNSO(pi_header, nso_file.GetName()); | 136 | pi_header = pm->PatchNSO(pi_header, nso_file.GetName()); |
| 138 | 137 | ||
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp index dc5376501..aca25d902 100644 --- a/src/video_core/macro/macro_jit_x64.cpp +++ b/src/video_core/macro/macro_jit_x64.cpp | |||
| @@ -411,7 +411,7 @@ void MacroJITx64Impl::Compile_Branch(Macro::Opcode opcode) { | |||
| 411 | 411 | ||
| 412 | Xbyak::Label end; | 412 | Xbyak::Label end; |
| 413 | auto value = Compile_GetRegister(opcode.src_a, eax); | 413 | auto value = Compile_GetRegister(opcode.src_a, eax); |
| 414 | test(value, value); | 414 | cmp(value, 0); // test(value, value); |
| 415 | if (optimizer.has_delayed_pc) { | 415 | if (optimizer.has_delayed_pc) { |
| 416 | switch (opcode.branch_condition) { | 416 | switch (opcode.branch_condition) { |
| 417 | case Macro::BranchCondition::Zero: | 417 | case Macro::BranchCondition::Zero: |