summaryrefslogtreecommitdiff
path: root/emulators/fbsd-duckstation/files
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/fbsd-duckstation/files')
-rw-r--r--emulators/fbsd-duckstation/files/patch-disable-pch.txt61
-rw-r--r--emulators/fbsd-duckstation/files/patch-src-core-gdb_server.h13
-rw-r--r--emulators/fbsd-duckstation/files/patch-src-core-memory_card_image.h12
-rw-r--r--emulators/fbsd-duckstation/files/patch-src-core-pine_server.h12
-rw-r--r--emulators/fbsd-duckstation/files/patch-src-duckstation-qt-graphicssettingswidget.h12
-rw-r--r--emulators/fbsd-duckstation/files/patch-src-util-page_fault_handler.cpp15
6 files changed, 125 insertions, 0 deletions
diff --git a/emulators/fbsd-duckstation/files/patch-disable-pch.txt b/emulators/fbsd-duckstation/files/patch-disable-pch.txt
new file mode 100644
index 000000000000..92610948e32a
--- /dev/null
+++ b/emulators/fbsd-duckstation/files/patch-disable-pch.txt
@@ -0,0 +1,61 @@
+Disable PCH to work around the following errors on arm64:
+
+In file included from /wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/audio_stream.cpp:9:
+In file included from /wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/../common/error.h:6:
+/wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/../common/small_string.h:353:3: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'std::va_list' (aka 'std::__va_list')
+ 353 | va_start(ap, format);
+ | ^~~~~~~~~~~~~~~~~~~~
+/usr/include/sys/_stdarg.h:43:49: note: expanded from macro 'va_start'
+ 43 | #define va_start(ap, last) __builtin_va_start((ap), (last))
+ | ^~~~
+In file included from /wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/audio_stream.cpp:9:
+In file included from /wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/../common/error.h:6:
+/wrkdirs/usr/ports/emulators/fbsd-duckstation/work/duckstation-0.1-6937/src/util/../common/small_string.h:358:10: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'std::va_list' (aka 'std::__va_list')
+ 358 | va_end(ap);
+ | ^~
+/usr/include/sys/_stdarg.h:49:40: note: expanded from macro 'va_end'
+ 49 | #define va_end(ap) __builtin_va_end(ap)
+ | ^~
+2 errors generated.
+
+(see also: https://reviews.llvm.org/D18557 and https://github.com/llvm/llvm-project/issues/69524)
+
+--- src/util/CMakeLists.txt.orig 2024-06-14 05:59:32 UTC
++++ src/util/CMakeLists.txt
+@@ -74,7 +74,9 @@ add_library(util
+ zstd_byte_stream.cpp
+ )
+
+-target_precompile_headers(util PRIVATE "pch.h")
++if(NOT((CMAKE_SYSTEM_NAME MATCHES "FreeBSD") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")))
++ target_precompile_headers(util PRIVATE "pch.h")
++endif()
+ target_include_directories(util PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
+ target_include_directories(util PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
+ target_link_libraries(util PUBLIC common simpleini imgui)
+--- src/core/CMakeLists.txt.orig 2024-06-14 05:59:32 UTC
++++ src/core/CMakeLists.txt
+@@ -133,7 +133,9 @@ set(NEWREC_SOURCES
+ cpu_newrec_compiler.h
+ )
+
+-target_precompile_headers(core PRIVATE "pch.h")
++if(NOT((CMAKE_SYSTEM_NAME MATCHES "FreeBSD") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")))
++ target_precompile_headers(core PRIVATE "pch.h")
++endif()
+ target_include_directories(core PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
+ target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
+ target_link_libraries(core PUBLIC Threads::Threads common util ZLIB::ZLIB)
+--- src/duckstation-qt/CMakeLists.txt.orig 2024-06-14 05:59:32 UTC
++++ src/duckstation-qt/CMakeLists.txt
+@@ -169,7 +169,9 @@ add_executable(duckstation-qt ${SRCS} ${QM_FILES})
+ )
+
+ add_executable(duckstation-qt ${SRCS} ${QM_FILES})
+-target_precompile_headers(duckstation-qt PRIVATE "pch.h")
++if(NOT((CMAKE_SYSTEM_NAME MATCHES "FreeBSD") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")))
++ target_precompile_headers(duckstation-qt PRIVATE "pch.h")
++endif()
+ target_include_directories(duckstation-qt PRIVATE "${Qt6Gui_PRIVATE_INCLUDE_DIRS}" "${CMAKE_CURRENT_SOURCE_DIR}")
+ target_link_libraries(duckstation-qt PRIVATE core common imgui minizip scmversion Qt6::Core Qt6::Gui Qt6::Widgets)
+
diff --git a/emulators/fbsd-duckstation/files/patch-src-core-gdb_server.h b/emulators/fbsd-duckstation/files/patch-src-core-gdb_server.h
new file mode 100644
index 000000000000..5f00d0fc7755
--- /dev/null
+++ b/emulators/fbsd-duckstation/files/patch-src-core-gdb_server.h
@@ -0,0 +1,13 @@
+Add missing type declarations (u8/u16/u32)
+
+--- src/core/gdb_server.h.orig 2024-06-14 05:59:32 UTC
++++ src/core/gdb_server.h
+@@ -2,6 +2,8 @@
+ // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
+
+ #pragma once
++#include "common/types.h"
++
+ #include <string_view>
+
+ namespace GDBServer {
diff --git a/emulators/fbsd-duckstation/files/patch-src-core-memory_card_image.h b/emulators/fbsd-duckstation/files/patch-src-core-memory_card_image.h
new file mode 100644
index 000000000000..ba374a851c8a
--- /dev/null
+++ b/emulators/fbsd-duckstation/files/patch-src-core-memory_card_image.h
@@ -0,0 +1,12 @@
+Add missing type declarations (u8/u16/u32)
+
+--- src/core/memory_card_image.h.orig 2024-06-14 05:59:32 UTC
++++ src/core/memory_card_image.h
+@@ -2,6 +2,7 @@
+ // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
+
+ #pragma once
++#include "common/types.h"
+
+ #include <array>
+ #include <string>
diff --git a/emulators/fbsd-duckstation/files/patch-src-core-pine_server.h b/emulators/fbsd-duckstation/files/patch-src-core-pine_server.h
new file mode 100644
index 000000000000..990b7cf42008
--- /dev/null
+++ b/emulators/fbsd-duckstation/files/patch-src-core-pine_server.h
@@ -0,0 +1,12 @@
+Add missing type declarations (u8/u16/u32)
+
+--- src/core/pine_server.h.orig 2024-06-14 05:59:32 UTC
++++ src/core/pine_server.h
+@@ -5,6 +5,7 @@
+ * here: https://code.govanify.com/govanify/pine/ */
+
+ #pragma once
++#include "common/types.h"
+
+ namespace PINEServer {
+ bool IsRunning();
diff --git a/emulators/fbsd-duckstation/files/patch-src-duckstation-qt-graphicssettingswidget.h b/emulators/fbsd-duckstation/files/patch-src-duckstation-qt-graphicssettingswidget.h
new file mode 100644
index 000000000000..a0e72b513709
--- /dev/null
+++ b/emulators/fbsd-duckstation/files/patch-src-duckstation-qt-graphicssettingswidget.h
@@ -0,0 +1,12 @@
+Add missing type declarations (u8/u16/u32)
+
+--- src/duckstation-qt/graphicssettingswidget.h.orig 2025-05-07 13:16:56 UTC
++++ src/duckstation-qt/graphicssettingswidget.h
+@@ -2,6 +2,7 @@
+ // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
+
+ #pragma once
++#include "common/types.h"
+
+ #include <QtWidgets/QWidget>
+
diff --git a/emulators/fbsd-duckstation/files/patch-src-util-page_fault_handler.cpp b/emulators/fbsd-duckstation/files/patch-src-util-page_fault_handler.cpp
new file mode 100644
index 000000000000..5b1f40faca96
--- /dev/null
+++ b/emulators/fbsd-duckstation/files/patch-src-util-page_fault_handler.cpp
@@ -0,0 +1,15 @@
+Fix build on arm64
+
+--- src/util/page_fault_handler.cpp.orig 2024-06-14 05:59:32 UTC
++++ src/util/page_fault_handler.cpp
+@@ -188,8 +188,8 @@ void PageFaultHandler::SignalHandler(int sig, siginfo_
+ void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext.mc_rip);
+ const bool is_write = (static_cast<ucontext_t*>(ctx)->uc_mcontext.mc_err & 2) != 0;
+ #elif defined(CPU_ARCH_ARM64)
+- void* const exception_address = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext->__es.__far);
+- void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext->__ss.__pc);
++ void* const exception_address = reinterpret_cast<void*>(info->si_addr);
++ void* const exception_pc = reinterpret_cast<void*>(static_cast<ucontext_t*>(ctx)->uc_mcontext.mc_gpregs.gp_elr);
+ const bool is_write = IsStoreInstruction(exception_pc);
+ #else
+ void* const exception_address = reinterpret_cast<void*>(info->si_addr);