general: fix compilation on MinGW GCC 12
This commit is contained in:
parent
a29ddcee40
commit
ebecdd3a74
|
@ -40,6 +40,11 @@ target_include_directories(mbedtls PUBLIC ./mbedtls/include)
|
||||||
add_library(microprofile INTERFACE)
|
add_library(microprofile INTERFACE)
|
||||||
target_include_directories(microprofile INTERFACE ./microprofile)
|
target_include_directories(microprofile INTERFACE ./microprofile)
|
||||||
|
|
||||||
|
# GCC bugs
|
||||||
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND MINGW)
|
||||||
|
target_compile_options(microprofile INTERFACE "-Wno-array-bounds")
|
||||||
|
endif()
|
||||||
|
|
||||||
# libusb
|
# libusb
|
||||||
if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB)
|
if (NOT LIBUSB_FOUND OR YUZU_USE_BUNDLED_LIBUSB)
|
||||||
add_subdirectory(libusb)
|
add_subdirectory(libusb)
|
||||||
|
|
|
@ -128,11 +128,10 @@ std::optional<VAddr> AppLoader_NSO::LoadModule(Kernel::KProcess& process, Core::
|
||||||
|
|
||||||
// Apply patches if necessary
|
// Apply patches if necessary
|
||||||
if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) {
|
if (pm && (pm->HasNSOPatch(nso_header.build_id) || Settings::values.dump_nso)) {
|
||||||
std::vector<u8> pi_header;
|
std::vector<u8> pi_header(sizeof(NSOHeader) + program_image.size());
|
||||||
pi_header.insert(pi_header.begin(), reinterpret_cast<u8*>(&nso_header),
|
std::memcpy(pi_header.data(), &nso_header, sizeof(NSOHeader));
|
||||||
reinterpret_cast<u8*>(&nso_header) + sizeof(NSOHeader));
|
std::memcpy(pi_header.data() + sizeof(NSOHeader), program_image.data(),
|
||||||
pi_header.insert(pi_header.begin() + sizeof(NSOHeader), program_image.data(),
|
program_image.size());
|
||||||
program_image.data() + program_image.size());
|
|
||||||
|
|
||||||
pi_header = pm->PatchNSO(pi_header, nso_file.GetName());
|
pi_header = pm->PatchNSO(pi_header, nso_file.GetName());
|
||||||
|
|
||||||
|
|
|
@ -411,7 +411,7 @@ void MacroJITx64Impl::Compile_Branch(Macro::Opcode opcode) {
|
||||||
|
|
||||||
Xbyak::Label end;
|
Xbyak::Label end;
|
||||||
auto value = Compile_GetRegister(opcode.src_a, eax);
|
auto value = Compile_GetRegister(opcode.src_a, eax);
|
||||||
test(value, value);
|
cmp(value, 0); // test(value, value);
|
||||||
if (optimizer.has_delayed_pc) {
|
if (optimizer.has_delayed_pc) {
|
||||||
switch (opcode.branch_condition) {
|
switch (opcode.branch_condition) {
|
||||||
case Macro::BranchCondition::Zero:
|
case Macro::BranchCondition::Zero:
|
||||||
|
|
Reference in New Issue