From owner-svn-ports-head@freebsd.org Wed Jul 12 00:08:26 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3056EDAEC23; Wed, 12 Jul 2017 00:08:26 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B2D770E1E; Wed, 12 Jul 2017 00:08:25 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6C08PK1059327; Wed, 12 Jul 2017 00:08:25 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6C08PZf059325; Wed, 12 Jul 2017 00:08:25 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201707120008.v6C08PZf059325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Wed, 12 Jul 2017 00:08:25 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r445552 - in head/emulators/rpcs3: . files X-SVN-Group: ports-head X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: in head/emulators/rpcs3: . files X-SVN-Commit-Revision: 445552 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jul 2017 00:08:26 -0000 Author: jbeich Date: Wed Jul 12 00:08:24 2017 New Revision: 445552 URL: https://svnweb.freebsd.org/changeset/ports/445552 Log: 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. Added: head/emulators/rpcs3/files/patch-Utilities_JIT.cpp - copied, changed from r445550, head/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp Modified: head/emulators/rpcs3/Makefile Modified: head/emulators/rpcs3/Makefile ============================================================================== --- head/emulators/rpcs3/Makefile Wed Jul 12 00:06:23 2017 (r445551) +++ head/emulators/rpcs3/Makefile Wed Jul 12 00:08:24 2017 (r445552) @@ -4,6 +4,7 @@ PORTNAME= rpcs3 DISTVERSIONPREFIX= v DISTVERSION= 0.0.2-423 DISTVERSIONSUFFIX= -g34709eb3 +PORTREVISION= 1 CATEGORIES= emulators MAINTAINER= jbeich@FreeBSD.org Copied and modified: head/emulators/rpcs3/files/patch-Utilities_JIT.cpp (from r445550, head/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp) ============================================================================== --- head/emulators/ppsspp/files/patch-Common_MemoryUtil.cpp Tue Jul 11 21:43:28 2017 (r445550, copy source) +++ head/emulators/rpcs3/files/patch-Utilities_JIT.cpp Wed Jul 12 00:08:24 2017 (r445552) @@ -1,35 +1,35 @@ ---- Common/MemoryUtil.cpp.orig 2015-11-19 15:07:48 UTC -+++ Common/MemoryUtil.cpp -@@ -32,6 +32,10 @@ - #include +--- Utilities/JIT.cpp.orig 2017-07-10 15:42:02 UTC ++++ Utilities/JIT.cpp +@@ -31,6 +31,10 @@ + #include #endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#include +#endif + - #ifndef _WIN32 - #include - #endif -@@ -149,6 +153,21 @@ void *AllocateExecutableMemory(size_t si - map_hint = (char*)round_page(&hint_location) - 0x20000000; // 0.5gb lower than our approximate location - else - map_hint = (char*)0x20000000; // 0.5GB mark in memory + #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) { -+ PanicAlert("Failed to lower maximum data segment size"); -+ } ++ // 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 - } - else if ((uintptr_t) map_hint > 0xFFFFFFFFULL) + + for (u64 addr = 0x10000000; addr <= 0x80000000 - s_memory_size; addr += 0x1000000) {