From 7e078f717dceed253aa8e01eb714c431f07c7131 Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 30 Aug 2025 07:01:01 +0000 Subject: [PATCH 1/2] [breakpad] enable Solaris crash dumps Signed-off-by: lizzie --- CMakeLists.txt | 8 ++++---- src/yuzu/CMakeLists.txt | 2 -- src/yuzu/breakpad.cpp | 8 ++++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d11b58bf1f..9cf99c070c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,7 +107,7 @@ CMAKE_DEPENDENT_OPTION(YUZU_ROOM_STANDALONE "Enable standalone room executable" CMAKE_DEPENDENT_OPTION(YUZU_CMD "Compile the eden-cli executable" ON "NOT ANDROID" OFF) -CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX" OFF) +CMAKE_DEPENDENT_OPTION(YUZU_CRASH_DUMPS "Compile crash dump (Minidump) support" OFF "WIN32 OR LINUX OR PLATFORM_SUN" OFF) option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ${EXT_DEFAULT}) @@ -324,7 +324,7 @@ if (YUZU_ROOM) endif() # Build/optimization presets -if (PLATFORM_LINUX) +if (PLATFORM_LINUX OR PLATFORM_FREEBSD OR PLATFORM_SUN OR PLATFORM_FREEBSD) if (ARCHITECTURE_x86_64) set(YUZU_BUILD_PRESET "custom" CACHE STRING "Build preset to use. One of: custom, generic, v3, zen2, zen4, native") if (${YUZU_BUILD_PRESET} STREQUAL "generic") @@ -406,7 +406,7 @@ if (YUZU_USE_CPM) if (NOT MSVC) # boost sucks - if (NOT PLATFORM_LINUX AND NOT ANDROID) + if (PLATFORM_SUN OR PLATFORM_OPENBSD) target_compile_definitions(boost_container INTERFACE BOOST_HAS_PTHREADS) endif() @@ -707,7 +707,7 @@ if(ENABLE_QT) set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "") endif() -if (WIN32 AND YUZU_CRASH_DUMPS) +if (YUZU_CRASH_DUMPS) set(BREAKPAD_VER "breakpad-c89f9dd") download_bundled_external("breakpad/" ${BREAKPAD_VER} "breakpad-win" BREAKPAD_PREFIX "c89f9dd") diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 0ce8f3b898..42242fd035 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -251,9 +251,7 @@ if (YUZU_CRASH_DUMPS) breakpad.cpp breakpad.h ) - target_link_libraries(yuzu PRIVATE libbreakpad_client) - target_compile_definitions(yuzu PRIVATE YUZU_CRASH_DUMPS) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") diff --git a/src/yuzu/breakpad.cpp b/src/yuzu/breakpad.cpp index 82b5deb51e..0cb04dc3c8 100644 --- a/src/yuzu/breakpad.cpp +++ b/src/yuzu/breakpad.cpp @@ -8,6 +8,8 @@ #include #elif defined(__linux__) #include +#elif defined(__sun__) +#include #else #error Minidump creation not supported on this platform #endif @@ -49,7 +51,7 @@ static void PruneDumpDirectory(const std::filesystem::path& dump_path) { } } -#if defined(__linux__) +#ifdef __linux__ [[noreturn]] bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded) { // Prevent time- and space-consuming core dumps from being generated, as we have @@ -63,7 +65,7 @@ void InstallCrashHandler() { const auto dump_path = GetEdenPath(Common::FS::EdenPath::CrashDumpsDir); PruneDumpDirectory(dump_path); -#if defined(_WIN32) +#ifdef _WIN32 // TODO: If we switch to MinGW builds for Windows, this needs to be wrapped in a C API. static google_breakpad::ExceptionHandler eh{dump_path, nullptr, nullptr, nullptr, google_breakpad::ExceptionHandler::HANDLER_ALL}; @@ -71,6 +73,8 @@ void InstallCrashHandler() { static google_breakpad::MinidumpDescriptor descriptor{dump_path}; static google_breakpad::ExceptionHandler eh{descriptor, nullptr, DumpCallback, nullptr, true, -1}; +#elif defined(__sun__) + static google_breakpad::ExceptionHandler eh{dump_path, nullptr, DumpCallback, nullptr, true}; #endif } From ca721fdb908f5167daed4a314cd8d94a4e4656f3 Mon Sep 17 00:00:00 2001 From: lizzie Date: Sat, 30 Aug 2025 07:02:04 +0000 Subject: [PATCH 2/2] [breakpad] enable Solaris crash dumps Signed-off-by: lizzie --- CMakeLists.txt | 2 +- src/yuzu/CMakeLists.txt | 2 -- src/yuzu/breakpad.cpp | 8 ++++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d11b58bf1f..bf1c72f357 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -707,7 +707,7 @@ if(ENABLE_QT) set_target_properties(Qt6::Platform PROPERTIES INTERFACE_COMPILE_FEATURES "") endif() -if (WIN32 AND YUZU_CRASH_DUMPS) +if (YUZU_CRASH_DUMPS) set(BREAKPAD_VER "breakpad-c89f9dd") download_bundled_external("breakpad/" ${BREAKPAD_VER} "breakpad-win" BREAKPAD_PREFIX "c89f9dd") diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 0ce8f3b898..42242fd035 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -251,9 +251,7 @@ if (YUZU_CRASH_DUMPS) breakpad.cpp breakpad.h ) - target_link_libraries(yuzu PRIVATE libbreakpad_client) - target_compile_definitions(yuzu PRIVATE YUZU_CRASH_DUMPS) endif() if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") diff --git a/src/yuzu/breakpad.cpp b/src/yuzu/breakpad.cpp index 82b5deb51e..0cb04dc3c8 100644 --- a/src/yuzu/breakpad.cpp +++ b/src/yuzu/breakpad.cpp @@ -8,6 +8,8 @@ #include #elif defined(__linux__) #include +#elif defined(__sun__) +#include #else #error Minidump creation not supported on this platform #endif @@ -49,7 +51,7 @@ static void PruneDumpDirectory(const std::filesystem::path& dump_path) { } } -#if defined(__linux__) +#ifdef __linux__ [[noreturn]] bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor, void* context, bool succeeded) { // Prevent time- and space-consuming core dumps from being generated, as we have @@ -63,7 +65,7 @@ void InstallCrashHandler() { const auto dump_path = GetEdenPath(Common::FS::EdenPath::CrashDumpsDir); PruneDumpDirectory(dump_path); -#if defined(_WIN32) +#ifdef _WIN32 // TODO: If we switch to MinGW builds for Windows, this needs to be wrapped in a C API. static google_breakpad::ExceptionHandler eh{dump_path, nullptr, nullptr, nullptr, google_breakpad::ExceptionHandler::HANDLER_ALL}; @@ -71,6 +73,8 @@ void InstallCrashHandler() { static google_breakpad::MinidumpDescriptor descriptor{dump_path}; static google_breakpad::ExceptionHandler eh{descriptor, nullptr, DumpCallback, nullptr, true, -1}; +#elif defined(__sun__) + static google_breakpad::ExceptionHandler eh{dump_path, nullptr, DumpCallback, nullptr, true}; #endif }