Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Mar 2020 09:54:59 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r528771 - in head/sysutils/xen-tools: . files
Message-ID:  <202003200954.02K9sxrk044313@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger (src committer)
Date: Fri Mar 20 09:54:59 2020
New Revision: 528771
URL: https://svnweb.freebsd.org/changeset/ports/528771

Log:
  sysutils/xen-tools: fix build with clang 10.0
  
  Add upstream fix for clang 10.0 build.
  
  Sponsored by:		Citrix Systems R&D
  Approved by:		lwhsu
  Differential revision:	https://reviews.freebsd.org/D24097

Added:
  head/sysutils/xen-tools/files/
  head/sysutils/xen-tools/files/0001-libfsimage-fix-clang-10-build.patch   (contents, props changed)
Modified:
  head/sysutils/xen-tools/Makefile

Modified: head/sysutils/xen-tools/Makefile
==============================================================================
--- head/sysutils/xen-tools/Makefile	Fri Mar 20 09:36:06 2020	(r528770)
+++ head/sysutils/xen-tools/Makefile	Fri Mar 20 09:54:59 2020	(r528771)
@@ -3,7 +3,7 @@
 PORTNAME=	xen
 PKGNAMESUFFIX=	-tools
 PORTVERSION=	4.13.0
-PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	sysutils emulators
 MASTER_SITES=	http://downloads.xenproject.org/release/xen/${PORTVERSION}/
 
@@ -55,6 +55,9 @@ ALL_TARGET=		tools
 DOCS_ALL_TARGET=	docs
 INSTALL_TARGET=		install-tools
 DOCS_INSTALL_TARGET=	install-docs
+
+# Fix build with clang 10.0 (re convert enum constant to boolean)
+EXTRA_PATCHES+= ${PATCHDIR}/0001-libfsimage-fix-clang-10-build.patch
 
 .include <bsd.port.options.mk>
 

Added: head/sysutils/xen-tools/files/0001-libfsimage-fix-clang-10-build.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xen-tools/files/0001-libfsimage-fix-clang-10-build.patch	Fri Mar 20 09:54:59 2020	(r528771)
@@ -0,0 +1,52 @@
+From e54c433adf01a242bf6e9fe9378a2c83d3f8b419 Mon Sep 17 00:00:00 2001
+From: Roger Pau Monne <roger.pau@citrix.com>
+Date: Fri, 13 Mar 2020 09:45:57 +0100
+Subject: [PATCH] libfsimage: fix clang 10 build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+clang complains with:
+
+fsys_zfs.c:826:2: error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]
+        VERIFY_DN_TYPE(dn, DMU_OT_PLAIN_FILE_CONTENTS);
+        ^
+/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.13.0/tools/libfsimage/zfs/../../../tools/libfsimage/zfs/fsys_zfs.h:74:11: note: expanded from macro 'VERIFY_DN_TYPE'
+        if (type && (dnp)->dn_type != type) { \
+                 ^
+1 error generated.
+
+Fix this by not forcing an implicit conversion of the enum into a
+boolean and instead comparing with the 0 enumerator.
+
+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
+Acked-by: Wei Liu <wl@xen.org>
+---
+ tools/libfsimage/zfs/fsys_zfs.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/libfsimage/zfs/fsys_zfs.h b/tools/libfsimage/zfs/fsys_zfs.h
+index 5cd627dbac..721972a05a 100644
+--- a/tools/libfsimage/zfs/fsys_zfs.h
++++ b/tools/libfsimage/zfs/fsys_zfs.h
+@@ -71,7 +71,7 @@ typedef	unsigned int size_t;
+  * Can only be used in functions returning non-0 for failure.
+  */
+ #define	VERIFY_DN_TYPE(dnp, type) \
+-	if (type && (dnp)->dn_type != type) { \
++	if (type != DMU_OT_NONE && (dnp)->dn_type != type) { \
+ 		return (ERR_FSYS_CORRUPT); \
+ 	}
+ 
+@@ -80,7 +80,7 @@ typedef	unsigned int size_t;
+  * Can only be used in functions returning 0 for failure.
+  */
+ #define	VERIFY_OS_TYPE(osp, type) \
+-	if (type && (osp)->os_type != type) { \
++	if (type != DMU_OST_NONE && (osp)->os_type != type) { \
+ 		errnum = ERR_FSYS_CORRUPT; \
+ 		return (0); \
+ 	}
+-- 
+2.25.0
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003200954.02K9sxrk044313>