Date: Mon, 25 Sep 2017 21:39:29 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r450636 - in head/emulators/virtualbox-ose: . files Message-ID: <201709252139.v8PLdTCI068203@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Mon Sep 25 21:39:29 2017 New Revision: 450636 URL: https://svnweb.freebsd.org/changeset/ports/450636 Log: Build recompiler with Clang if global register variable is supported. Note support for global register variable was proposed in the following upstream code reviews: https://reviews.llvm.org/D3261 https://reviews.llvm.org/D3797 and commits: http://llvm.org/viewvc/llvm-project?view=revision&revision=208104 http://llvm.org/viewvc/llvm-project?view=revision&revision=209149 However, it has very limited support as described in the following upstream PR in the gory details: https://bugs.llvm.org/show_bug.cgi?id=31005 Although it is incomplete, I *believe* Clang 3.5 and later has just enough code to support (ancient) QEMU-based recompiler. If you experience any VM crash related to recompiler, e.g., "fatal error in recompiler cpu" in its VBox.log, please let me know. FYI, QEMU was rewritten not to use this GCC-specific feature long time ago: http://lists.gnu.org/archive/html/qemu-devel/2011-05/msg00855.html https://www.mail-archive.com/qemu-devel@nongnu.org/msg63834.html Unfortunately, VirtualBox stopped merging code from QEMU for some time now. Tested by: soralx@cydem.org Added: head/emulators/virtualbox-ose/files/extrapatch-src_recompiler_dyngen-exec.h (contents, props changed) head/emulators/virtualbox-ose/files/extrapatch-src_recompiler_tcg_i386_tcg-target.h (contents, props changed) Modified: head/emulators/virtualbox-ose/Makefile Modified: head/emulators/virtualbox-ose/Makefile ============================================================================== --- head/emulators/virtualbox-ose/Makefile Mon Sep 25 21:21:33 2017 (r450635) +++ head/emulators/virtualbox-ose/Makefile Mon Sep 25 21:39:29 2017 (r450636) @@ -3,6 +3,7 @@ PORTNAME= virtualbox-ose PORTVERSION= 5.1.28 +PORTREVISION= 1 CATEGORIES= emulators MASTER_SITES= http://download.virtualbox.org/virtualbox/${PORTVERSION}/ DISTFILES= VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS} @@ -227,7 +228,11 @@ KMK_FLAGS+= -j${MAKE_JOBS_NUMBER} PATCH_DEPENDS+= ${LOCALBASE}/share/kBuild/tools/GXX3.kmk:devel/kBuild EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-Config.kmk \ ${PATCHDIR}/extrapatch-src-VBox-Devices-PC-ipxe-Makefile.kmk \ - ${PATCHDIR}/extrapatch-src-recompiler-Makefile.kmk + ${PATCHDIR}/extrapatch-src_recompiler_dyngen-exec.h \ + ${PATCHDIR}/extrapatch-src_recompiler_tcg_i386_tcg-target.h +.if ${COMPILER_VERSION} < 35 +EXTRA_PATCHES+= ${PATCHDIR}/extrapatch-src-recompiler-Makefile.kmk +.endif .endif .if ${PYTHON_MAJOR_VER} >= 3 Added: head/emulators/virtualbox-ose/files/extrapatch-src_recompiler_dyngen-exec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/virtualbox-ose/files/extrapatch-src_recompiler_dyngen-exec.h Mon Sep 25 21:39:29 2017 (r450636) @@ -0,0 +1,21 @@ +--- src/recompiler/dyngen-exec.h.orig 2017-09-13 09:34:47 UTC ++++ src/recompiler/dyngen-exec.h +@@ -75,10 +75,18 @@ typedef void * host_reg_t; + # ifndef VBOX + #define AREG0 "ebp" + # else /* VBOX - why are we different? frame-pointer optimizations on mac? */ ++# ifndef __clang__ + # define AREG0 "esi" ++# else /* __clang __ */ ++# define AREG0 "ebp" ++# endif /* __clang __ */ + # endif /* VBOX */ + #elif defined(__x86_64__) ++# ifndef __clang__ + #define AREG0 "r14" ++# else /* __clang__ */ ++# define AREG0 "rbp" ++# endif /* __clang__ */ + #elif defined(_ARCH_PPC) + #define AREG0 "r27" + #elif defined(__arm__) Added: head/emulators/virtualbox-ose/files/extrapatch-src_recompiler_tcg_i386_tcg-target.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/emulators/virtualbox-ose/files/extrapatch-src_recompiler_tcg_i386_tcg-target.h Mon Sep 25 21:39:29 2017 (r450636) @@ -0,0 +1,23 @@ +--- src/recompiler/tcg/i386/tcg-target.h.orig 2017-09-13 09:34:48 UTC ++++ src/recompiler/tcg/i386/tcg-target.h +@@ -120,12 +120,20 @@ enum { + + /* Note: must be synced with dyngen-exec.h */ + #if TCG_TARGET_REG_BITS == 64 ++# ifndef __clang__ + # define TCG_AREG0 TCG_REG_R14 ++# else /* __clang__ */ ++# define TCG_AREG0 TCG_REG_RBP ++# endif /* __clang__ */ + #else + # ifndef VBOX /* we're using ESI instead of EBP, probably due to frame pointer opt issues */ + # define TCG_AREG0 TCG_REG_EBP + # else /* VBOX */ ++# ifndef __clang__ + # define TCG_AREG0 TCG_REG_ESI ++# else /* __clang__ */ ++# define TCG_AREG0 TCG_REG_EBP ++# endif /* __clang__ */ + # endif /* VBOX */ + #endif +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709252139.v8PLdTCI068203>