From 5bc28ca831ac71b395cccf5d30dae396ab30d065 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 23 Jul 2025 01:28:54 +0100 Subject: [PATCH 1/2] [solaris] port to solaris --- .gitmodules | 4 +- CMakeLists.txt | 4 +- docs/Solaris.md | 94 +++++++++++++++++++ .../backend/exception_handler_posix.cpp | 10 +- .../tzdb_to_nx/externals/tz/CMakeLists.txt | 4 +- .../nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp | 6 +- .../nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp | 34 +++---- .../nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h | 36 +++---- externals/renderdoc/renderdoc_app.h | 8 +- src/audio_core/sink/sdl2_sink.cpp | 1 + src/common/minicoro.h | 2 +- src/core/hle/service/caps/caps_manager.cpp | 4 +- src/core/hle/service/psc/time/common.h | 6 +- .../internal_network/network_interface.cpp | 41 ++++---- src/network/CMakeLists.txt | 5 + src/yuzu_cmd/CMakeLists.txt | 5 + 16 files changed, 188 insertions(+), 76 deletions(-) create mode 100644 docs/Solaris.md diff --git a/.gitmodules b/.gitmodules index 1a6e6574a3..371b62a605 100644 --- a/.gitmodules +++ b/.gitmodules @@ -12,7 +12,7 @@ url = https://github.com/KhronosGroup/Vulkan-Headers.git [submodule "xbyak"] path = externals/xbyak - url = https://github.com/herumi/xbyak.git + url = https://github.com/Lizzie841/xbyak.git [submodule "opus"] path = externals/opus url = https://github.com/xiph/opus.git @@ -51,7 +51,7 @@ url = https://github.com/Lizzie841/unordered_dense.git [submodule "externals/dynarmic/externals/xbyak"] path = externals/dynarmic/externals/xbyak - url = https://github.com/herumi/xbyak.git + url = https://github.com/Lizzie841/xbyak.git [submodule "externals/dynarmic/externals/zycore-c"] path = externals/dynarmic/externals/zycore-c url = https://github.com/zyantific/zycore-c.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b28fbc7137..bb571235a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" OFF) else() - option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON) + option(YUZU_USE_EXTERNAL_VULKAN_HEADERS "Use Vulkan-Headers from externals" ON) endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") @@ -123,7 +123,7 @@ CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF) set(DEFAULT_ENABLE_OPENSSL ON) -if (ANDROID OR WIN32 OR APPLE) +if (ANDROID OR WIN32 OR APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") set(DEFAULT_ENABLE_OPENSSL OFF) endif() option(ENABLE_OPENSSL "Enable OpenSSL backend for ISslConnection" ${DEFAULT_ENABLE_OPENSSL}) diff --git a/docs/Solaris.md b/docs/Solaris.md new file mode 100644 index 0000000000..c7daa2279b --- /dev/null +++ b/docs/Solaris.md @@ -0,0 +1,94 @@ +# Building for Solaris + +## Dependencies. +Always consult [the OpenIndiana package list](https://pkg.openindiana.org/hipster/en/index.shtml) to cross-verify availability. + +Run the usual update + install of essential toolings: `sudo pkg update && sudo pkg install git cmake`. + +- **gcc**: `sudo pkg install developer/gcc-14`. +- **clang**: Version 20 is broken, use `sudo pkg install developer/clang-19`. + +Then install the libraies: `sudo pkg install qt6 boost glslang libzip library/lz4 nlohmann-json openssl opus sdl2 zlib compress/zstd unzip pkg-config nasm autoconf mesa library/libdrm header-drm`. + +fmtlib is not available on repositories and has to be manually built: +```sh +git clone --recurisve --depth=1 https://github.com/fmtlib/fmt.git +cd fmt +cmake -DCMAKE_BUILD_TYPE=Release -B build +cmake --build build +sudo cmake --install build +``` + +pkg lz4 doesn't provide a proper CMakeFile to find the library, has to also be manually built: +```sh +git clone --depth=1 https://github.com/lz4/lz4.git +cd lz4 +gmake +sudo gmake install +``` + +Same goes for zstd: +```sh +git clone --depth=1 https://github.com/facebook/zstd.git +cd zstd +cmake -DCMAKE_BUILD_TYPE=Release -B build0 -S build/cmake +cmake --build build0 +cd build0 +sudo gmake install +``` + +pkg SDL2 is also not nice to work with on CMake, save yourself some pain and compile it yourself: +```sh +git clone --depth=1 --branch=release-2.32.8 https://github.com/libsdl-org/SDL +cmake -DCMAKE_BUILD_TYPE=Release -B build +cmake --build build +sudo cmake --install build +``` + +Audio is broken in OpenIndiana [see this issue](https://github.com/libsdl-org/SDL/issues/13405), go into `SDL/CMakeLists.txt` and comment out lines 1468: +```diff ++# set(SDL_AUDIO_DRIVER_SUNAUDIO 1) ++# file(GLOB SUN_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/sun/*.c) ++# list(APPEND SOURCE_FILES ${SUN_AUDIO_SOURCES}) ++# set(HAVE_SDL_AUDIO TRUE) +``` +For Solaris this issue does not exist - however PulseAudio crashes on Solaris - so use a different backend. + +--- + +### Build preparations: +Run the following command to clone eden with git: +```sh +git clone --recursive https://git.eden-emu.dev/eden-emu/eden +``` +You usually want to add the `--recursive` parameter as it also takes care of the external dependencies for you. + +Now change into the eden directory and create a build directory there: +```sh +cd eden +mkdir build +``` + +Change into that build directory: `cd build` + +Now choose one option either 1 or 2, but not both as one option overwrites the other. + +### Building + +```sh +# Needed for some dependencies that call cc directly (tz) +echo '#!/bin/sh' >cc +echo 'gcc $@' >>cc +chmod +x cc +export PATH="$PATH:$PWD" +``` + +- **Configure**: `cmake -B build -DYUZU_TESTS=OFF -DYUZU_USE_BUNDLED_SDL2=OFF -DYUZU_USE_EXTERNAL_SDL2=OFF -DYUZU_USE_LLVM_DEMANGLE=OFF -DYUZU_USE_QT_MULTIMEDIA=OFF -DYUZU_USE_QT_WEB_ENGINE=OFF -DYUZU_USE_BUNDLED_VCPKG=OFF -DYUZU_USE_BUNDLED_QT=OFF -DENABLE_QT=OFF -DSDL_AUDIO=OFF -DENABLE_WEB_SERVICE=OFF -DENABLE_QT_UPDATE_CHECKER=OFF`. +- **Build**: `cmake --build build`. +- **Installing**: `sudo cmake --install build`. + +### Notes + +- Modify the generated ffmpeg.make (in build dir) if using multiple threads (base system `make` doesn't use `-j4`, so change for `gmake`). +- If using OpenIndiana, due to a bug in SDL2 cmake configuration; Audio driver defaults to SunOS ``, which does not exist on OpenIndiana. +- Enabling OpenSSL requires compiling OpenSSL manually instead of using the provided one from repositores. diff --git a/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp b/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp index 2d6d6ea6d8..bfc6559b77 100644 --- a/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp +++ b/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp @@ -13,6 +13,9 @@ # ifndef __OpenBSD__ # include # endif +# ifdef __sun__ +# include +# endif #endif #include @@ -145,9 +148,9 @@ void SigHandler::SigAction(int sig, siginfo_t* info, void* raw_context) { #ifndef MCL_ARCHITECTURE_RISCV ucontext_t* ucontext = reinterpret_cast(raw_context); -# ifndef __OpenBSD__ +#ifndef __OpenBSD__ auto& mctx = ucontext->uc_mcontext; -# endif +#endif #endif #if defined(MCL_ARCHITECTURE_X86_64) @@ -167,6 +170,9 @@ void SigHandler::SigAction(int sig, siginfo_t* info, void* raw_context) { # elif defined(__OpenBSD__) # define CTX_RIP (ucontext->sc_rip) # define CTX_RSP (ucontext->sc_rsp) +# elif defined(__sun__) +# define CTX_RIP (mctx.gregs[REG_RIP]) +# define CTX_RSP (mctx.gregs[REG_RSP]) # else # error "Unknown platform" # endif diff --git a/externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt b/externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt index 948fe69a23..2312b34dd6 100644 --- a/externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt +++ b/externals/nx_tzdb/tzdb_to_nx/externals/tz/CMakeLists.txt @@ -24,8 +24,8 @@ if (NOT EXISTS "${TZ_DIR}" OR NOT EXISTS "${TZIF_LIST_FILE}") # separate directory before building. execute_process( COMMAND - ${GIT_PROGRAM} clone --depth 1 "file://${TZ_SOURCE_DIR}" "${TZ_TMP_SOURCE_DIR}" - COMMAND_ERROR_IS_FATAL ANY + ${GIT_PROGRAM} clone --depth=1 "file://${TZ_SOURCE_DIR}" "${TZ_TMP_SOURCE_DIR}" + # No need to be fatal, on SunOS this works fine - COMMAND_ERROR_IS_FATAL ANY ) if (APPLE) diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp index c1825970ac..015a588a1f 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include constexpr std::size_t ten_megabytes{(1 << 20) * 10}; @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { } } - u_int8_t *buf = new u_int8_t[filesize]; + std::uint8_t *buf = new std::uint8_t[filesize]; filesize = read(f, buf, filesize); if (filesize == static_cast(-1)) { @@ -124,7 +124,7 @@ int main(int argc, char *argv[]) { delete[] buf; - std::vector output_buffer; + std::vector output_buffer; tzif_data->ReformatNintendo(output_buffer); filename = "(stdout)"; diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp index 4d2b842741..ce31b1520b 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp @@ -2,13 +2,13 @@ #include #include #include -#include +#include namespace Tzif { -static std::size_t SkipToVersion2(const u_int8_t *data, std::size_t size) { +static std::size_t SkipToVersion2(const std::uint8_t *data, std::size_t size) { char magic[5]; - const u_int8_t *p{data}; + const std::uint8_t *p{data}; std::memcpy(magic, data, 4); magic[4] = '\0'; @@ -28,15 +28,15 @@ static std::size_t SkipToVersion2(const u_int8_t *data, std::size_t size) { } template constexpr static void SwapEndianess(Type *value) { - u_int8_t *data = reinterpret_cast(value); + std::uint8_t *data = reinterpret_cast(value); union { - u_int8_t data[sizeof(Type)]; + std::uint8_t data[sizeof(Type)]; Type value; } temp; - for (u_int32_t i = 0; i < sizeof(Type); i++) { - u_int32_t alt_index = sizeof(Type) - i - 1; + for (std::uint32_t i = 0; i < sizeof(Type); i++) { + std::uint32_t alt_index = sizeof(Type) - i - 1; temp.data[alt_index] = data[i]; } @@ -52,13 +52,13 @@ static void FlipHeader(Header &header) { SwapEndianess(&header.charcnt); } -std::unique_ptr ReadData(const u_int8_t *data, std::size_t size) { +std::unique_ptr ReadData(const std::uint8_t *data, std::size_t size) { const std::size_t v2_offset = SkipToVersion2(data, size); if (v2_offset == static_cast(-1)) { return nullptr; } - const u_int8_t *p = data + v2_offset; + const std::uint8_t *p = data + v2_offset; Header header; std::memcpy(&header, p, sizeof(header)); @@ -67,10 +67,10 @@ std::unique_ptr ReadData(const u_int8_t *data, std::size_t size) { FlipHeader(header); const std::size_t data_block_length = - header.timecnt * sizeof(int64_t) + header.timecnt * sizeof(u_int8_t) + + header.timecnt * sizeof(int64_t) + header.timecnt * sizeof(std::uint8_t) + header.typecnt * sizeof(TimeTypeRecord) + - header.charcnt * sizeof(int8_t) + header.isstdcnt * sizeof(u_int8_t) + - header.isutcnt * sizeof(u_int8_t); + header.charcnt * sizeof(int8_t) + header.isstdcnt * sizeof(std::uint8_t) + + header.isutcnt * sizeof(std::uint8_t); if (v2_offset + data_block_length + sizeof(Header) > size) { return nullptr; @@ -81,7 +81,7 @@ std::unique_ptr ReadData(const u_int8_t *data, std::size_t size) { const auto copy = [](std::unique_ptr &array, int length, - const u_int8_t *const &ptr) -> const u_int8_t * { + const std::uint8_t *const &ptr) -> const std::uint8_t * { const std::size_t region_length = length * sizeof(Type); array = std::make_unique(length); std::memcpy(array.get(), ptr, region_length); @@ -110,16 +110,16 @@ std::unique_ptr ReadData(const u_int8_t *data, std::size_t size) { return impl; } -static void PushToBuffer(std::vector &buffer, const void *data, +static void PushToBuffer(std::vector &buffer, const void *data, std::size_t size) { - const u_int8_t *p{reinterpret_cast(data)}; + const std::uint8_t *p{reinterpret_cast(data)}; for (std::size_t i = 0; i < size; i++) { buffer.push_back(*p); p++; } } -void DataImpl::ReformatNintendo(std::vector &buffer) const { +void DataImpl::ReformatNintendo(std::vector &buffer) const { buffer.clear(); Header header_copy{header}; @@ -131,7 +131,7 @@ void DataImpl::ReformatNintendo(std::vector &buffer) const { PushToBuffer(buffer, transition_times.get(), header.timecnt * sizeof(int64_t)); PushToBuffer(buffer, transition_types.get(), - header.timecnt * sizeof(u_int8_t)); + header.timecnt * sizeof(std::uint8_t)); PushToBuffer(buffer, local_time_type_records.get(), header.typecnt * sizeof(TimeTypeRecord)); PushToBuffer(buffer, time_zone_designations.get(), diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h index 62ff3afe15..22dfeb4c3c 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h @@ -2,21 +2,21 @@ #include #include -#include +#include #include namespace Tzif { typedef struct { char magic[4]; - u_int8_t version; - u_int8_t reserved[15]; - u_int32_t isutcnt; - u_int32_t isstdcnt; - u_int32_t leapcnt; - u_int32_t timecnt; - u_int32_t typecnt; - u_int32_t charcnt; + std::uint8_t version; + std::uint8_t reserved[15]; + std::uint32_t isutcnt; + std::uint32_t isstdcnt; + std::uint32_t leapcnt; + std::uint32_t timecnt; + std::uint32_t typecnt; + std::uint32_t charcnt; } Header; static_assert(sizeof(Header) == 0x2c); @@ -34,9 +34,9 @@ public: #pragma pack(push, 1) typedef struct { - u_int32_t utoff; - u_int8_t dst; - u_int8_t idx; + std::uint32_t utoff; + std::uint8_t dst; + std::uint8_t idx; } TimeTypeRecord; #pragma pack(pop) static_assert(sizeof(TimeTypeRecord) == 0x6); @@ -46,7 +46,7 @@ public: explicit Data() = default; virtual ~Data() = default; - virtual void ReformatNintendo(std::vector &buffer) const = 0; + virtual void ReformatNintendo(std::vector &buffer) const = 0; }; class DataImpl : public Data { @@ -54,19 +54,19 @@ public: explicit DataImpl() = default; ~DataImpl() override = default; - void ReformatNintendo(std::vector &buffer) const override; + void ReformatNintendo(std::vector &buffer) const override; Header header; Footer footer; std::unique_ptr transition_times; - std::unique_ptr transition_types; + std::unique_ptr transition_types; std::unique_ptr local_time_type_records; std::unique_ptr time_zone_designations; - std::unique_ptr standard_indicators; - std::unique_ptr ut_indicators; + std::unique_ptr standard_indicators; + std::unique_ptr ut_indicators; }; -std::unique_ptr ReadData(const u_int8_t *data, std::size_t size); +std::unique_ptr ReadData(const std::uint8_t *data, std::size_t size); } // namespace Tzif diff --git a/externals/renderdoc/renderdoc_app.h b/externals/renderdoc/renderdoc_app.h index 84ff62b5db..0237701679 100644 --- a/externals/renderdoc/renderdoc_app.h +++ b/externals/renderdoc/renderdoc_app.h @@ -38,14 +38,8 @@ #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) #define RENDERDOC_CC __cdecl -#elif defined(__linux__) -#define RENDERDOC_CC -#elif defined(__APPLE__) -#define RENDERDOC_CC -#elif defined(__FreeBSD__) -#define RENDERDOC_CC #else -#error "Unknown platform" +#define RENDERDOC_CC #endif #ifdef __cplusplus diff --git a/src/audio_core/sink/sdl2_sink.cpp b/src/audio_core/sink/sdl2_sink.cpp index 7dd155ff0c..3283356b8d 100644 --- a/src/audio_core/sink/sdl2_sink.cpp +++ b/src/audio_core/sink/sdl2_sink.cpp @@ -3,6 +3,7 @@ #include #include + #include #include "audio_core/common/common.h" diff --git a/src/common/minicoro.h b/src/common/minicoro.h index 9f1dbcafb3..ae66716f04 100644 --- a/src/common/minicoro.h +++ b/src/common/minicoro.h @@ -467,7 +467,7 @@ extern "C" { #ifdef MCO_NO_MULTITHREAD #define MCO_THREAD_LOCAL #else -#ifdef thread_local +#if defined(thread_local) || __STDC_VERSION__ >= 202311L || defined(__sun__) #define MCO_THREAD_LOCAL thread_local #elif __STDC_VERSION__ >= 201112 && !defined(__STDC_NO_THREADS__) #define MCO_THREAD_LOCAL _Thread_local diff --git a/src/core/hle/service/caps/caps_manager.cpp b/src/core/hle/service/caps/caps_manager.cpp index e636d90bc4..f058d991b1 100644 --- a/src/core/hle/service/caps/caps_manager.cpp +++ b/src/core/hle/service/caps/caps_manager.cpp @@ -440,8 +440,8 @@ Result AlbumManager::SaveImage(ApplicationAlbumEntry& out_entry, std::span struct fmt::formatter : fmt::formatter { template auto format(const Service::PSC::Time::CalendarTime& calendar, FormatContext& ctx) const { - return fmt::format_to(ctx.out(), "[{:02}/{:02}/{:04} {:02}:{:02}:{:02}]", calendar.day, - calendar.month, calendar.year, calendar.hour, calendar.minute, - calendar.second); + return fmt::format_to(ctx.out(), "[{:02}/{:02}/{:04} {:02}:{:02}:{:02}]", u8(calendar.day), + u8(calendar.month), u16(calendar.year), u8(calendar.hour), u8(calendar.minute), + u8(calendar.second)); } }; diff --git a/src/core/internal_network/network_interface.cpp b/src/core/internal_network/network_interface.cpp index 42def7af92..f62381b9e3 100644 --- a/src/core/internal_network/network_interface.cpp +++ b/src/core/internal_network/network_interface.cpp @@ -27,7 +27,7 @@ namespace Network { #ifdef _WIN32 -std::vector GetAvailableNetworkInterfaces() { +std::vector GetAvailableNetworkInterfaces() { ULONG buf_size = 0; if (GetAdaptersAddresses( @@ -47,7 +47,7 @@ std::vector GetAvailableNetworkInterfaces() { return {}; } - std::vector result; + std::vector result; for (auto* a = addrs; a; a = a->Next) { @@ -80,7 +80,7 @@ std::vector GetAvailableNetworkInterfaces() { break; } - result.emplace_back(NetworkInterface{ + result.emplace_back(Network::NetworkInterface{ .name = Common::UTF16ToUTF8(std::wstring{a->FriendlyName}), .ip_address = ip, .subnet_mask = mask, @@ -94,7 +94,7 @@ std::vector GetAvailableNetworkInterfaces() { #else -std::vector GetAvailableNetworkInterfaces() { +std::vector GetAvailableNetworkInterfaces() { struct ifaddrs* ifaddr = nullptr; if (getifaddrs(&ifaddr) != 0) { @@ -103,7 +103,7 @@ std::vector GetAvailableNetworkInterfaces() { return {}; } - std::vector result; + std::vector result; for (auto ifa = ifaddr; ifa != nullptr; ifa = ifa->ifa_next) { if (ifa->ifa_addr == nullptr || ifa->ifa_netmask == nullptr) { @@ -121,7 +121,7 @@ std::vector GetAvailableNetworkInterfaces() { #ifdef ANDROID // On Android, we can't reliably get gateway info from /proc/net/route // Just use 0 as the gateway address - result.emplace_back(NetworkInterface{ + result.emplace_back(Network::NetworkInterface{ .name{ifa->ifa_name}, .ip_address{Common::BitCast(*ifa->ifa_addr).sin_addr}, .subnet_mask{Common::BitCast(*ifa->ifa_netmask).sin_addr}, @@ -134,11 +134,15 @@ std::vector GetAvailableNetworkInterfaces() { if (!file.is_open()) { LOG_ERROR(Network, "Failed to open \"/proc/net/route\""); - result.emplace_back(NetworkInterface{ - .name{ifa->ifa_name}, - .ip_address{Common::BitCast(*ifa->ifa_addr).sin_addr}, - .subnet_mask{Common::BitCast(*ifa->ifa_netmask).sin_addr}, - .gateway{in_addr{.s_addr = gateway}}}); + // Solaris defines s_addr as a macro, can't use special C++ shenanigans here + in_addr gateway_0; + gateway_0.s_addr = gateway; + result.emplace_back(Network::NetworkInterface{ + .name = ifa->ifa_name, + .ip_address = Common::BitCast(*ifa->ifa_addr).sin_addr, + .subnet_mask = Common::BitCast(*ifa->ifa_netmask).sin_addr, + .gateway = gateway_0 + }); continue; } @@ -183,11 +187,14 @@ std::vector GetAvailableNetworkInterfaces() { gateway = 0; } - result.emplace_back(NetworkInterface{ - .name{ifa->ifa_name}, - .ip_address{Common::BitCast(*ifa->ifa_addr).sin_addr}, - .subnet_mask{Common::BitCast(*ifa->ifa_netmask).sin_addr}, - .gateway{in_addr{.s_addr = gateway}}}); + in_addr gateway_0; + gateway_0.s_addr = gateway; + result.emplace_back(Network::NetworkInterface{ + .name = ifa->ifa_name, + .ip_address = Common::BitCast(*ifa->ifa_addr).sin_addr, + .subnet_mask = Common::BitCast(*ifa->ifa_netmask).sin_addr, + .gateway = gateway_0 + }); #endif // ANDROID } @@ -197,7 +204,7 @@ std::vector GetAvailableNetworkInterfaces() { #endif // _WIN32 -std::optional GetSelectedNetworkInterface() { +std::optional GetSelectedNetworkInterface() { const auto& selected_network_interface = Settings::values.network_interface.GetValue(); const auto network_interfaces = Network::GetAvailableNetworkInterfaces(); diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt index 8e306219fb..1657feaa5f 100644 --- a/src/network/CMakeLists.txt +++ b/src/network/CMakeLists.txt @@ -25,6 +25,11 @@ if (ENABLE_WEB_SERVICE) target_link_libraries(network PRIVATE web_service) endif() +# Solaris uses /lib/amd64/libsocket.so and /lib/amd64/libnsl.so +if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") + target_link_libraries(network PRIVATE socket nsl) +endif() + if (YUZU_USE_PRECOMPILED_HEADERS) target_precompile_headers(network PRIVATE precompiled_headers.h) endif() diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index ebd8fd7387..9d1e08c04c 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -40,6 +40,11 @@ target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR}) target_link_libraries(yuzu-cmd PRIVATE SDL2::SDL2 Vulkan::Headers) +# In Solaris needs explicit linking for ffmpeg which links to /lib/amd64/libX11.so +if (${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") + target_link_libraries(yuzu-cmd PRIVATE X11) +endif() + if(UNIX AND NOT APPLE) install(TARGETS yuzu-cmd) endif() -- 2.39.5 From a19c17b00778e787d29be26255ee486ada82c2d3 Mon Sep 17 00:00:00 2001 From: crueter Date: Tue, 22 Jul 2025 23:28:51 -0400 Subject: [PATCH 2/2] Fix license headers --- .../dynarmic/src/dynarmic/backend/exception_handler_posix.cpp | 3 +++ externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp | 3 +++ externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp | 3 +++ externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h | 3 +++ externals/renderdoc/renderdoc_app.h | 3 +++ src/audio_core/sink/sdl2_sink.cpp | 3 +++ src/common/minicoro.h | 3 +++ src/core/hle/service/caps/caps_manager.cpp | 3 +++ src/core/hle/service/psc/time/common.h | 3 +++ 9 files changed, 27 insertions(+) diff --git a/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp b/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp index bfc6559b77..8a523267e5 100644 --- a/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp +++ b/externals/dynarmic/src/dynarmic/backend/exception_handler_posix.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* This file is part of the dynarmic project. * Copyright (c) 2019 MerryMage * SPDX-License-Identifier: 0BSD diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp index 015a588a1f..12c12ac268 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/main.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "tzif.h" #include #include diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp index ce31b1520b..476afcbc8e 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #include "tzif.h" #include #include diff --git a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h index 22dfeb4c3c..a6eb32a896 100644 --- a/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h +++ b/externals/nx_tzdb/tzdb_to_nx/src/tzdb2nx/tzif.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + #pragma once #include diff --git a/externals/renderdoc/renderdoc_app.h b/externals/renderdoc/renderdoc_app.h index 0237701679..f4eb12526e 100644 --- a/externals/renderdoc/renderdoc_app.h +++ b/externals/renderdoc/renderdoc_app.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Baldur Karlsson // SPDX-License-Identifier: MIT diff --git a/src/audio_core/sink/sdl2_sink.cpp b/src/audio_core/sink/sdl2_sink.cpp index 3283356b8d..ffdd77042e 100644 --- a/src/audio_core/sink/sdl2_sink.cpp +++ b/src/audio_core/sink/sdl2_sink.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/common/minicoro.h b/src/common/minicoro.h index ae66716f04..f4113dcbe5 100644 --- a/src/common/minicoro.h +++ b/src/common/minicoro.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + /* Minimal asymmetric stackful cross-platform coroutine library in pure C. minicoro - v0.2.0 - 15/Nov/2023 diff --git a/src/core/hle/service/caps/caps_manager.cpp b/src/core/hle/service/caps/caps_manager.cpp index f058d991b1..1825d345a6 100644 --- a/src/core/hle/service/caps/caps_manager.cpp +++ b/src/core/hle/service/caps/caps_manager.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later diff --git a/src/core/hle/service/psc/time/common.h b/src/core/hle/service/psc/time/common.h index 9c49f25bd1..954aed666a 100644 --- a/src/core/hle/service/psc/time/common.h +++ b/src/core/hle/service/psc/time/common.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -- 2.39.5