1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-26 09:46:09 +00:00

- Fix build with clang and recent kernel API changes.

- Use new style LIB_DEPENDS.

PR:		173038, 174290, 180499
Submitted by:	Garrett Cooper <yaneurabeya@gmail.com>
Approved by:	swills (maintainer)
This commit is contained in:
Tijl Coosemans 2013-10-19 14:39:55 +00:00
parent 17bdf0efb5
commit cfea1fe89d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=330878
10 changed files with 209 additions and 17 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= open-vm-tools
PORTVERSION= ${BUILD_VER}
PORTREVISION= 3
PORTREVISION= 4
PORTEPOCH= 1
CATEGORIES= emulators kld
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/stable-8.6.x
@ -21,6 +21,7 @@ BUILD_VER= 425873
WRKSRC= ${WRKDIR}/open-vm-tools-${RELEASE_VER}-${BUILD_VER}
GNU_CONFIGURE= yes
USES= pkgconfig
USE_GNOME= glib20
USE_LDCONFIG= yes
CPPFLAGS+= -Wno-deprecated-declarations
@ -28,26 +29,24 @@ SSP_UNSAFE= kernel module does not support ssp
CONFIGURE_ARGS+= --without-procps --sysconfdir=${LOCALBASE}/etc
.if defined(WITHOUT_X11)
LIB_DEPENDS+= glib-2.0:${PORTSDIR}/devel/glib20
CONFIGURE_ARGS+= --without-x --without-gtk2 --without-gtkmm
PLIST_SUB+= X11="@comment "
CONFLICTS= open-vm-tools-[0-9]*
.else
.if !defined(WITHOUT_LIBNOTIFY)
LIB_DEPENDS+= notify.4:${PORTSDIR}/devel/libnotify
LIB_DEPENDS+= libnotify.so:${PORTSDIR}/devel/libnotify
.endif
.if defined(WITH_UNITY)
CONFIGURE_ENV+= CUSTOM_URIPARSER_CPPFLAGS="-I${LOCALBASE}/include/uriparser"
LIB_DEPENDS+= uriparser.1:${PORTSDIR}/net/uriparser
LIB_DEPENDS+= liburiparser.so:${PORTSDIR}/net/uriparser
.else
CONFIGURE_ARGS+= --disable-unity
.endif
LIB_DEPENDS+= gtkmm-2.4:${PORTSDIR}/x11-toolkits/gtkmm24
CONFIGURE_ARGS+= --with-x
LDFLAGS+= -L${LOCALBASE}/lib
USE_XORG= x11 ice sm xext xineramaproto xinerama xrandr xrender \
xtst
USE_GNOME= gtk20 glib20
USE_GNOME+= gtk20 gtkmm24
PLIST_SUB+= X11=""
CONFLICTS= open-vm-tools-nox11-[0-9]*
.endif
@ -65,13 +64,13 @@ SUB_FILES= pkg-message
.if defined(WITHOUT_DNET)
CONFIGURE_ARGS+= --without-dnet
.else
LIB_DEPENDS+= dnet:${PORTSDIR}/net/libdnet
LIB_DEPENDS+= libdnet.so:${PORTSDIR}/net/libdnet
.endif
.if defined(WITHOUT_ICU)
CONFIGURE_ARGS+= --without-icu
.else
LIB_DEPENDS+= icuuc:${PORTSDIR}/devel/icu
LIB_DEPENDS+= libicuuc.so:${PORTSDIR}/devel/icu
.endif
USE_RC_SUBR= vmware-guestd vmware-kmod

View File

@ -0,0 +1,47 @@
--- checkvm/checkvm.c.orig
+++ checkvm/checkvm.c
@@ -56,7 +56,7 @@
uint32 val
)
{
- __asm__ volatile("out%L0 (%%dx)" : :"a" (val), "d" (port));
+ __asm__ volatile("outl %%eax, %%dx" : :"a" (val), "d" (port));
}
static __inline__ uint32
@@ -66,7 +66,7 @@
{
uint32 ret;
- __asm__ volatile("in%L0 (%%dx)" : "=a" (ret) : "d" (port));
+ __asm__ volatile("inl %%dx, %%eax" : "=a" (ret) : "d" (port));
return ret;
}
@@ -79,7 +79,7 @@
{
uint32 eax, ebx, ecx, edx;
- __asm__ volatile("inl (%%dx)" :
+ __asm__ volatile("inl %%dx, %%eax" :
"=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETVERSION),
"2"(BDOOR_PORT) : "memory");
@@ -96,7 +96,7 @@
{
uint32 eax, ebx, ecx, edx;
- __asm__ volatile("inl (%%dx)" :
+ __asm__ volatile("inl %%dx, %%eax" :
"=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETHWVERSION),
"2"(BDOOR_PORT) : "memory");
@@ -112,7 +112,7 @@
{
uint32 eax, ebx, ecx, edx;
- __asm__ volatile("inl (%%dx)" :
+ __asm__ volatile("inl %%dx, %%eax" :
"=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :
"0"(BDOOR_MAGIC), "1"(BDOOR_CMD_GETSCREENSIZE),
"2"(BDOOR_PORT) : "memory");

View File

@ -0,0 +1,11 @@
--- services/plugins/dndcp/dnd/dndLinux.c.orig
+++ services/plugins/dndcp/dnd/dndLinux.c
@@ -455,7 +455,7 @@
DnD_CheckBlockFuse(int blockFd) // IN
{
char buf[sizeof(VMBLOCK_FUSE_READ_RESPONSE)];
- size_t size;
+ ssize_t size;
size = read(blockFd, buf, sizeof(VMBLOCK_FUSE_READ_RESPONSE));
if (size < 0) {

View File

@ -0,0 +1,22 @@
--- lib/include/hgfsProto.h.orig
+++ lib/include/hgfsProto.h
@@ -148,6 +148,9 @@
HGFS_OP_SET_EAS_V4, /* Add or modify extended attributes. */
HGFS_OP_MAX, /* Dummy op, must be last in enum */
+
+/* If a V4 packet is being processed as a legacy packet it will have this opcode. */
+ HGFS_V4_LEGACY_OPCODE = 0xff,
} HgfsOp;
@@ -155,9 +158,6 @@
#define HGFS_VERSION_OLD (1 << 0)
#define HGFS_VERSION_3 (1 << 1)
-/* If a V4 packet is being processed as a legacy packet it will have this opcode. */
-#define HGFS_V4_LEGACY_OPCODE 0xff
-
/* XXX: Needs change when VMCI is supported. */
#define HGFS_REQ_PAYLOAD_SIZE_V3(hgfsReq) (sizeof *hgfsReq + sizeof(HgfsRequest))
#define HGFS_REP_PAYLOAD_SIZE_V3(hgfsRep) (sizeof *hgfsRep + sizeof(HgfsReply))

View File

@ -0,0 +1,11 @@
--- lib/hgfsServer/hgfsServer.c.orig
+++ lib/hgfsServer/hgfsServer.c
@@ -3557,7 +3557,7 @@
* delimiter on copy. Allow 0 length drives so that hidden feature "" can
* work.
*/
- if (pathLength < 0 || pathLength >= sizeof p.mountPoint) {
+ if (pathLength >= sizeof p.mountPoint) {
LOG(4, ("%s: could not get the volume name\n", __FUNCTION__));
return FALSE;

View File

@ -0,0 +1,11 @@
--- lib/hgfsServer/hgfsServerLinux.c.orig
+++ lib/hgfsServer/hgfsServerLinux.c
@@ -551,7 +551,7 @@
arraySize = ARRAYSIZE(HgfsServerOpenFlags);
- if (flagsIn < 0 || flagsIn >= arraySize) {
+ if (flagsIn >= arraySize) {
Log("%s: Invalid HgfsOpenFlags %d\n", __FUNCTION__, flagsIn);
return FALSE;

View File

@ -0,0 +1,11 @@
--- modules/freebsd/vmblock/vfsops.c.orig
+++ modules/freebsd/vmblock/vfsops.c
@@ -236,7 +236,7 @@
*/
MNT_ILOCK(mp);
mp->mnt_flag |= lowerrootvp->v_mount->mnt_flag & MNT_LOCAL;
-#if __FreeBSD_version >= 600000
+#if __FreeBSD_version >= 600000 && __FreeBSD_version < 1000021
mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & MNTK_MPSAFE;
#endif
MNT_IUNLOCK(mp);

View File

@ -0,0 +1,11 @@
--- modules/freebsd/vmhgfs/os.c.orig
+++ modules/freebsd/vmhgfs/os.c
@@ -647,7 +647,7 @@
OS_THREAD_T *newThread) // OUT
{
return compat_kthread_create(function, parameter,
- newThread, 0, 0, threadName);
+ newThread, 0, 0, "%s", threadName);
}

View File

@ -0,0 +1,12 @@
--- modules/freebsd/vmhgfs/vfsops.c.orig
+++ modules/freebsd/vmhgfs/vfsops.c
@@ -201,7 +201,9 @@
* structures, not oplocks/leases with the VM's host.)
*/
+#if __FreeBSD_version < 1000021
MNT_ILOCK(mp);
mp->mnt_kern_flag |= MNTK_MPSAFE;
MNT_IUNLOCK(mp);
+#endif
/* Get a new unique filesystem ID */

View File

@ -1,12 +1,56 @@
--- modules/freebsd/vmmemctl/os.c.orig 2011-09-21 14:25:15.000000000 -0400
+++ modules/freebsd/vmmemctl/os.c 2012-06-20 09:44:40.434083000 -0400
@@ -344,12 +344,22 @@
--- modules/freebsd/vmmemctl/os.c.orig 2011-09-21 20:25:15.000000000 +0200
+++ modules/freebsd/vmmemctl/os.c 2013-10-19 11:01:27.000000000 +0200
@@ -37,9 +37,11 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/conf.h>
+#include <sys/rwlock.h>
#include <sys/sysctl.h>
#include <vm/vm.h>
@@ -264,14 +266,23 @@
p->size = (p->size + sizeof(unsigned long) - 1) &
~(sizeof(unsigned long) - 1);
+#if __FreeBSD_version >= 1000042
+ p->bitmap = (unsigned long *)kmem_malloc(kernel_arena, p->size,
+ M_WAITOK | M_ZERO);
+#else
p->bitmap = (unsigned long *)kmem_alloc(kernel_map, p->size);
+#endif
}
static void
os_pmap_free(os_pmap *p) // IN
{
+#if __FreeBSD_version >= 1000042
+ kmem_free(kernel_arena, (vm_offset_t)p->bitmap, p->size);
+#else
kmem_free(kernel_map, (vm_offset_t)p->bitmap, p->size);
+#endif
p->size = 0;
p->bitmap = NULL;
}
@@ -344,12 +355,31 @@
os_state *state = &global_state;
os_pmap *pmap = &state->pmap;
- if ( !vm_page_lookup(state->vmobject, page->pindex) ) {
- return;
- }
- os_pmap_putindex(pmap, page->pindex);
- vm_page_free(page);
+#if __FreeBSD_version > 1000029
+ VM_OBJECT_WLOCK(state->vmobject);
+#else
+ VM_OBJECT_LOCK(state->vmobject);
+#endif
+ if ( vm_page_lookup(state->vmobject, page->pindex) ) {
+ os_pmap_putindex(pmap, page->pindex);
+#if __FreeBSD_version >= 900000
@ -20,31 +64,44 @@
+#else
+ vm_page_unlock_queues();
+#endif
}
-
- os_pmap_putindex(pmap, page->pindex);
- vm_page_free(page);
+ }
+#if __FreeBSD_version > 1000029
+ VM_OBJECT_WUNLOCK(state->vmobject);
+#else
+ VM_OBJECT_UNLOCK(state->vmobject);
+#endif
}
@@ -361,8 +371,11 @@
@@ -361,8 +391,19 @@
os_state *state = &global_state;
os_pmap *pmap = &state->pmap;
+#if __FreeBSD_version > 1000029
+ VM_OBJECT_WLOCK(state->vmobject);
+#else
+ VM_OBJECT_LOCK(state->vmobject);
+#endif
+
pindex = os_pmap_getindex(pmap);
if (pindex == (vm_pindex_t)-1) {
+#if __FreeBSD_version > 1000029
+ VM_OBJECT_WUNLOCK(state->vmobject);
+#else
+ VM_OBJECT_UNLOCK(state->vmobject);
+#endif
return NULL;
}
@@ -383,6 +396,7 @@
@@ -383,6 +424,11 @@
if (!page) {
os_pmap_putindex(pmap, pindex);
}
+#if __FreeBSD_version > 1000029
+ VM_OBJECT_WUNLOCK(state->vmobject);
+#else
+ VM_OBJECT_UNLOCK(state->vmobject);
+#endif
return page;
}