From 2158309c51f4d16c64761b83840e56a7ad7991b8 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 14:42:47 +0200 Subject: [PATCH 1/9] InterpreterFallbacks: Remove unused template Fixes -Wunused-template warning. --- .../Interpreter/Fallbacks/InterpreterFallbacks.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/FEXCore/Source/Interface/Core/Interpreter/Fallbacks/InterpreterFallbacks.cpp b/FEXCore/Source/Interface/Core/Interpreter/Fallbacks/InterpreterFallbacks.cpp index d4a14a150..a5dcd286f 100644 --- a/FEXCore/Source/Interface/Core/Interpreter/Fallbacks/InterpreterFallbacks.cpp +++ b/FEXCore/Source/Interface/Core/Interpreter/Fallbacks/InterpreterFallbacks.cpp @@ -10,11 +10,6 @@ namespace FEXCore::CPU { -template -static FallbackInfo GetFallbackInfo(R (*fn)(Args...), FEXCore::Core::FallbackHandlerIndex HandlerIndex) { - return {FABI_UNKNOWN, HandlerIndex}; -} - void InterpreterOps::FillFallbackIndexPointers(Core::FallbackABIInfo* Info, uint64_t* ABIHandlers) { Info[Core::OPINDEX_F80CVTTO_4] = {ABIHandlers[FABI_F80_I16_F32_PTR], reinterpret_cast(&FEXCore::CPU::OpHandlers::handle4)}; @@ -216,12 +211,6 @@ bool InterpreterOps::GetFallbackHandler(const IR::IROp_Header* IROp, FallbackInf return true; \ } -#define COMMON_F64_OP(OP) \ - case IR::OP_F64##OP: { \ - *Info = GetFallbackInfo(&FEXCore::CPU::OpHandlers::handle, Core::OPINDEX_F64##OP); \ - return true; \ - } - #define COMMON_UNARY_F64_OP(OP) \ case IR::OP_F64##OP: { \ *Info = {FABI_F64_F64_PTR, Core::OPINDEX_F64##OP}; \ From de16c18961ac2c7d0dfa5a93e9fda9cebc995690 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 14:45:31 +0200 Subject: [PATCH 2/9] SignalScopeGuards: Mark template function helpers as inline Fixes -Wunused-template warnings. --- FEXCore/include/FEXCore/Utils/SignalScopeGuards.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FEXCore/include/FEXCore/Utils/SignalScopeGuards.h b/FEXCore/include/FEXCore/Utils/SignalScopeGuards.h index 6589cf2d3..9616a6ed0 100644 --- a/FEXCore/include/FEXCore/Utils/SignalScopeGuards.h +++ b/FEXCore/include/FEXCore/Utils/SignalScopeGuards.h @@ -250,19 +250,19 @@ public: template class LockType = std::unique_lock, typename MutexType> [[nodiscard]] -static auto MaskSignalsAndLockMutex(MutexType& mutex, uint64_t Mask = ~0ULL) { +static inline auto MaskSignalsAndLockMutex(MutexType& mutex, uint64_t Mask = ~0ULL) { return LockType {mutex}; } template class LockType = std::unique_lock, typename MutexType> [[nodiscard]] -static auto GuardSignalDeferringSection(MutexType& mutex, FEXCore::Core::InternalThreadState* Thread, uint64_t Mask = ~0ULL) { +static inline auto GuardSignalDeferringSection(MutexType& mutex, FEXCore::Core::InternalThreadState* Thread, uint64_t Mask = ~0ULL) { return LockType {mutex}; } template class LockType = std::unique_lock, typename MutexType> [[nodiscard]] -static auto GuardSignalDeferringSectionWithFallback(MutexType& mutex, FEXCore::Core::InternalThreadState* Thread, uint64_t Mask = ~0ULL) { +static inline auto GuardSignalDeferringSectionWithFallback(MutexType& mutex, FEXCore::Core::InternalThreadState* Thread, uint64_t Mask = ~0ULL) { return LockType {mutex}; } From b543df8299e3f077e52ee05893290ef9a032ff3a Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 14:48:56 +0200 Subject: [PATCH 3/9] HostFeatures: Avoid unused function in win32 builds Fixes -Wunused-function warning. --- Source/Common/HostFeatures.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Common/HostFeatures.cpp b/Source/Common/HostFeatures.cpp index fcbc1f36b..b3116e65d 100644 --- a/Source/Common/HostFeatures.cpp +++ b/Source/Common/HostFeatures.cpp @@ -72,7 +72,9 @@ GetSysReg(MIDR_EL1, MIDR_EL1); GetSysReg(ISAR1_EL1, ID_AA64ISAR1_EL1); GetSysReg(MMFR0_EL1, ID_AA64MMFR0_EL1); GetSysReg(MMFR2_EL1, ID_AA64MMFR2_EL1); +#ifndef _WIN32 GetSysReg(MMFR3_EL1, s3_0_c0_c7_3); // Can't request by name +#endif GetSysReg(ZFR0_EL1, s3_0_c0_c4_4); // Can't request by name GetSysReg(MMFR1_EL1, ID_AA64MMFR1_EL1); GetSysReg(ISAR2_EL1, ID_AA64ISAR2_EL1); From 390d5d2fb4c0eaef031e502773a0fc1e36a6ce1c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 14:51:33 +0200 Subject: [PATCH 4/9] OfflineCompiler: Avoid unused function in win32 builds Fixes -Wunused-function warning. --- Source/Tools/FEXOfflineCompiler/Main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Tools/FEXOfflineCompiler/Main.cpp b/Source/Tools/FEXOfflineCompiler/Main.cpp index af3bb7723..3f8d7414b 100644 --- a/Source/Tools/FEXOfflineCompiler/Main.cpp +++ b/Source/Tools/FEXOfflineCompiler/Main.cpp @@ -136,6 +136,7 @@ public: #endif }; +#ifndef _WIN32 static void MsgHandler(LogMan::DebugLevels Level, const char* Message) { fmt::print("[{}] {}\n", LogMan::DebugLevelStr(Level), Message); } @@ -143,6 +144,7 @@ static void MsgHandler(LogMan::DebugLevels Level, const char* Message) { static void AssertHandler(const char* Message) { fmt::print("[A] {}\n", Message); } +#endif namespace FEXCore { inline bool operator<(const ExecutableFileInfo& a, const ExecutableFileInfo& b) noexcept { From 466ee3cbcf5a8428cba5b344841fe6be1fb65918 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 14:53:22 +0200 Subject: [PATCH 5/9] CRT: Use DLLEXPORT_FUNC for more functions Fixes locally defined symbol imported linker warnings. --- Source/Windows/Common/CRT/Misc.cpp | 2 +- Source/Windows/Common/CRT/String.cpp | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Source/Windows/Common/CRT/Misc.cpp b/Source/Windows/Common/CRT/Misc.cpp index 76f8b997b..79a006878 100644 --- a/Source/Windows/Common/CRT/Misc.cpp +++ b/Source/Windows/Common/CRT/Misc.cpp @@ -51,7 +51,7 @@ void InitEnv() { __attribute__((used, section(".CRT$FEXB"))) void (*_InitEnv)(void) = InitEnv; } // namespace -char*** __p__environ() { +DLLEXPORT_FUNC(char***, __p__environ, ()) { return &EnvArray; } diff --git a/Source/Windows/Common/CRT/String.cpp b/Source/Windows/Common/CRT/String.cpp index 07989092d..3fd981c0b 100644 --- a/Source/Windows/Common/CRT/String.cpp +++ b/Source/Windows/Common/CRT/String.cpp @@ -120,11 +120,11 @@ int snprintf(char* stream, size_t n, const char* format, ...) { return ret; } -char* setlocale(int _Category, const char* _Locale) { +DLLEXPORT_FUNC(char*, setlocale, (int _Category, const char* _Locale)) { return Locale; } -int _configthreadlocale(int _Flag) { +DLLEXPORT_FUNC(int, _configthreadlocale, (int _Flag)) { return 0; } @@ -138,16 +138,17 @@ DLLEXPORT_FUNC(struct lconv*, localeconv, (void)) { DLLEXPORT_FUNC(void, _free_locale, (_locale_t _Locale)) {} -wint_t btowc(int) { +DLLEXPORT_FUNC(wint_t, btowc, (int)) { UNIMPLEMENTED(); } -size_t mbsrtowcs(wchar_t* __restrict__ _Dest, const char** __restrict__ _PSrc, size_t _Count, - mbstate_t* __restrict__ _State) __MINGW_ATTRIB_DEPRECATED_SEC_WARN { +DLLEXPORT_FUNC(size_t, mbsrtowcs, (wchar_t* __restrict__ _Dest, const char** __restrict__ _PSrc, size_t _Count, mbstate_t* __restrict__ _State)) +__MINGW_ATTRIB_DEPRECATED_SEC_WARN { UNIMPLEMENTED(); } -size_t mbrtowc(wchar_t* __restrict__ _DstCh, const char* __restrict__ _SrcCh, size_t _SizeInBytes, mbstate_t* __restrict__ _State) { +DLLEXPORT_FUNC(size_t, mbrtowc, + (wchar_t* __restrict__ _DstCh, const char* __restrict__ _SrcCh, size_t _SizeInBytes, mbstate_t* __restrict__ _State)) { UNIMPLEMENTED(); } @@ -159,11 +160,11 @@ DLLEXPORT_FUNC(int, _mbtowc_l, (wchar_t* __restrict__ DstCh, const char* __restr return 1; } -size_t mbrlen(const char* __restrict__ _Ch, size_t _SizeInBytes, mbstate_t* __restrict__ _State) { +DLLEXPORT_FUNC(size_t, mbrlen, (const char* __restrict__ _Ch, size_t _SizeInBytes, mbstate_t* __restrict__ _State)) { UNIMPLEMENTED(); } -size_t wcrtomb(char* __restrict__ _Dest, wchar_t _Source, mbstate_t* __restrict__ _State) { +DLLEXPORT_FUNC(size_t, wcrtomb, (char* __restrict__ _Dest, wchar_t _Source, mbstate_t* __restrict__ _State)) { UNIMPLEMENTED(); } @@ -171,7 +172,7 @@ DLLEXPORT_FUNC(errno_t, wcrtomb_s, (size_t* _Retval, char* _Dst, size_t _SizeInB UNIMPLEMENTED(); } -int wctob(wint_t _WCh) { +DLLEXPORT_FUNC(int, wctob, (wint_t _WCh)) { UNIMPLEMENTED(); } From 4e9399e02904288126359b505dc3d15e581d870c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 14:56:56 +0200 Subject: [PATCH 6/9] CRT: Silence -Wunused-but-set-variable warnings in libm.h --- Source/Windows/Common/CRT/Musl/libm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Windows/Common/CRT/Musl/libm.h b/Source/Windows/Common/CRT/Musl/libm.h index f52e9c62f..7dcdf461a 100644 --- a/Source/Windows/Common/CRT/Musl/libm.h +++ b/Source/Windows/Common/CRT/Musl/libm.h @@ -153,6 +153,7 @@ static inline long double fp_barrierl(long double x) { static inline void fp_force_evalf(float x) { volatile float y; y = x; + (void)y; } #endif @@ -161,6 +162,7 @@ static inline void fp_force_evalf(float x) { static inline void fp_force_eval(double x) { volatile double y; y = x; + (void)y; } #endif @@ -169,6 +171,7 @@ static inline void fp_force_eval(double x) { static inline void fp_force_evall(long double x) { volatile long double y; y = x; + (void)y; } #endif From 720039ca6dc35ccdc131f7bf3147d4506c508cc5 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 14:59:16 +0200 Subject: [PATCH 7/9] CRT: Avoid implicit char to unsigned char casts in strtoumax Fixes -Wpointer-sign warnings. --- Source/Windows/Common/CRT/Musl/strtoimax.c | 3 +-- Source/Windows/Common/CRT/Musl/strtoumax.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Windows/Common/CRT/Musl/strtoimax.c b/Source/Windows/Common/CRT/Musl/strtoimax.c index 673e90ab7..385816972 100644 --- a/Source/Windows/Common/CRT/Musl/strtoimax.c +++ b/Source/Windows/Common/CRT/Musl/strtoimax.c @@ -6,8 +6,7 @@ #include #include -intmax_t strtoimax(const char* s1, char** p, int base) { - const unsigned char* s = s1; +intmax_t strtoimax(const char* s, char** p, int base) { int sign = 0; uintmax_t x; diff --git a/Source/Windows/Common/CRT/Musl/strtoumax.c b/Source/Windows/Common/CRT/Musl/strtoumax.c index 31d406808..d373a7aab 100644 --- a/Source/Windows/Common/CRT/Musl/strtoumax.c +++ b/Source/Windows/Common/CRT/Musl/strtoumax.c @@ -21,7 +21,7 @@ static const unsigned char digits[] = { }; uintmax_t strtoumax(const char* s1, char** p, int base) { - const unsigned char* s = s1; + const unsigned char* s = (const unsigned char*)s1; size_t x1, z1; uintmax_t x, z = 0; int sign = 0; From 363bf85b5b75bb83be1294a4a3fd8ee91772ff96 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 15:00:47 +0200 Subject: [PATCH 8/9] LongJump: Silence -Winline-asm warnings on ARM64EC Fixes disallowed registers warnings. --- FEXCore/Source/Utils/LongJump.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FEXCore/Source/Utils/LongJump.cpp b/FEXCore/Source/Utils/LongJump.cpp index 89ca74208..4f3f3bddd 100644 --- a/FEXCore/Source/Utils/LongJump.cpp +++ b/FEXCore/Source/Utils/LongJump.cpp @@ -6,6 +6,9 @@ namespace FEXCore::UncheckedLongJump { #if defined(ARCHITECTURE_arm64) +#ifdef __arm64ec__ +#pragma clang diagnostic ignored "-Winline-asm" +#endif [[nodiscard]] FEX_DEFAULT_VISIBILITY FEX_NAKED uint64_t SetJump(JumpBuf& Buffer) { __asm volatile(R"( From 11be444d45d7289e4aee0e46f46d55d3a1e7788d Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 10 Aug 2026 15:02:17 +0200 Subject: [PATCH 9/9] toolchain_mingw: Don't use -static-libgcc -static-libstdc++ Those are not supported by Clang and cause -Wunused-command-line-argument warnings. They are also redundant when -static is used. --- Data/CMake/toolchain_mingw.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Data/CMake/toolchain_mingw.cmake b/Data/CMake/toolchain_mingw.cmake index f70eb9a7e..cff0b7b27 100644 --- a/Data/CMake/toolchain_mingw.cmake +++ b/Data/CMake/toolchain_mingw.cmake @@ -9,8 +9,8 @@ set(CMAKE_AR ${MINGW_TRIPLE}-ar) # Compile everything as static to avoid requiring the MinGW runtime libraries, force page aligned sections so that # debug symbols work correctly, and disable loop alignment to workaround an LLVM bug # (https://github.com/llvm/llvm-project/issues/47432) -set(CMAKE_SHARED_LINKER_FLAGS_INIT "-static -static-libgcc -static-libstdc++ -Wl,--file-alignment=4096,/mllvm:-align-loops=1") -set(CMAKE_EXE_LINKER_FLAGS_INIT "-static -static-libgcc -static-libstdc++ -Wl,--file-alignment=4096,/mllvm:-align-loops=1") +set(CMAKE_SHARED_LINKER_FLAGS_INIT "-static -Wl,--file-alignment=4096,/mllvm:-align-loops=1") +set(CMAKE_EXE_LINKER_FLAGS_INIT "-static -Wl,--file-alignment=4096,/mllvm:-align-loops=1") set(CMAKE_C_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "" FORCE) set(CMAKE_STANDARD_LIBRARIES "" CACHE STRING "" FORCE)