From fff113b64ffbb673d803d18c28f833c7d2b6c02d Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 11 Jun 2015 23:34:16 -0700 Subject: [PATCH] Fix 64-bit FreeBSD build --- CMakeLists.txt | 1 + Source/Core/Core/MemTools.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 789060e8a6..98d4a7bec3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,7 @@ endif() if(NOT ENABLE_GENERIC) if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86" OR + ${CMAKE_SYSTEM_PROCESSOR} MATCHES "amd64" OR APPLE) if(_ARCH_64) set(_M_X86 1) diff --git a/Source/Core/Core/MemTools.cpp b/Source/Core/Core/MemTools.cpp index e028b40faa..2c1f688d5b 100644 --- a/Source/Core/Core/MemTools.cpp +++ b/Source/Core/Core/MemTools.cpp @@ -18,6 +18,9 @@ #ifndef _M_GENERIC #include "Core/PowerPC/JitCommon/JitBase.h" #endif +#ifdef __FreeBSD__ +#include +#endif namespace EMM { @@ -256,7 +259,11 @@ static void sigsegv_handler(int sig, siginfo_t *info, void *raw_context) void InstallExceptionHandler() { stack_t signal_stack; +#ifdef __FreeBSD__ + signal_stack.ss_sp = (char*)malloc(SIGSTKSZ); +#else signal_stack.ss_sp = malloc(SIGSTKSZ); +#endif signal_stack.ss_size = SIGSTKSZ; signal_stack.ss_flags = 0; if (sigaltstack(&signal_stack, nullptr))