Bug 188744

Summary: emulators/open-vm-tools clang fix
Product: Ports & Packages Reporter: Alfred Perlstein <alfred>
Component: Individual Port(s)Assignee: Steve Wills <swills>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Alfred Perlstein freebsd_committer freebsd_triage 2014-04-18 04:40:00 UTC
Port breaks due to -Werror + stricter clang.

Fix: commit 982245204ec2a4016f432539eed77762021ffdca
Author: Alfred Perlstein <ap@norse-corp.com>
Date:   Thu Apr 17 19:28:28 2014 +0000

    Fix more pedantic warns with new clang.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-04-18 04:40:04 UTC
Responsible Changed
From-To: freebsd-ports-bugs->swills

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-04-25 16:39:51 UTC
Author: swills
Date: Fri Apr 25 15:39:46 2014
New Revision: 352137
URL: http://svnweb.freebsd.org/changeset/ports/352137
QAT: https://qat.redports.org/buildarchive/r352137/

Log:
  - Fix build on 11-CURRENT by patching:
    modules/freebsd/vmhgfs/channel.h [2] [3]
    libvmtools/i18n.c [2]
    modules/freebsd/vmmemctl/os.c [4]
  
  PR:		ports/187426 [1]
  PR:		ports/188744 [2]
  Submitted by:	alfred [2]
  Submitted by:	garga [3]
  Submitted by:	bdrewery [4]

Added:
  head/emulators/open-vm-tools/files/patch-libvmtools__i18n.c   (contents, props changed)
  head/emulators/open-vm-tools/files/patch-modules__freebsd__vmhgfs__channel.h   (contents, props changed)
  head/emulators/open-vm-tools/files/patch-modules__freebsd__vmxnet__if_vxn.c
     - copied, changed from r352082, head/emulators/open-vm-tools/files/patch-if_vxn.c
Deleted:
  head/emulators/open-vm-tools/files/patch-if_vxn.c
Modified:
  head/emulators/open-vm-tools/Makefile
  head/emulators/open-vm-tools/files/patch-configure
  head/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c
  head/emulators/open-vm-tools/files/patch-vmmemctl-os.c
  head/emulators/open-vm-tools/pkg-plist

Modified: head/emulators/open-vm-tools/Makefile
==============================================================================
--- head/emulators/open-vm-tools/Makefile	Fri Apr 25 15:28:13 2014	(r352136)
+++ head/emulators/open-vm-tools/Makefile	Fri Apr 25 15:39:46 2014	(r352137)
@@ -3,7 +3,7 @@
 
 PORTNAME=		open-vm-tools
 PORTVERSION=		${BUILD_VER}
-PORTREVISION=		4
+PORTREVISION=		5
 PORTEPOCH=		1
 CATEGORIES=		emulators
 MASTER_SITES=		SF/${PORTNAME}/${PORTNAME}/stable-9.4.x
@@ -46,7 +46,6 @@ USES=			pkgconfig kmod
 USE_GNOME=		glib20
 USE_LDCONFIG=		yes
 CPPFLAGS+=		-Wno-deprecated-declarations
-KMODDIR=		${PREFIX}/lib/vmware-tools/modules/drivers
 
 SSP_UNSAFE=		kernel module does not support ssp
 

Modified: head/emulators/open-vm-tools/files/patch-configure
==============================================================================
--- head/emulators/open-vm-tools/files/patch-configure	Fri Apr 25 15:28:13 2014	(r352136)
+++ head/emulators/open-vm-tools/files/patch-configure	Fri Apr 25 15:39:46 2014	(r352137)
@@ -1,5 +1,5 @@
 --- ./configure.orig	2013-09-23 15:51:43.000000000 +0000
-+++ ./configure	2013-11-17 22:40:51.197285671 +0000
++++ ./configure	2014-04-23 15:36:44.174844399 +0000
 @@ -2823,6 +2823,9 @@
     x86_64)
        userSpaceBitness="64"
@@ -29,3 +29,12 @@
  
  ac_fn_c_check_header_mongrel "$LINENO" "wchar.h" "ac_cv_header_wchar_h" "$ac_includes_default"
  if test "x$ac_cv_header_wchar_h" = xyes; then :
+@@ -22238,7 +22229,7 @@
+ 
+ ### General flags / actions
+ CFLAGS="$CFLAGS -Wall"
+-CFLAGS="$CFLAGS -Werror"
++CFLAGS="$CFLAGS -Werror -Wno-unused-function"
+ 
+ # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris.
+ for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \

Modified: head/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c
==============================================================================
--- head/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c	Fri Apr 25 15:28:13 2014	(r352136)
+++ head/emulators/open-vm-tools/files/patch-lib__vmCheck__vmcheck.c	Fri Apr 25 15:39:46 2014	(r352137)
@@ -1,5 +1,5 @@
---- lib/vmCheck/vmcheck.c.orig	2013-09-23 08:51:10.000000000 -0700
-+++ lib/vmCheck/vmcheck.c	2014-01-27 20:58:46.000000000 -0800
+--- ./lib/vmCheck/vmcheck.c.orig	2013-09-23 15:51:10.000000000 +0000
++++ ./lib/vmCheck/vmcheck.c	2014-04-23 15:36:44.323843725 +0000
 @@ -134,6 +134,7 @@
  #else
     do {

Added: head/emulators/open-vm-tools/files/patch-libvmtools__i18n.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/open-vm-tools/files/patch-libvmtools__i18n.c	Fri Apr 25 15:39:46 2014	(r352137)
@@ -0,0 +1,18 @@
+--- libvmtools/i18n.c.orig	2014-04-17 19:02:44.102203216 +0000
++++ libvmtools/i18n.c	2014-04-17 19:08:48.881598972 +0000
+@@ -88,6 +88,7 @@
+ }
+ 
+ 
++#ifdef BUG_ON
+ /*
+  ******************************************************************************
+  * MsgHasMsgID --                                                       */ /**
+@@ -112,6 +113,7 @@
+           *(s += MSG_MAGIC_LEN) == '(' &&
+           strchr(s + 1, ')') != NULL;
+ }
++#endif
+ 
+ 
+ /*

Added: head/emulators/open-vm-tools/files/patch-modules__freebsd__vmhgfs__channel.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/open-vm-tools/files/patch-modules__freebsd__vmhgfs__channel.h	Fri Apr 25 15:39:46 2014	(r352137)
@@ -0,0 +1,11 @@
+--- modules/freebsd/vmhgfs/channel.h.orig	2014-04-23 15:36:34.432844311 +0000
++++ modules/freebsd/vmhgfs/channel.h	2014-04-23 15:36:44.389843756 +0000
+@@ -21,7 +21,7 @@
+  */
+ 
+ #ifndef _HGFS_CHANNEL_H_
+-#define _HGFS_CHANNEL__H_
++#define _HGFS_CHANNEL_H_
+ 
+ #include "hgfs_kernel.h"
+ #include "requestInt.h"

Copied and modified: head/emulators/open-vm-tools/files/patch-modules__freebsd__vmxnet__if_vxn.c (from r352082, head/emulators/open-vm-tools/files/patch-if_vxn.c)
==============================================================================
--- head/emulators/open-vm-tools/files/patch-if_vxn.c	Fri Apr 25 00:42:58 2014	(r352082, copy source)
+++ head/emulators/open-vm-tools/files/patch-modules__freebsd__vmxnet__if_vxn.c	Fri Apr 25 15:39:46 2014	(r352137)
@@ -1,5 +1,5 @@
---- modules/freebsd/vmxnet/if_vxn.c.orig	2013-11-16 03:47:08.000000000 +0000
-+++ modules/freebsd/vmxnet/if_vxn.c	2013-11-16 03:51:10.000000000 +0000
+--- ./modules/freebsd/vmxnet/if_vxn.c.orig	2013-09-23 15:51:10.000000000 +0000
++++ ./modules/freebsd/vmxnet/if_vxn.c	2014-04-23 15:36:44.347844739 +0000
 @@ -76,6 +76,10 @@
  #include <pci/pcivar.h>
  #endif
@@ -11,3 +11,45 @@
  /* define INLINE the way gcc likes it */
  #define INLINE __inline__
  
+@@ -936,14 +940,14 @@
+    if (m != NULL) {
+       struct mbuf    *m_new = NULL;
+ 
+-      MGETHDR(m_new, M_DONTWAIT, MT_DATA);
++      MGETHDR(m_new, M_NOWAIT, MT_DATA);
+       if (m_new == NULL) {
+          printf("vxn%d: no memory for tx list\n", VXN_IF_UNIT(ifp));
+          return 1;
+       }
+ 
+       if (m_head->m_pkthdr.len > MHLEN) {
+-         MCLGET(m_new, M_DONTWAIT);
++         MCLGET(m_new, M_NOWAIT);
+          if (!(m_new->m_flags & M_EXT)) {
+             m_freem(m_new);
+             printf("vxn%d: no memory for tx list\n", VXN_IF_UNIT(ifp));
+@@ -1266,9 +1270,9 @@
+          /*
+ 	  * Allocate a new mbuf cluster to replace the current one
+           */
+-         MGETHDR(m_new, M_DONTWAIT, MT_DATA);
++         MGETHDR(m_new, M_NOWAIT, MT_DATA);
+          if (m_new != NULL) {
+-            MCLGET(m_new, M_DONTWAIT);
++            MCLGET(m_new, M_NOWAIT);
+             if (m_new->m_flags & M_EXT) {
+                m_adj(m_new, ETHER_ALIGN);
+             } else {
+@@ -1401,10 +1405,10 @@
+        * Allocate an mbuf and initialize it to contain a packet header and
+        * internal data.
+        */
+-      MGETHDR(m_new, M_DONTWAIT, MT_DATA);
++      MGETHDR(m_new, M_NOWAIT, MT_DATA);
+       if (m_new != NULL) {
+          /* Allocate and attach an mbuf cluster to mbuf. */
+-         MCLGET(m_new, M_DONTWAIT);
++         MCLGET(m_new, M_NOWAIT);
+          if (m_new->m_flags & M_EXT) {
+             m_adj(m_new, ETHER_ALIGN);
+             sc->vxn_rx_ring[i].paddr = (uint32)vtophys(mtod(m_new, caddr_t));

Modified: head/emulators/open-vm-tools/files/patch-vmmemctl-os.c
==============================================================================
--- head/emulators/open-vm-tools/files/patch-vmmemctl-os.c	Fri Apr 25 15:28:13 2014	(r352136)
+++ head/emulators/open-vm-tools/files/patch-vmmemctl-os.c	Fri Apr 25 15:39:46 2014	(r352137)
@@ -1,5 +1,5 @@
---- modules/freebsd/vmmemctl/os.c.orig	2013-09-23 15:51:10.000000000 +0000
-+++ modules/freebsd/vmmemctl/os.c	2013-11-16 19:55:06.152925027 +0000
+--- modules/freebsd/vmmemctl/os.c.orig	2013-09-23 10:51:10.000000000 -0500
++++ modules/freebsd/vmmemctl/os.c	2014-04-23 15:51:43.823041178 -0500
 @@ -37,9 +37,11 @@
  #include <sys/param.h>
  #include <sys/systm.h>
@@ -12,7 +12,19 @@
  #include <sys/sysctl.h>
  
  #include <vm/vm.h>
-@@ -295,7 +297,13 @@
+@@ -223,7 +225,11 @@ static __inline__ unsigned long os_ffz(u
+ unsigned long
+ OS_ReservedPageGetLimit(void)
+ {
++#if __FreeBSD_version < 1100015
+    return cnt.v_page_count;
++#else
++   return vm_cnt.v_page_count;
++#endif
+ }
+ 
+ 
+@@ -295,7 +301,13 @@ OS_ReservedPageGetHandle(PA64 pa)     //
  Mapping
  OS_MapPageHandle(PageHandle handle)     // IN
  {
@@ -26,7 +38,7 @@
     vm_page_t page = (vm_page_t)handle;
  
     if (!res) {
-@@ -352,7 +360,11 @@
+@@ -352,7 +364,11 @@ void
  OS_UnmapPage(Mapping mapping)           // IN
  {
     pmap_qremove((vm_offset_t)mapping, 1);
@@ -38,7 +50,19 @@
  }
  
  
-@@ -369,14 +381,23 @@
+@@ -360,7 +376,11 @@ static void
+ os_pmap_alloc(os_pmap *p) // IN
+ {
+    /* number of pages (div. 8) */
++#if __FreeBSD_version < 1100015
+    p->size = (cnt.v_page_count + 7) / 8;
++#else
++   p->size = (vm_cnt.v_page_count + 7) / 8;
++#endif
+ 
+    /*
+     * expand to nearest word boundary 
+@@ -369,14 +389,23 @@ os_pmap_alloc(os_pmap *p) // IN
     p->size = (p->size + sizeof(unsigned long) - 1) & 
                           ~(sizeof(unsigned long) - 1);
  
@@ -62,7 +86,7 @@
     p->size = 0;
     p->bitmap = NULL;
  }
-@@ -449,12 +470,31 @@
+@@ -449,12 +478,31 @@ os_kmem_free(vm_page_t page) // IN
     os_state *state = &global_state;
     os_pmap *pmap = &state->pmap;
  
@@ -99,7 +123,7 @@
  }
  
  
-@@ -466,8 +506,19 @@
+@@ -466,8 +514,19 @@ os_kmem_alloc(int alloc_normal_failed) /
     os_state *state = &global_state;
     os_pmap *pmap = &state->pmap;
  
@@ -119,7 +143,7 @@
        return NULL;
     }
  
-@@ -488,6 +539,11 @@
+@@ -488,6 +547,11 @@ os_kmem_alloc(int alloc_normal_failed) /
     if (!page) {
        os_pmap_putindex(pmap, pindex);
     }

Modified: head/emulators/open-vm-tools/pkg-plist
==============================================================================
--- head/emulators/open-vm-tools/pkg-plist	Fri Apr 25 15:28:13 2014	(r352136)
+++ head/emulators/open-vm-tools/pkg-plist	Fri Apr 25 15:39:46 2014	(r352137)
@@ -16,6 +16,7 @@ lib/open-vm-tools/plugins/common/libvix.
 %%X11%%lib/open-vm-tools/plugins/vmusr/libresolutionSet.so
 %%X11%%lib/open-vm-tools/plugins/vmusr/libdesktopEvents.so
 %%X11%%lib/open-vm-tools/plugins/vmusr/libdndcp.so
+%%X11%%etc/xdg/autostart/vmware-user.desktop
 lib/libhgfs.a
 lib/libhgfs.la
 lib/libhgfs.so
@@ -58,13 +59,13 @@ share/vmware-tools/scripts/vmware/networ
 @unexec if test -f %D/share/vmware-tools/tools.conf; then rm -f %D/share/vmware-tools/tools.conf; fi
 @unexec if test -h %D/etc/vmware-tools/plugins; then rm -f %D/etc/vmware-tools/plugins; fi
 etc/pam.d/vmtoolsd
+@dirrmtry lib/vmware-tools/modules/drivers
 @dirrmtry lib/vmware-tools/modules/input
 @dirrmtry lib/vmware-tools/modules
 @dirrmtry lib/vmware-tools
 @dirrmtry share/vmware-tools/scripts/vmware
 @dirrmtry share/vmware-tools/scripts
 @dirrmtry share/vmware-tools
-@dirrmtry libdata/pkgconfig
 @dirrm lib/open-vm-tools/plugins/common
 @dirrm lib/open-vm-tools/plugins/vmsvc
 %%X11%%@dirrm lib/open-vm-tools/plugins/vmusr
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Steve Wills freebsd_committer freebsd_triage 2014-04-25 16:40:04 UTC
State Changed
From-To: open->closed

Committed. Thanks!