Add NetBSD support (#985)

Note - This will require PaX MPROTECT to be disabled for melonDS by running:
paxctl +m melonDS
This commit is contained in:
WaluigiWare64 2021-02-03 16:14:53 +00:00 committed by GitHub
parent 7b9b8418cb
commit 2502c8d212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -159,6 +159,8 @@ static void SigsegvHandler(int sig, siginfo_t* info, void* rawContext)
desc.FaultPC = (u8*)context->uc_mcontext->__ss.__rip; desc.FaultPC = (u8*)context->uc_mcontext->__ss.__rip;
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
desc.FaultPC = (u8*)context->uc_mcontext.mc_rip; desc.FaultPC = (u8*)context->uc_mcontext.mc_rip;
#elif defined(__NetBSD__)
desc.FaultPC = (u8*)context->uc_mcontext.__gregs[_REG_RIP];
#else #else
desc.FaultPC = (u8*)context->uc_mcontext.gregs[REG_RIP]; desc.FaultPC = (u8*)context->uc_mcontext.gregs[REG_RIP];
#endif #endif
@ -180,6 +182,8 @@ static void SigsegvHandler(int sig, siginfo_t* info, void* rawContext)
context->uc_mcontext->__ss.__rip = (u64)desc.FaultPC; context->uc_mcontext->__ss.__rip = (u64)desc.FaultPC;
#elif defined(__FreeBSD__) #elif defined(__FreeBSD__)
context->uc_mcontext.mc_rip = (u64)desc.FaultPC; context->uc_mcontext.mc_rip = (u64)desc.FaultPC;
#elif defined(__NetBSD__)
context->uc_mcontext.__gregs[_REG_RIP] = (u64)desc.FaultPC;
#else #else
context->uc_mcontext.gregs[REG_RIP] = (u64)desc.FaultPC; context->uc_mcontext.gregs[REG_RIP] = (u64)desc.FaultPC;
#endif #endif

View File

@ -92,7 +92,10 @@ endif()
if (UNIX) if (UNIX)
option(PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF) option(PORTABLE "Make a portable build that looks for its configuration in the current directory" OFF)
target_link_libraries(melonDS dl Qt5::Core Qt5::Gui Qt5::Widgets) target_link_libraries(melonDS Qt5::Core Qt5::Gui Qt5::Widgets)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_link_libraries(melonDS dl)
endif()
elseif (WIN32) elseif (WIN32)
option(PORTABLE "Make a portable build that looks for its configuration in the current directory" ON) option(PORTABLE "Make a portable build that looks for its configuration in the current directory" ON)
configure_file("${CMAKE_SOURCE_DIR}/melon.rc.in" "${CMAKE_SOURCE_DIR}/melon.rc") configure_file("${CMAKE_SOURCE_DIR}/melon.rc.in" "${CMAKE_SOURCE_DIR}/melon.rc")