Commit fbbe6b7a authored by Adrien Plazas's avatar Adrien Plazas
Browse files

flatpak: Patch Dolphin for it to build

See https://github.com/libretro/dolphin/pull/218
parent 1543759d
Pipeline #300338 passed with stage
in 58 minutes and 8 seconds
From d8d5143fabc2b024edf6218943dd78ed4f7cadec Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Sun, 25 Jul 2021 17:20:17 +0200
Subject: [PATCH 2/3] Config: Include mutex
---
Source/Core/Common/Config/Config.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/Source/Core/Common/Config/Config.cpp b/Source/Core/Common/Config/Config.cpp
index 2211d0d5fb..29004787e4 100644
--- a/Source/Core/Common/Config/Config.cpp
+++ b/Source/Core/Common/Config/Config.cpp
@@ -5,6 +5,7 @@
#include <algorithm>
#include <list>
#include <map>
+#include <mutex>
#include <shared_mutex>
#include "Common/Config/Config.h"
--
2.31.1
From cfaad25fd64ad96c10f504fbb914e39afa046b35 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Sun, 25 Jul 2021 19:06:48 +0200
Subject: [PATCH 3/3] DSP: Dynamically calculate offset values
It seems GCC 11 doesn't allow doing it dynamically.
---
Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp | 6 +++--
.../Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp | 24 ++++++++++---------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp
index 24a2f2a1c8..b734970454 100644
--- a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp
+++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp
@@ -473,14 +473,16 @@ Gen::OpArg DSPEmitter::M_SDSP_external_interrupt_waiting()
return MDisp(R15, static_cast<int>(offsetof(SDSP, external_interrupt_waiting)));
}
+#define OFFSETOF(TYPE, ELEMENT) ((size_t)&(((TYPE *)0)->ELEMENT))
+
Gen::OpArg DSPEmitter::M_SDSP_r_st(size_t index)
{
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.st[index])));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.st[index]));
}
Gen::OpArg DSPEmitter::M_SDSP_reg_stack_ptrs(size_t index)
{
- return MDisp(R15, static_cast<int>(offsetof(SDSP, reg_stack_ptrs[index])));
+ return MDisp(R15, (int) OFFSETOF (SDSP, reg_stack_ptrs[index]));
}
} // namespace DSP::JIT::x64
diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp
index 2b2850fe36..8f62910907 100644
--- a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp
+++ b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp
@@ -23,6 +23,8 @@ namespace DSP::JIT::x64
constexpr std::array<X64Reg, 15> s_allocation_order = {
{R8, R9, R10, R11, R12, R13, R14, R15, RSI, RDI, RBX, RCX, RDX, RAX, RBP}};
+#define OFFSETOF(TYPE, ELEMENT) ((size_t)&(((TYPE *)0)->ELEMENT))
+
static Gen::OpArg GetRegisterPointer(size_t reg)
{
switch (reg)
@@ -31,25 +33,25 @@ static Gen::OpArg GetRegisterPointer(size_t reg)
case DSP_REG_AR1:
case DSP_REG_AR2:
case DSP_REG_AR3:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ar[reg - DSP_REG_AR0])));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ar[reg - DSP_REG_AR0]));
case DSP_REG_IX0:
case DSP_REG_IX1:
case DSP_REG_IX2:
case DSP_REG_IX3:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ix[reg - DSP_REG_IX0])));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ix[reg - DSP_REG_IX0]));
case DSP_REG_WR0:
case DSP_REG_WR1:
case DSP_REG_WR2:
case DSP_REG_WR3:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.wr[reg - DSP_REG_WR0])));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.wr[reg - DSP_REG_WR0]));
case DSP_REG_ST0:
case DSP_REG_ST1:
case DSP_REG_ST2:
case DSP_REG_ST3:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.st[reg - DSP_REG_ST0])));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.st[reg - DSP_REG_ST0]));
case DSP_REG_ACH0:
case DSP_REG_ACH1:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ac[reg - DSP_REG_ACH0].h)));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ac[reg - DSP_REG_ACH0].h));
case DSP_REG_CR:
return MDisp(R15, static_cast<int>(offsetof(SDSP, r.cr)));
case DSP_REG_SR:
@@ -64,22 +66,22 @@ static Gen::OpArg GetRegisterPointer(size_t reg)
return MDisp(R15, static_cast<int>(offsetof(SDSP, r.prod.m2)));
case DSP_REG_AXL0:
case DSP_REG_AXL1:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ax[reg - DSP_REG_AXL0].l)));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ax[reg - DSP_REG_AXL0].l));
case DSP_REG_AXH0:
case DSP_REG_AXH1:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ax[reg - DSP_REG_AXH0].h)));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ax[reg - DSP_REG_AXH0].h));
case DSP_REG_ACL0:
case DSP_REG_ACL1:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ac[reg - DSP_REG_ACL0].l)));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ac[reg - DSP_REG_ACL0].l));
case DSP_REG_ACM0:
case DSP_REG_ACM1:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ac[reg - DSP_REG_ACM0].m)));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ac[reg - DSP_REG_ACM0].m));
case DSP_REG_AX0_32:
case DSP_REG_AX1_32:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ax[reg - DSP_REG_AX0_32].val)));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ax[reg - DSP_REG_AX0_32].val));
case DSP_REG_ACC0_64:
case DSP_REG_ACC1_64:
- return MDisp(R15, static_cast<int>(offsetof(SDSP, r.ac[reg - DSP_REG_ACC0_64].val)));
+ return MDisp(R15, (int) OFFSETOF (SDSP, r.ac[reg - DSP_REG_ACC0_64].val));
case DSP_REG_PROD_64:
return MDisp(R15, static_cast<int>(offsetof(SDSP, r.prod.val)));
default:
--
2.31.1
From 6de7a2cc779bc0ccd22013cb1fa1c36d3af3487d Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Sun, 25 Jul 2021 17:09:55 +0200
Subject: [PATCH 1/3] WIACompression: Include limits
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This fixes `error: ‘numeric_limits’ is not a member of ‘std’`.
---
Source/Core/DiscIO/WIACompression.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/Source/Core/DiscIO/WIACompression.cpp b/Source/Core/DiscIO/WIACompression.cpp
index 20d19c4877..f39f59ae5b 100644
--- a/Source/Core/DiscIO/WIACompression.cpp
+++ b/Source/Core/DiscIO/WIACompression.cpp
@@ -7,6 +7,7 @@
#include <algorithm>
#include <cstddef>
#include <cstring>
+#include <limits>
#include <memory>
#include <optional>
#include <vector>
--
2.31.1
......@@ -27,6 +27,18 @@
"type": "git",
"url": "https://github.com/libretro/dolphin.git"
},
{
"type": "patch",
"path": "dolphin-WIACompression-Include-limits.patch"
},
{
"type": "patch",
"path": "dolphin-Config-Include-mutex.patch"
},
{
"type": "patch",
"path": "dolphin-DSP-Dynamically-calculate-offset-values.patch"
},
{
"type": "file",
"path": "dolphin.libretro"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment