diff options
author | jbeich <jbeich@FreeBSD.org> | 2017-07-12 08:08:24 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2017-07-12 08:08:24 +0800 |
commit | 6f3a4ae3ffe7da598508e22a01e87a7ba27d9046 (patch) | |
tree | 458d2508b39baff8bf8d5c89591b35b8ffa3da5d /emulators | |
parent | 9ccaa24e419dbf64539d7cec4135d828d7cb2e15 (diff) | |
download | freebsd-ports-gnome-6f3a4ae3ffe7da598508e22a01e87a7ba27d9046.tar.gz freebsd-ports-gnome-6f3a4ae3ffe7da598508e22a01e87a7ba27d9046.tar.zst freebsd-ports-gnome-6f3a4ae3ffe7da598508e22a01e87a7ba27d9046.zip |
emulators/rpcs3: work around LLVM recompiler crash
Assertion failed: ((Type == ELF::R_X86_64_32 && (Value <= UINT32_MAX)) || (Type == ELF::R_X86_64_32S && ((int64_t)Value <= INT32_MAX && (int64_t)Value >= INT32_MIN))), function resolveX86_64Relocation, file /usr/ports/devel/llvm40/work/llvm-4.0.1.src/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp, line 287.
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/rpcs3/Makefile | 1 | ||||
-rw-r--r-- | emulators/rpcs3/files/patch-Utilities_JIT.cpp | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/emulators/rpcs3/Makefile b/emulators/rpcs3/Makefile index 10abd95ba72c..d27cafef4814 100644 --- a/emulators/rpcs3/Makefile +++ b/emulators/rpcs3/Makefile @@ -4,6 +4,7 @@ PORTNAME= rpcs3 DISTVERSIONPREFIX= v DISTVERSION= 0.0.2-423 DISTVERSIONSUFFIX= -g34709eb3 +PORTREVISION= 1 CATEGORIES= emulators MAINTAINER= jbeich@FreeBSD.org diff --git a/emulators/rpcs3/files/patch-Utilities_JIT.cpp b/emulators/rpcs3/files/patch-Utilities_JIT.cpp new file mode 100644 index 000000000000..ba30f8a31f2d --- /dev/null +++ b/emulators/rpcs3/files/patch-Utilities_JIT.cpp @@ -0,0 +1,35 @@ +--- Utilities/JIT.cpp.orig 2017-07-10 15:42:02 UTC ++++ Utilities/JIT.cpp +@@ -31,6 +31,10 @@ + #include <Windows.h> + #endif + ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++#include <sys/resource.h> ++#endif ++ + #include "JIT.h" + + // Memory manager mutex +@@ -45,6 +49,21 @@ static void* const s_memory = []() -> void* + llvm::InitializeNativeTarget(); + llvm::InitializeNativeTargetAsmPrinter(); + LLVMLinkInMCJIT(); ++ ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ++ // XXX Fix maximum data segment size (data + BSS + heap) to 256 MB. ++ // This allows avoiding calling mmap(2) with MAP_FIXED. ++ // On FreeBSD, without lowering this limit, calling mmap(2) ++ // without MAP_FIXED will result in getting an address just ++ // beyond maximum data segment size which will be far beyond ++ // the desired 2 GB. ++ struct rlimit limit; ++ limit.rlim_cur = 0x10000000; // 256 MB ++ limit.rlim_max = 0x10000000; ++ if(setrlimit(RLIMIT_DATA, &limit) != 0) { ++ LOG_ERROR(GENERAL, "LLVM: Failed to lower maximum data segment size"); ++ } ++#endif + + for (u64 addr = 0x10000000; addr <= 0x80000000 - s_memory_size; addr += 0x1000000) + { |