tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

sysutils/xen* clang patches for review



Hi all,
can someone please review the attached changes? There are some minor
bugfixes that are unrelated to the compiler.

Joerg
Index: sysutils/xenkernel3/Makefile
==================================================================
--- sysutils/xenkernel3/Makefile
+++ sysutils/xenkernel3/Makefile
@@ -54,23 +54,33 @@
 
 INSTALLATION_DIRS+=    xen3-kernel
 XENKERNELDIR=          ${PREFIX}/xen3-kernel
 
 MESSAGE_SUBST+=                XENKERNELDIR=${XENKERNELDIR:Q}
+
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+EXTRA_CFLAGS+= -Wno-error=ignored-attributes -Wno-error=format \
+               -Wno-error=tautological-compare \
+               -Wno-error=parentheses-equality \
+               -Wno-error=sometimes-uninitialized -no-integrated-as \
+               -ffreestanding
+.endif
 
 do-build:
-       cd ${WRKSRC} && ${GMAKE} XEN_TARGET_X86_PAE=n debug=n xen
+       cd ${WRKSRC} && \
+           EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} XEN_TARGET_X86_PAE=n 
debug=n xen
        ${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen.gz
        cd ${WRKSRC} && ${GMAKE} clean && \
-           ${GMAKE} XEN_TARGET_X86_PAE=n debug=y xen
+           EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} XEN_TARGET_X86_PAE=n 
debug=y xen
        ${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen-debug.gz
 .if  ${MACHINE_ARCH} == "i386"
        cd ${WRKSRC} && ${GMAKE} clean && \
-           ${GMAKE} XEN_TARGET_X86_PAE=y debug=n xen
+           EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} XEN_TARGET_X86_PAE=y 
debug=n xen
        ${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen-PAE.gz
        cd ${WRKSRC} && ${GMAKE} clean && \
-           ${GMAKE} XEN_TARGET_X86_PAE=y debug=y xen
+           EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} XEN_TARGET_X86_PAE=y 
debug=y xen
        ${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen-PAE-debug.gz
 .endif
 
 do-install:
        ${INSTALL_DATA} ${WRKDIR}/xen.gz \

Index: sysutils/xenkernel3/distinfo
==================================================================
--- sysutils/xenkernel3/distinfo
+++ sysutils/xenkernel3/distinfo
@@ -9,10 +9,12 @@
 SHA1 (patch-ae) = 37b1c8d6cc66983d971fe41654cc8cefde87104a
 SHA1 (patch-ba) = cadfa6f2626e95c9ccb85ae7e3a8a7f318ea343f
 SHA1 (patch-bb) = 7338e5a512c909d4b043654dab882761de274f94
 SHA1 (patch-bc) = fa35699da6ad2a4950418a02432c2ccdb5d34844
 SHA1 (patch-bd) = 2a07955b1285d288458066813f8ebc801b8038c1
-SHA1 (patch-cw) = 83a0f34dac9ba9a465c7362d4de6706afb84d688
+SHA1 (patch-cw) = b08804b3a6df64194d662c92af1f0738a52e67b2
 SHA1 (patch-da) = 6db74e00d15615e71936fa8637a05159f378b454
 SHA1 (patch-db) = 8e7b563fd816669fd39e1e8bf5137b5937060968
 SHA1 (patch-dc) = 606ad2af582b88ddfd250b952831af9d3b2b1f5d
 SHA1 (patch-gcc-version) = 1174ace3eee1d3707a2935498ac5a39671913f9f
+SHA1 (patch-xen_arch_x86_hvm_io.c) = 0f6dfc3b3857c2ab43fabf2c9693e2932b442931
+SHA1 (patch-xen_arch_x86_string.c) = 363d521a627d07cd9caffcfe1c529342b3b67321

Index: sysutils/xenkernel3/patches/patch-cw
==================================================================
--- sysutils/xenkernel3/patches/patch-cw
+++ sysutils/xenkernel3/patches/patch-cw
@@ -10,5 +10,16 @@
 +                         -e s/ppc/powerpc/ -e s/i86pc/x86_32/ \
 +                         -e s/amd64/x86_64/)
  XEN_TARGET_ARCH     ?= $(XEN_COMPILE_ARCH)
  XEN_OS              ?= $(shell uname -s)
  
+@@ -72,8 +73,8 @@ CFLAGS += -Wall -Wstrict-prototypes
+ # result of any casted expression causes a warning.
+ CFLAGS += -Wno-unused-value
+ 
+-HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
+-CFLAGS     += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
++HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,) 
${EXTRA_CFLAGS}
++CFLAGS     += $(call cc-option,$(CC),-Wdeclaration-after-statement,) 
${EXTRA_CFLAGS}
+ 
+ LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
+ CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))

ADDED    sysutils/xenkernel3/patches/patch-xen_arch_x86_hvm_io.c
Index: sysutils/xenkernel3/patches/patch-xen_arch_x86_hvm_io.c
==================================================================
--- sysutils/xenkernel3/patches/patch-xen_arch_x86_hvm_io.c
+++ sysutils/xenkernel3/patches/patch-xen_arch_x86_hvm_io.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- xen/arch/x86/hvm/io.c.orig 2013-03-25 12:44:51.000000000 +0000
++++ xen/arch/x86/hvm/io.c
+@@ -338,7 +338,7 @@ static inline void set_eflags_OF(int siz
+ 
+     if ( instr == INSTR_ADD )
+     {
+-        if ((src ^ result) & (dst ^ result) & mask);
++        if ((src ^ result) & (dst ^ result) & mask)
+             regs->eflags |= X86_EFLAGS_OF;
+     }
+     else

ADDED    sysutils/xenkernel3/patches/patch-xen_arch_x86_string.c
Index: sysutils/xenkernel3/patches/patch-xen_arch_x86_string.c
==================================================================
--- sysutils/xenkernel3/patches/patch-xen_arch_x86_string.c
+++ sysutils/xenkernel3/patches/patch-xen_arch_x86_string.c
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- xen/arch/x86/string.c.orig 2013-03-25 12:54:07.000000000 +0000
++++ xen/arch/x86/string.c
+@@ -8,6 +8,21 @@
+ #include <xen/config.h>
+ #include <xen/lib.h>
+ 
++#undef memcmp
++int
++memcmp(const void *s1, const void *s2, size_t n)
++{
++      const unsigned char *p1 = s1;
++      const unsigned char *p2 = s2;
++      while (n-- != 0) {
++              if (*p1 != *p2)
++                      return *p1 - *p2;
++              ++p1;
++              ++p2;
++      }
++      return 0;
++}
++
+ #undef memcpy
+ void *memcpy(void *dest, const void *src, size_t n)
+ {

Index: sysutils/xenkernel33/Makefile
==================================================================
--- sysutils/xenkernel33/Makefile
+++ sysutils/xenkernel33/Makefile
@@ -44,15 +44,23 @@
 
 INSTALLATION_DIRS=     xen3-kernel
 XENKERNELDIR=          ${PREFIX}/${INSTALLATION_DIRS}
 
 MESSAGE_SUBST+=                XENKERNELDIR=${XENKERNELDIR:Q}
+
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+EXTRA_CFLAGS+= -Qunused-arguments -no-integrated-as -Wno-error=format \
+               -Wno-error=parentheses-equality -Wno-error=enum-conversion \
+               -Wno-error=tautological-compare
+.endif
 
 do-build:
-       cd ${WRKSRC} && ${GMAKE} debug=n xen
+       cd ${WRKSRC} && EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} debug=n xen
        ${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen.gz
-       cd ${WRKSRC} && ${GMAKE} clean && ${GMAKE} debug=y xen
+       cd ${WRKSRC} && ${GMAKE} clean
+       cd ${WRKSRC} && EXTRA_CFLAGS=${EXTRA_CFLAGS:Q} ${GMAKE} debug=y xen
        ${CP} ${WRKSRC}/dist/install/boot/xen.gz ${WRKDIR}/xen-debug.gz
 
 do-install:
        ${INSTALL_DATA} ${WRKDIR}/xen.gz \
            ${DESTDIR}${XENKERNELDIR}/xen.gz

Index: sysutils/xenkernel33/distinfo
==================================================================
--- sysutils/xenkernel33/distinfo
+++ sysutils/xenkernel33/distinfo
@@ -2,13 +2,16 @@
 
 SHA1 (xen-3.3.2.tar.gz) = 7f438e73ac81b25cf5e1570709e87001066bafe4
 RMD160 (xen-3.3.2.tar.gz) = 28faa56286f2a418e35dcba6079570ea871d6c7b
 Size (xen-3.3.2.tar.gz) = 11357576 bytes
 SHA1 (patch-CVE-2012-3432) = aed03164e9d05379c0a768bf29643c3e94eefce1
+SHA1 (patch-Config.mk) = a70e4e1f19d8a8f935a3f2b1b9d24e23e845b920
 SHA1 (patch-SA45835) = 7d27c26ba947354bb5e279f3add9eb073a151477
 SHA1 (patch-aa) = 0d11c758ad0a0ca657bf2e0f89ca23ff67b76bb7
 SHA1 (patch-ab) = bba70c6a0f884a4bbfd2ce56e41ce0d649300edc
 SHA1 (patch-ac) = ed1dc87e4f1d80112befc63372bc91ee621f57e6
 SHA1 (patch-ad) = e53ac3abf2a6a10c60cf288b994b3cf52a0d6486
 SHA1 (patch-ae) = 9608381987e82b05ea34e16f82b88189cc415653
 SHA1 (patch-compat_memory_c) = f45daded92c0dac30213d6d7dcc81ac72ead7c47
 SHA1 (patch-include_xen_compat_h) = 96ba96ba31792f48c989f033f7706f09fd1171c2
+SHA1 (patch-xen_Makefile) = 30d27b40fb8f5c4ee663a6a82abf36db3b7ebd1c
+SHA1 (patch-xen_arch_x86_Rules.mk) = 81bdc8a653b57b5fcb9ae7d835f0284ab800dc21

ADDED    sysutils/xenkernel33/patches/patch-Config.mk
Index: sysutils/xenkernel33/patches/patch-Config.mk
==================================================================
--- sysutils/xenkernel33/patches/patch-Config.mk
+++ sysutils/xenkernel33/patches/patch-Config.mk
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- Config.mk.orig     2009-08-06 13:17:07.000000000 +0000
++++ Config.mk
+@@ -16,6 +16,8 @@ SHELL     ?= /bin/sh
+ HOSTCC      = gcc
+ HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
++HOSTCFLAGS += ${EXTRA_CFLAGS}
++CFLAGS     += ${EXTRA_CFLAGS}
+ 
+ DISTDIR     ?= $(XEN_ROOT)/dist
+ DESTDIR     ?= /

ADDED    sysutils/xenkernel33/patches/patch-xen_Makefile
Index: sysutils/xenkernel33/patches/patch-xen_Makefile
==================================================================
--- sysutils/xenkernel33/patches/patch-xen_Makefile
+++ sysutils/xenkernel33/patches/patch-xen_Makefile
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- xen/Makefile.orig  2009-08-06 12:56:39.000000000 +0000
++++ xen/Makefile
+@@ -87,7 +87,7 @@ include/xen/compile.h: include/xen/compi
+           -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
+           -e 's/@@domain@@/$(XEN_DOMAIN)/g' \
+           -e 's/@@hostname@@/$(shell hostname)/g' \
+-          -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)!g' \
++          -e 's!@@compiler@@!$(shell $(CC) $(EXTRA_CFLAGS) $(CFLAGS) -v 2>&1 
| tail -1)!g' \
+           -e 's/@@version@@/$(XEN_VERSION)/g' \
+           -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
+           -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \

ADDED    sysutils/xenkernel33/patches/patch-xen_arch_x86_Rules.mk
Index: sysutils/xenkernel33/patches/patch-xen_arch_x86_Rules.mk
==================================================================
--- sysutils/xenkernel33/patches/patch-xen_arch_x86_Rules.mk
+++ sysutils/xenkernel33/patches/patch-xen_arch_x86_Rules.mk
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- xen/arch/x86/Rules.mk.orig 2009-08-06 12:56:40.000000000 +0000
++++ xen/arch/x86/Rules.mk
+@@ -21,6 +21,7 @@ CFLAGS += -iwithprefix include -Werror -
+ CFLAGS += -I$(BASEDIR)/include 
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
++CFLAGS += $(EXTRA_CFLAGS)
+ 
+ # Prevent floating-point variables from creeping into Xen.
+ CFLAGS += -msoft-float

Index: sysutils/xenkernel41/Makefile
==================================================================
--- sysutils/xenkernel41/Makefile
+++ sysutils/xenkernel41/Makefile
@@ -31,10 +31,18 @@
 INSTALLATION_DIRS=     xen41-kernel
 XENKERNELDIR=          ${PREFIX}/${INSTALLATION_DIRS}
 
 MESSAGE_SUBST+=                XENKERNELDIR=${XENKERNELDIR:Q}
 
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+EXTRA_CFLAGS+= -Qunused-arguments -no-integrated-as -Wno-error=format \
+               -Wno-error=parentheses-equality -Wno-error=enum-conversion
+.endif
+
+MAKE_ENV+=     EXTRA_CFLAGS=${EXTRA_CFLAGS:Q}
+
 do-build:
        cd ${WRKSRC}/xen && ${BUILD_MAKE_CMD} debug=n build
        ${CP} ${WRKSRC}/xen/xen.gz ${WRKDIR}/xen.gz
        cd ${WRKSRC}/xen && ${MAKE_PROGRAM} clean
        cd ${WRKSRC}/xen && ${BUILD_MAKE_CMD} debug=y build

Index: sysutils/xenkernel41/distinfo
==================================================================
--- sysutils/xenkernel41/distinfo
+++ sysutils/xenkernel41/distinfo
@@ -3,7 +3,12 @@
 SHA1 (xen-4.1.4.tar.gz) = d5f1e9c9eeb96202dd827c196750530ffc64baab
 RMD160 (xen-4.1.4.tar.gz) = e3cb379954c985354dfd7dfbed15eae43e73254d
 Size (xen-4.1.4.tar.gz) = 10387283 bytes
 SHA1 (patch-CVE-2012-5511_2) = a345d28d4a6dcc4bf203243f49d66b5479fdbf14
 SHA1 (patch-CVE-2012-5634) = 2992ee4972ec733a80fa3841d12a70a9076625c0
+SHA1 (patch-Config.mk) = a43ed1b3304d6383dc093acd128a7f373d0ca266
+SHA1 (patch-xen_Makefile) = d1c7e4860221f93d90818f45a77748882486f92b
+SHA1 (patch-xen_arch_x86_Rules.mk) = 6b9b4bfa28924f7d3f6c793a389f1a7ac9d228e2
+SHA1 (patch-xen_arch_x86_cpu_mcheck_vmce.c) = 
5afd01780a13654f1d21bf1562f6431c8370be0b
+SHA1 (patch-xen_arch_x86_time.c) = 2dedd8ea1d372ecffea70aad448756dd3688cfba
 SHA1 (patch-xen_drivers_char_console_c) = 
0fe186369602ccffaeec6f4bfbee8bb4298d3ff0
 SHA1 (patch-xen_include_xen_stdarg.h) = 
e9df974a9b783ed442ab17497198432cb9844b70

ADDED    sysutils/xenkernel41/patches/patch-Config.mk
Index: sysutils/xenkernel41/patches/patch-Config.mk
==================================================================
--- sysutils/xenkernel41/patches/patch-Config.mk
+++ sysutils/xenkernel41/patches/patch-Config.mk
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- Config.mk.orig     2012-12-18 12:54:16.000000000 +0000
++++ Config.mk
+@@ -16,6 +16,8 @@ SHELL     ?= /bin/sh
+ HOSTCC      = gcc
+ HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
++HOSTCFLAGS += ${EXTRA_CFLAGS}
++CFLAGS     += ${EXTRA_CFLAGS}
+ 
+ DISTDIR     ?= $(XEN_ROOT)/dist
+ DESTDIR     ?= /

ADDED    sysutils/xenkernel41/patches/patch-xen_Makefile
Index: sysutils/xenkernel41/patches/patch-xen_Makefile
==================================================================
--- sysutils/xenkernel41/patches/patch-xen_Makefile
+++ sysutils/xenkernel41/patches/patch-xen_Makefile
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- xen/Makefile.orig  2013-03-25 13:23:45.000000000 +0000
++++ xen/Makefile
+@@ -89,7 +89,7 @@ include/xen/compile.h: include/xen/compi
+           -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
+           -e 's/@@domain@@/$(XEN_DOMAIN)/g' \
+           -e 's/@@hostname@@/$(shell hostname)/g' \
+-          -e 's!@@compiler@@!$(shell $(CC) $(CFLAGS) -v 2>&1 | tail -1)!g' \
++          -e 's!@@compiler@@!$(shell $(CC) $(EXTRA_CFLAGS) $(CFLAGS) -v 2>&1 
| tail -1)!g' \
+           -e 's/@@version@@/$(XEN_VERSION)/g' \
+           -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
+           -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \

ADDED    sysutils/xenkernel41/patches/patch-xen_arch_x86_Rules.mk
Index: sysutils/xenkernel41/patches/patch-xen_arch_x86_Rules.mk
==================================================================
--- sysutils/xenkernel41/patches/patch-xen_arch_x86_Rules.mk
+++ sysutils/xenkernel41/patches/patch-xen_arch_x86_Rules.mk
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- xen/arch/x86/Rules.mk.orig 2013-03-25 13:28:19.000000000 +0000
++++ xen/arch/x86/Rules.mk
+@@ -21,6 +21,7 @@ CFLAGS += -iwithprefix include -Werror -
+ CFLAGS += -I$(BASEDIR)/include 
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
++CFLAGS += $(EXTRA_CFLAGS)
+ 
+ # Prevent floating-point variables from creeping into Xen.
+ CFLAGS += -msoft-float

ADDED    sysutils/xenkernel41/patches/patch-xen_arch_x86_cpu_mcheck_vmce.c
Index: sysutils/xenkernel41/patches/patch-xen_arch_x86_cpu_mcheck_vmce.c
==================================================================
--- sysutils/xenkernel41/patches/patch-xen_arch_x86_cpu_mcheck_vmce.c
+++ sysutils/xenkernel41/patches/patch-xen_arch_x86_cpu_mcheck_vmce.c
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- xen/arch/x86/cpu/mcheck/vmce.c.orig        2013-03-25 13:46:53.000000000 
+0000
++++ xen/arch/x86/cpu/mcheck/vmce.c
+@@ -39,7 +39,7 @@ int vmce_init_msr(struct domain *d)
+         return -ENOMEM;
+     }
+     memset(dom_vmce(d)->mci_ctl, ~0,
+-           sizeof(dom_vmce(d)->mci_ctl));
++           sizeof(*dom_vmce(d)->mci_ctl));
+ 
+     dom_vmce(d)->mcg_status = 0x0;
+     dom_vmce(d)->mcg_cap = g_mcg_cap;
+@@ -369,7 +369,7 @@ static struct bank_entry* alloc_bank_ent
+         return NULL;
+     }
+ 
+-    memset(entry, 0x0, sizeof(entry));
++    memset(entry, 0x0, sizeof(*entry));
+     INIT_LIST_HEAD(&entry->list);
+     return entry;
+ }
+@@ -451,7 +451,7 @@ int vmce_init(struct cpuinfo_x86 *c)
+             return -ENOMEM;
+         }
+         /* Don't care banks before firstbank */
+-        memset(h_mci_ctrl, 0xff, sizeof(h_mci_ctrl));
++        memset(h_mci_ctrl, 0xff, sizeof(*h_mci_ctrl));
+         for (i = firstbank; i < nr_mce_banks; i++)
+             rdmsrl(MSR_IA32_MCx_CTL(i), h_mci_ctrl[i]);
+     }

ADDED    sysutils/xenkernel41/patches/patch-xen_arch_x86_time.c
Index: sysutils/xenkernel41/patches/patch-xen_arch_x86_time.c
==================================================================
--- sysutils/xenkernel41/patches/patch-xen_arch_x86_time.c
+++ sysutils/xenkernel41/patches/patch-xen_arch_x86_time.c
@@ -0,0 +1,35 @@
+$NetBSD$
+
+--- xen/arch/x86/time.c.orig   2013-03-25 14:01:22.000000000 +0000
++++ xen/arch/x86/time.c
+@@ -105,7 +105,7 @@ static inline u32 mul_frac(u32 multiplic
+ {
+     u32 product_int, product_frac;
+     asm (
+-        "mul %3"
++        "mull %3"
+         : "=a" (product_frac), "=d" (product_int)
+         : "0" (multiplicand), "r" (multiplier) );
+     return product_int;
+@@ -129,10 +129,10 @@ static inline u64 scale_delta(u64 delta,
+ 
+ #ifdef CONFIG_X86_32
+     asm (
+-        "mul  %5       ; "
++        "mull  %5       ; "
+         "mov  %4,%%eax ; "
+         "mov  %%edx,%4 ; "
+-        "mul  %5       ; "
++        "mull  %5       ; "
+         "xor  %5,%5    ; "
+         "add  %4,%%eax ; "
+         "adc  %5,%%edx ; "
+@@ -140,7 +140,7 @@ static inline u64 scale_delta(u64 delta,
+         : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (scale->mul_frac) );
+ #else
+     asm (
+-        "mul %2 ; shrd $32,%1,%0"
++        "mulq %2 ; shrd $32,%1,%0"
+         : "=a" (product), "=d" (delta)
+         : "rm" (delta), "0" ((u64)scale->mul_frac) );
+ #endif

Index: sysutils/xentools3-hvm/Makefile
==================================================================
--- sysutils/xentools3-hvm/Makefile
+++ sysutils/xentools3-hvm/Makefile
@@ -76,10 +76,20 @@
 
 OWN_DIRS=              ${PKG_SYSCONFDIR}/scripts
 
 INSTALLATION_DIRS=     ${EGDIR}
 
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+EXTRA_HOSTCFLAGS+=     -Wno-error=ignored-attributes -Wno-error=format-security
+EXTRA_CFLAGS+= -Wno-error=ignored-attributes -no-integrated-as \
+               -Wno-error=tautological-compare -Wno-error=null-dereference \
+               -Wno-error=self-assign -Wno-error=sometimes-uninitialized
+.endif
+
+MAKE_ENV+=     EXTRA_HOSTCFLAGS=${EXTRA_HOSTCFLAGS:Q} 
EXTRA_CFLAGS=${EXTRA_CFLAGS:Q}
+
 pre-build:
 .if !exists(/usr/include/xen/xenio.h)
        ${MKDIR} ${WRKSRC}/libxc/xen
        ${TEST} -f ${WRKSRC}/libxc/xen/xenio.h || \
                ${CP} ${FILESDIR}/xenio.h ${WRKSRC}/libxc/xen

Index: sysutils/xentools3-hvm/distinfo
==================================================================
--- sysutils/xentools3-hvm/distinfo
+++ sysutils/xentools3-hvm/distinfo
@@ -1,10 +1,11 @@
 $NetBSD: distinfo,v 1.10 2012/05/14 15:39:52 manu Exp $
 
 SHA1 (xen-3.1.4.tar.gz) = 0d784662776239195df10b3f29d40350f9d0644d
 RMD160 (xen-3.1.4.tar.gz) = c02ad2bd64e6306b127a4f37a8aa370dadc11859
 Size (xen-3.1.4.tar.gz) = 6894493 bytes
+SHA1 (patch-.._patch-Config.mk) = 5ce1a561c8e358ceff4187b7109702c85fa29af8
 SHA1 (patch-aa) = 663c798a472501d4c38add5049faded5b7e807aa
 SHA1 (patch-an) = 37650fa861ed8219aa0682e84c5c8ba41a8cdff0
 SHA1 (patch-ao) = 500f1921a73e3a4b7aa91bbd819a26f2327ac8b5
 SHA1 (patch-ap) = 33f2bdbef6df3f2105d4502b8066abb6c952fc6c
 SHA1 (patch-ar) = 16d551946bdbc0f712548e3dbac0913b0fcccb44

ADDED    sysutils/xentools3-hvm/patches/patch-.._patch-Config.mk
Index: sysutils/xentools3-hvm/patches/patch-.._patch-Config.mk
==================================================================
--- sysutils/xentools3-hvm/patches/patch-.._patch-Config.mk
+++ sysutils/xentools3-hvm/patches/patch-.._patch-Config.mk
@@ -0,0 +1,26 @@
+$NetBSD: patch-.._patch-Config.mk,v 1.1 2011/12/07 15:22:28 joerg Exp $
+
+--- ../Config.mk.orig  2011-12-07 10:40:48.000000000 +0000
++++ ../Config.mk
+@@ -19,7 +19,7 @@ SHELL     ?= /bin/sh
+ # Tools to run on system hosting the build
+ HOSTCC      = gcc
+ HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+-HOSTCFLAGS += -fno-strict-aliasing
++HOSTCFLAGS += -fno-strict-aliasing ${EXTRA_HOSTCFLAGS}
+ HOSTCFLAGS_x86_32 = -m32
+ HOSTCFLAGS_x86_64 = -m64
+ HOSTCFLAGS += $(HOSTCFLAGS_$(XEN_COMPILE_ARCH))
+@@ -70,10 +70,11 @@ CFLAGS += -Wall -Wstrict-prototypes
+ 
+ # -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
+ # result of any casted expression causes a warning.
+-CFLAGS += -Wno-unused-value
++CFLAGS += -Wno-unused-value -Wno-switch
+ 
+ HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
+ CFLAGS     += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
++CFLAGS += ${EXTRA_CFLAGS}
+ 
+ LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
+ CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))

Index: sysutils/xentools3/Makefile
==================================================================
--- sysutils/xentools3/Makefile
+++ sysutils/xentools3/Makefile
@@ -136,10 +136,20 @@
                        ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0755
 .endfor
 
 OWN_DIRS=              ${PKG_SYSCONFDIR}/scripts /var/log/xen
 
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+EXTRA_HOSTCFLAGS+=     -Wno-error=ignored-attributes -Wno-error=format-security
+EXTRA_CFLAGS+= -Wno-error=ignored-attributes -no-integrated-as \
+               -Wno-error=tautological-compare -Wno-error=null-dereference \
+               -Wno-error=self-assign -Wno-error=sometimes-uninitialized
+.endif
+
+MAKE_ENV+=     EXTRA_HOSTCFLAGS=${EXTRA_HOSTCFLAGS:Q} 
EXTRA_CFLAGS=${EXTRA_CFLAGS:Q}
+
 pre-build:
 .if !exists(/usr/include/xen/xenio.h)
        ${MKDIR} ${WRKSRC}/libxc/xen
        ${TEST} -f ${WRKSRC}/libxc/xen/xenio.h || \
                ${CP} ${FILESDIR}/xenio.h ${WRKSRC}/libxc/xen

Index: sysutils/xentools3/distinfo
==================================================================
--- sysutils/xentools3/distinfo
+++ sysutils/xentools3/distinfo
@@ -1,11 +1,11 @@
 $NetBSD: distinfo,v 1.15 2012/05/14 15:39:52 manu Exp $
 
 SHA1 (xen-3.1.4.tar.gz) = 0d784662776239195df10b3f29d40350f9d0644d
 RMD160 (xen-3.1.4.tar.gz) = c02ad2bd64e6306b127a4f37a8aa370dadc11859
 Size (xen-3.1.4.tar.gz) = 6894493 bytes
-SHA1 (patch-.._patch-Config.mk) = af18346fb13d1dc9e56e7d01057d2cebfbbaba14
+SHA1 (patch-.._patch-Config.mk) = 5ce1a561c8e358ceff4187b7109702c85fa29af8
 SHA1 (patch-aa) = dca8b8de73b9bdbb17f8245224575eb881cdf00d
 SHA1 (patch-ab) = dcafc8b6c4cd1e4dfc6f4ec806fd8076b3104b86
 SHA1 (patch-ac) = d6d895e0361194cd84da13c42e17e17efecae7dd
 SHA1 (patch-ad) = 1d43550d5475538563129489e05b349337e77981
 SHA1 (patch-al) = 87f2af4784a8c2266d40788fd572e282f100c7b0
@@ -29,11 +29,11 @@
 SHA1 (patch-ca) = f999e8159c79ae6cd09004b8cac4ca36da93f79f
 SHA1 (patch-cb) = 0bf2513749e28ff955caabd76bf79dd8280b61ed
 SHA1 (patch-cc) = 3e618c7da953115e7b3c7fe07f17b75ef2c2bb34
 SHA1 (patch-cd) = a692eea5dcbf90536ffbbd2b934772bdefda5664
 SHA1 (patch-cf) = 05c5e86d33d31a2216c2751a2bf684c8d5d06746
-SHA1 (patch-cg) = 36073c7327f187702203108b3e7596178aac3327
+SHA1 (patch-cg) = e01915fc13291920106318b30681719cd226ff53
 SHA1 (patch-ch) = ebe2aedf1ecd1dce66f4a8a25ef5e83ee1d4c60d
 SHA1 (patch-cj) = 5227c180e9ec2cf7146ade6f250f6bdff8f2bda1
 SHA1 (patch-ck) = 3783d9b4b9344670bae2f35e2ac7f11e2ec9ce7b
 SHA1 (patch-cm) = 802d395f1dc391a827487bbc9fcfe2bbd6af07de
 SHA1 (patch-cn) = 40ae04194cca94b112133e962d4cf7487412925a
@@ -61,7 +61,8 @@
 SHA1 (patch-dj) = 354ee3ceb1b5ba9b02091de916c328e5a062cb87
 SHA1 (patch-dk) = 5685f52835885635eacd305945653f817bbe8a2a
 SHA1 (patch-dl) = 480b515da8773e4d3cfc305d74f833f16bb12750
 SHA1 (patch-dm) = af4b849dfb54454e08acd0618afc0a81572bcbc3
 SHA1 (patch-dn) = 1b6490b8f75ab9fe4d66d444fdacdde7db38131d
+SHA1 (patch-libxc_xc__dom__x86.c) = 098e42cef3a5e34b1b4b941d9f8709e8a97e60f6
 SHA1 (patch-python_xen_util_xmlrpcclient.py) = 
227db87dee15cfb7bedd67d6c118983b4dae2e34
 SHA1 (patch-python_xen_util_xmlrpclib2.py) = 
0fc01ed0511ccff6942453f3592a6939b60ab0c0

Index: sysutils/xentools3/patches/patch-.._patch-Config.mk
==================================================================
--- sysutils/xentools3/patches/patch-.._patch-Config.mk
+++ sysutils/xentools3/patches/patch-.._patch-Config.mk
@@ -1,13 +1,26 @@
 $NetBSD: patch-.._patch-Config.mk,v 1.1 2011/12/07 15:22:28 joerg Exp $
 
 --- ../Config.mk.orig  2011-12-07 10:40:48.000000000 +0000
 +++ ../Config.mk
-@@ -70,7 +70,7 @@ CFLAGS += -Wall -Wstrict-prototypes
+@@ -19,7 +19,7 @@ SHELL     ?= /bin/sh
+ # Tools to run on system hosting the build
+ HOSTCC      = gcc
+ HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+-HOSTCFLAGS += -fno-strict-aliasing
++HOSTCFLAGS += -fno-strict-aliasing ${EXTRA_HOSTCFLAGS}
+ HOSTCFLAGS_x86_32 = -m32
+ HOSTCFLAGS_x86_64 = -m64
+ HOSTCFLAGS += $(HOSTCFLAGS_$(XEN_COMPILE_ARCH))
+@@ -70,10 +70,11 @@ CFLAGS += -Wall -Wstrict-prototypes
  
  # -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
  # result of any casted expression causes a warning.
 -CFLAGS += -Wno-unused-value
 +CFLAGS += -Wno-unused-value -Wno-switch
  
  HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
  CFLAGS     += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
++CFLAGS += ${EXTRA_CFLAGS}
+ 
+ LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
+ CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))

Index: sysutils/xentools3/patches/patch-cg
==================================================================
--- sysutils/xentools3/patches/patch-cg
+++ sysutils/xentools3/patches/patch-cg
@@ -1,9 +1,9 @@
 $NetBSD: patch-cg,v 1.2 2007/11/17 16:45:32 bouyer Exp $
 
---- xenstat/xentop/xentop.c.orig       2007-05-18 16:45:21.000000000 +0200
-+++ xenstat/xentop/xentop.c    2007-11-17 14:50:57.000000000 +0100
+--- xenstat/xentop/xentop.c.orig       2008-04-25 13:03:12.000000000 +0000
++++ xenstat/xentop/xentop.c
 @@ -18,7 +18,8 @@
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
 -#include <curses.h>
@@ -22,11 +22,20 @@
 +#include <stdarg.h>
 +#endif
  
  #include <xenstat.h>
  
-@@ -740,10 +745,11 @@
+@@ -251,7 +256,7 @@ static void fail(const char *str)
+ {
+       if(cwin != NULL && !isendwin())
+               endwin();
+-      fprintf(stderr, str);
++      fprintf(stderr, "%s", str);
+       exit(1);
+ }
+ 
+@@ -752,10 +757,11 @@ void do_summary(void)
        unsigned i, num_domains = 0;
        unsigned long long used = 0;
        xenstat_domain *domain;
 +      time_t curt;
  
@@ -36,21 +45,21 @@
 +      curt = curtime.tv_sec;
 +      strftime(time_str, TIME_STR_LEN, TIME_STR_FORMAT, localtime(&curt));
        num_domains = xenstat_node_num_domains(cur_node);
        ver_str = xenstat_node_xen_version(cur_node);
        print("xentop - %s   Xen %s\n", time_str, ver_str);
-@@ -909,6 +915,7 @@
+@@ -921,6 +927,7 @@ void do_network(xenstat_domain *domain)
  /* Output all VBD information */
  void do_vbd(xenstat_domain *domain)
  {
 +#ifdef notyet
        int i = 0;
        xenstat_vbd *vbd;
        unsigned num_vbds = 0;
-@@ -933,6 +940,7 @@
+@@ -952,6 +959,7 @@ void do_vbd(xenstat_domain *domain)
                      xenstat_vbd_rd_reqs(vbd),
                      xenstat_vbd_wr_reqs(vbd));
        }
 +#endif
  }
  
  static void top(void)

ADDED    sysutils/xentools3/patches/patch-libxc_xc__dom__x86.c
Index: sysutils/xentools3/patches/patch-libxc_xc__dom__x86.c
==================================================================
--- sysutils/xentools3/patches/patch-libxc_xc__dom__x86.c
+++ sysutils/xentools3/patches/patch-libxc_xc__dom__x86.c
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- libxc/xc_dom_x86.c.orig    2013-03-25 20:08:33.000000000 +0000
++++ libxc/xc_dom_x86.c
+@@ -418,7 +418,7 @@ static int start_info_x86_32(struct xc_d
+     xc_dom_printf("%s: called\n", __FUNCTION__);
+ 
+     memset(start_info, 0, sizeof(*start_info));
+-    sprintf(start_info->magic, dom->guest_type);
++    snprintf(start_info->magic, sizeof(start_info->magic), "%s", 
dom->guest_type);
+     start_info->nr_pages = dom->total_pages;
+     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
+     start_info->pt_base = dom->pgtables_seg.vstart;
+@@ -457,7 +457,7 @@ static int start_info_x86_64(struct xc_d
+     xc_dom_printf("%s: called\n", __FUNCTION__);
+ 
+     memset(start_info, 0, sizeof(*start_info));
+-    sprintf(start_info->magic, dom->guest_type);
++    snprintf(start_info->magic, sizeof(start_info->magic), "%s", 
dom->guest_type);
+     start_info->nr_pages = dom->total_pages;
+     start_info->shared_info = shinfo << PAGE_SHIFT_X86;
+     start_info->pt_base = dom->pgtables_seg.vstart;

Index: sysutils/xentools33/Makefile
==================================================================
--- sysutils/xentools33/Makefile
+++ sysutils/xentools33/Makefile
@@ -145,10 +145,20 @@
                        ${REAL_ROOT_USER} ${REAL_ROOT_GROUP} 0755
 .endfor
 
 OWN_DIRS=              ${PKG_SYSCONFDIR}/scripts /var/log/xen
 
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+EXTRA_HOSTCFLAGS+=     -Wno-error=ignored-attributes -Wno-error=format-security
+EXTRA_CFLAGS+= -Wno-error=ignored-attributes -no-integrated-as \
+               -Wno-error=tautological-compare -Wno-error=null-dereference \
+               -Wno-error=self-assign -Wno-error=sometimes-uninitialized
+.endif
+
+MAKE_ENV+=     EXTRA_HOSTCFLAGS=${EXTRA_HOSTCFLAGS:Q} 
EXTRA_CFLAGS=${EXTRA_CFLAGS:Q}
+
 pre-build:
        rm -f ${WRKSRC}/check/check_x11_devel
 .for s in ${BLKTAP_FILES}
        cp ${FILESDIR}/${s} ${WRKSRC}/blktap/drivers/
 .endfor

Index: sysutils/xentools33/distinfo
==================================================================
--- sysutils/xentools33/distinfo
+++ sysutils/xentools33/distinfo
@@ -3,32 +3,33 @@
 SHA1 (xen-3.3.2.tar.gz) = 7f438e73ac81b25cf5e1570709e87001066bafe4
 RMD160 (xen-3.3.2.tar.gz) = 28faa56286f2a418e35dcba6079570ea871d6c7b
 Size (xen-3.3.2.tar.gz) = 11357576 bytes
 SHA1 (patch-CVE-2011-1583) = c9f59d9fbb20f0cb76733a4c2d136a67253cae0a
 SHA1 (patch-aa) = 74c3023e39baf488f8bae060e93f6175b32df61a
-SHA1 (patch-ab) = a73636bf27ad45fbdda791cb2b65254d26a5b899
-SHA1 (patch-ac) = 70af1b1a787b9dad9e41a2ffe14d595c6797b4d7
-SHA1 (patch-ad) = ccd63ed718e5ba3a742f181ae84af82e85f2f0c4
-SHA1 (patch-ae) = bb7116a71bf6637591b639511f055836a13d9887
-SHA1 (patch-af) = 0d4cd2bc3c56934bd072bc72b34e5ed677d04969
-SHA1 (patch-ag) = 6b6c26c5fbb28b9cc37e76b250cc90fed111e78a
-SHA1 (patch-ah) = cc8d95c73d7f4a08f311e8417d26f53ffd010549
-SHA1 (patch-ai) = 0906a5ec3a7450fc987b01289e2560e60966d00d
-SHA1 (patch-aj) = 64c87cd4d1d22af745043bc66b4fbab884920278
-SHA1 (patch-ak) = 17deee0790c25513efe15656389905658a9adaa5
-SHA1 (patch-al) = fc25048cf5bdf7d293f0f634890620576d8f4b11
-SHA1 (patch-ba) = e1ac8768dd1676262309b422799adde7f151b3e2
-SHA1 (patch-bb) = dacb9f95908c07c066d5a7c3ceff8a3c10537d27
-SHA1 (patch-bc) = ea31de81114f52dd9d06f2510c1555d641570784
-SHA1 (patch-bd) = 15e87f1e15e92d15099c4d62123df36b6aa23b18
-SHA1 (patch-be) = 7567a4430b18399cd69f9088803567dfe7b20c9a
-SHA1 (patch-bf) = 51f4b08ccaa3e6c062a489d8e4a7a6a5ccdb221a
-SHA1 (patch-bg) = 0121c07ddc67b6801cdd15488bc681378a466949
-SHA1 (patch-bh) = a072c1e2dd21aa284303b5fcc7eae5ff841a5fbc
-SHA1 (patch-bi) = 49c1b77b451b63cfe3a1fded7f6d0410d4c3cf92
-SHA1 (patch-bj) = 4c6b6a73d3ea5fb2c57b12dd4651f59024119276
-SHA1 (patch-bk) = a79256edc3dc2a5f4bcdbe1a2d14037ad74f11de
+SHA1 (patch-ab) = 393c908858c81e526462a07de9b38fb449d294c3
+SHA1 (patch-ac) = 70af1b1a787b9dad9e41a2ffe14d595c6797b4d7
+SHA1 (patch-ad) = ccd63ed718e5ba3a742f181ae84af82e85f2f0c4
+SHA1 (patch-ae) = bb7116a71bf6637591b639511f055836a13d9887
+SHA1 (patch-af) = 0d4cd2bc3c56934bd072bc72b34e5ed677d04969
+SHA1 (patch-ag) = 6b6c26c5fbb28b9cc37e76b250cc90fed111e78a
+SHA1 (patch-ah) = cc8d95c73d7f4a08f311e8417d26f53ffd010549
+SHA1 (patch-ai) = 0906a5ec3a7450fc987b01289e2560e60966d00d
+SHA1 (patch-aj) = 64c87cd4d1d22af745043bc66b4fbab884920278
+SHA1 (patch-ak) = 17deee0790c25513efe15656389905658a9adaa5
+SHA1 (patch-al) = fc25048cf5bdf7d293f0f634890620576d8f4b11
+SHA1 (patch-ba) = e1ac8768dd1676262309b422799adde7f151b3e2
+SHA1 (patch-bb) = dacb9f95908c07c066d5a7c3ceff8a3c10537d27
+SHA1 (patch-bc) = ea31de81114f52dd9d06f2510c1555d641570784
+SHA1 (patch-bd) = 15e87f1e15e92d15099c4d62123df36b6aa23b18
+SHA1 (patch-be) = 7567a4430b18399cd69f9088803567dfe7b20c9a
+SHA1 (patch-bf) = 51f4b08ccaa3e6c062a489d8e4a7a6a5ccdb221a
+SHA1 (patch-bg) = 0121c07ddc67b6801cdd15488bc681378a466949
+SHA1 (patch-bh) = a072c1e2dd21aa284303b5fcc7eae5ff841a5fbc
+SHA1 (patch-bi) = 49c1b77b451b63cfe3a1fded7f6d0410d4c3cf92
+SHA1 (patch-bj) = 4c6b6a73d3ea5fb2c57b12dd4651f59024119276
+SHA1 (patch-bk) = a79256edc3dc2a5f4bcdbe1a2d14037ad74f11de
+SHA1 (patch-blktap_drivers_block-qcow.c) = 
035411d811171fea46c8dec6534018370ef22e14
 SHA1 (patch-blktaplib_h) = a37ecaaefcd694be54bb75163339650be69f9250
 SHA1 (patch-ca) = b62ec8f0db5e65d737d1aaf3bd44580f5969328b
 SHA1 (patch-cb) = 9b7834e367a1820f28c0c1053d3f351751a12283
 SHA1 (patch-cc) = 598f7cda0e3137188f97605037b0b1c26ae8d0c0
 SHA1 (patch-cd) = 5563a72e203e789a86f4166c71ddb3fcff5215c6
@@ -54,9 +55,10 @@
 SHA1 (patch-fd) = 619b865b2f17814e6e62ebab21de9183474dd075
 SHA1 (patch-fe) = 85d42672766fe8ce2dc7f745938722710c6ee5a3
 SHA1 (patch-ff) = 6ff97fa4f34f29c276e4aaab4b4db9ccf7b09957
 SHA1 (patch-fg) = 913295d341c1dd5bf4d1ef78f27520920f138d4c
 SHA1 (patch-io_ring_h) = 83b01462d5d2b48b4f97b3d9a7980aa3300ad0b3
+SHA1 (patch-ioemu_block-vvfat.c) = 4e6d998fe2c006bb68caaf8e1d11e641319ff5c2
 SHA1 (patch-python_xen_util_xmlrpcclient.py) = 
2f983bc67930b86b538743dab6bc81d9aacc6b35
 SHA1 (patch-python_xen_util_xmlrpclib2.py) = 
4977ebd86c7d76e1dc861c0f839c506446e384a5
 SHA1 (patch-qemu-e1000-CVSE-2012-0029) = 
8628504e1dfd013254f816cb4feeb7548b9ad2ec
 SHA1 (patch-qemu-phy-devices) = 29790e45372ae16157e906dc39a667229e8a0ba5

Index: sysutils/xentools33/patches/patch-ab
==================================================================
--- sysutils/xentools33/patches/patch-ab
+++ sysutils/xentools33/patches/patch-ab
@@ -1,22 +1,40 @@
 $NetBSD: patch-ab,v 1.2 2011/12/07 15:22:59 joerg Exp $
 
 --- ../Config.mk.orig  2009-08-06 13:17:07.000000000 +0000
 +++ ../Config.mk
+@@ -15,7 +15,7 @@ SHELL     ?= /bin/sh
+ # Tools to run on system hosting the build
+ HOSTCC      = gcc
+ HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+-HOSTCFLAGS += -fno-strict-aliasing
++HOSTCFLAGS += -fno-strict-aliasing ${EXTRA_HOSTCFLAGS}
+ 
+ DISTDIR     ?= $(XEN_ROOT)/dist
+ DESTDIR     ?= /
 @@ -66,7 +66,7 @@ CFLAGS += -Wall -Wstrict-prototypes
  
  # -Wunused-value makes GCC 4.x too aggressive for my taste: ignoring the
  # result of any casted expression causes a warning.
 -CFLAGS += -Wno-unused-value
 +CFLAGS += -Wno-unused-value -Wno-switch
  
  HOSTCFLAGS += $(call cc-option,$(HOSTCC),-Wdeclaration-after-statement,)
  CFLAGS     += $(call cc-option,$(CC),-Wdeclaration-after-statement,)
-@@ -90,7 +90,7 @@ QEMU_REMOTE=http://xenbits.xensource.com
+@@ -74,6 +74,8 @@ CFLAGS     += $(call cc-option,$(CC),-Wd
+ LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
+ CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
+ 
++CFLAGS += $(EXTRA_CFLAGS)
++
+ # Enable XSM security module.  Enabling XSM requires selection of an 
+ # XSM security module (FLASK_ENABLE or ACM_SECURITY).
+ XSM_ENABLE ?= n
+@@ -90,7 +92,7 @@ QEMU_REMOTE=http://xenbits.xensource.com
  
  # Specify which qemu-dm to use. This may be `ioemu' to use the old
  # Mercurial in-tree version, or a local directory, or a git URL.
 -# CONFIG_QEMU   ?= ioemu
 +CONFIG_QEMU   ?= ioemu
  # CONFIG_QEMU   ?= ../qemu-xen.git
  ifeq ($(XEN_TARGET_ARCH),ia64)
  CONFIG_QEMU   ?= ioemu

ADDED    sysutils/xentools33/patches/patch-blktap_drivers_block-qcow.c
Index: sysutils/xentools33/patches/patch-blktap_drivers_block-qcow.c
==================================================================
--- sysutils/xentools33/patches/patch-blktap_drivers_block-qcow.c
+++ sysutils/xentools33/patches/patch-blktap_drivers_block-qcow.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- blktap/drivers/block-qcow.c.orig   2013-03-28 16:51:10.000000000 +0000
++++ blktap/drivers/block-qcow.c
+@@ -1078,7 +1078,8 @@ static int tdqcow_close(struct disk_driv
+               offset = sizeof(QCowHeader) + sizeof(uint32_t);
+               lseek(fd, offset, SEEK_SET);
+               out = cpu_to_be32(cksum);
+-              if (write(fd, &out, sizeof(uint32_t))) ;
++              if (write(fd, &out, sizeof(uint32_t)))
++                      ;
+               close(fd);
+       }
+ 

ADDED    sysutils/xentools33/patches/patch-ioemu_block-vvfat.c
Index: sysutils/xentools33/patches/patch-ioemu_block-vvfat.c
==================================================================
--- sysutils/xentools33/patches/patch-ioemu_block-vvfat.c
+++ sysutils/xentools33/patches/patch-ioemu_block-vvfat.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- ioemu/block-vvfat.c.orig   2013-03-28 16:52:33.000000000 +0000
++++ ioemu/block-vvfat.c
+@@ -175,7 +175,7 @@ static inline int array_roll(array_t* ar
+     return 0;
+ }
+ 
+-inline int array_remove_slice(array_t* array,int index, int count)
++static inline int array_remove_slice(array_t* array,int index, int count)
+ {
+     assert(index >=0);
+     assert(count > 0);

Index: sysutils/xentools41/Makefile
==================================================================
--- sysutils/xentools41/Makefile
+++ sysutils/xentools41/Makefile
@@ -174,10 +174,21 @@
 
 .if ${OPSYS} == "NetBSD"
 CPPFLAGS+=     -Dshm_open=open -Dshm_unlink=unlink
 .endif
 
+.include "../../mk/compiler.mk"
+.if !empty(PKGSRC_COMPILER:Mclang)
+EXTRA_HOSTCFLAGS+=     -Wno-error=ignored-attributes
+EXTRA_CFLAGS+= -Wno-error=ignored-attributes -no-integrated-as \
+               -Wno-error=tautological-compare -Wno-error=null-dereference \
+               -Wno-error=empty-body -Wno-error=self-assign \
+               -Wno-error=sometimes-uninitialized
+.endif
+
+MAKE_ENV+=     EXTRA_HOSTCFLAGS=${EXTRA_HOSTCFLAGS:Q} 
EXTRA_CFLAGS=${EXTRA_CFLAGS:Q}
+
 .include "../../lang/python/application.mk"
 .include "../../lang/python/extension.mk"
 .include "../../textproc/py-xml/buildlink3.mk"
 .include "../../devel/py-curses/buildlink3.mk"
 .include "../../devel/ncurses/buildlink3.mk"

Index: sysutils/xentools41/distinfo
==================================================================
--- sysutils/xentools41/distinfo
+++ sysutils/xentools41/distinfo
@@ -4,10 +4,14 @@
 RMD160 (ipxe-git-v1.0.0.tar.gz) = dcd9b6eaafa1ce05c1ebf2a15f2f73ad7a8c5547
 Size (ipxe-git-v1.0.0.tar.gz) = 1996881 bytes
 SHA1 (xen-4.1.4.tar.gz) = d5f1e9c9eeb96202dd827c196750530ffc64baab
 RMD160 (xen-4.1.4.tar.gz) = e3cb379954c985354dfd7dfbed15eae43e73254d
 Size (xen-4.1.4.tar.gz) = 10387283 bytes
+SHA1 (patch-.._.._ipxe_src_arch_i386_include_librm.h) = 
4549ac641b112321b4731a918d85219c3fce6808
+SHA1 (patch-.._.._ipxe_src_core_settings.c) = 
240ff973757403b983f12b2cbed826584c4a8aba
+SHA1 (patch-.._.._ipxe_src_net_tls.c) = 
c0cfbc2ab2b92c659c146601c4f80d58c951ca62
+SHA1 (patch-.._Config.mk) = 9b971a41f67bb3974d3a4459bb9d96fbbd636c96
 SHA1 (patch-CVE-2012-6075) = 9de84238489875d94245d4f6ce3689629bb318ee
 SHA1 (patch-aa) = 9b53ba4a809dad7a1de34c8fa0dbe493d7256ada
 SHA1 (patch-ab) = 0906a5ec3a7450fc987b01289e2560e60966d00d
 SHA1 (patch-ac) = c3cc5335a1d6b066307c5f03fe72f513a9eb2bdb
 SHA1 (patch-ad) = 5eb15470bff85d30b6d26d8fe094f59fc8e34175
@@ -35,20 +39,25 @@
 SHA1 (patch-db) = 4766f9925462023332793bcea4321072758e289d
 SHA1 (patch-dc) = d860fe3725978227278d58f09e7d5157001e463e
 SHA1 (patch-dd) = e66d9cc0028ba922b050fc142862b4095cd018f3
 SHA1 (patch-de) = fae94b61a430a1a7dd98c9a6a04e4513824c6d8d
 SHA1 (patch-df) = d20bf9d3fd05f5334f77c9154bf0fb9944c1292c
+SHA1 (patch-examples_Makefile) = da39a3ee5e6b4b0d3255bfef95601890afd80709
+SHA1 (patch-firmware_hvmloader_Makefile) = 
b2914e4988ba004d45403d67f1580b1f9725d006
+SHA1 (patch-hotplug_common_Makefile) = da39a3ee5e6b4b0d3255bfef95601890afd80709
 SHA1 (patch-ioemu-qemu-xen_hw_pass-through.c) = 
76185c239078f29cb42b953d6c2cd1f59e240989
 SHA1 (patch-ioemu-qemu-xen_hw_pass-through.h) = 
98c26798d1ad99d3eee8b33deb08f747c958c886
 SHA1 (patch-ioemu-qemu-xen_hw_piix4acpi.c) = 
ca19457e9bde2d844a86a866960ac6de1f3d084c
 SHA1 (patch-ioemu-qemu-xen_hw_pt-graphics.c) = 
3c03404f1d711c667559a1332e717a5f1b5ceda8
 SHA1 (patch-ioemu-qemu-xen_hw_pt-msi.c) = 
2dcebc65f591988bb95dea74c3b21f7066154a9f
 SHA1 (patch-ioemu-qemu-xen_hw_pt-msi.h) = 
d1bb1a8ad90d6577056f11df96f5469ffe74a3b0
 SHA1 (patch-ioemu-qemu-xen_xen-hooks.mak) = 
a00d9a9fd0fbb9fd89788b9dfaf5b389a28d47e2
+SHA1 (patch-libcx_xc__dom__boot.c) = 0507c2d7fe194f2d11a367fb1840b5d36da66cb1
 SHA1 (patch-libxl_libxl_create.c) = 02b661ca684609939c6ef762c0ddd1c5e62ad4d0
 SHA1 (patch-libxl_libxl_internal.h) = e126e5e998117903f0c66cc370d350c504ed33d9
 SHA1 (patch-ocaml_Makefile.rules) = 104f9d40186e5e4ca6a2e6359bbb369c3c91d1dc
 SHA1 (patch-ocaml_common.make) = c59d32301198d65691ab23529dd791de5ac40199
 SHA1 (patch-ocaml_xenstored_define.ml) = 
f44841625554ceba6e83dbb41f688993c2a8d9a2
 SHA1 (patch-ocaml_xenstored_utils.ml) = 
cc792a696743fa348b274b1c23783ea1a0d7da47
 SHA1 (patch-qemu-phy-devices) = fef90e50ef0a58db2f2b49b6c23218f371791de5
+SHA1 (patch-xenstat_libxenstat_Makefile) = 
d797b824afd98ec3dd17c5f9ac1307f0eaab8214
 SHA1 (patch-xenstore_Makefile) = 4fa0ed7b76a96011c3cca9c5017be4b5151489f7

ADDED    
sysutils/xentools41/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h
Index: 
sysutils/xentools41/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h
==================================================================
--- sysutils/xentools41/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h
+++ sysutils/xentools41/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- ../../ipxe/src/arch/i386/include/librm.h.orig      2010-02-02 
16:12:44.000000000 +0000
++++ ../../ipxe/src/arch/i386/include/librm.h
+@@ -122,8 +122,9 @@ extern char *text16;
+       _data16_ ## variable __asm__ ( #variable )
+ 
+ #define __bss16_array( variable, array )                              \
+-      __attribute__ (( section ( ".bss16" ) ))                        \
+-      _data16_ ## variable array __asm__ ( #variable )
++      _data16_ ## variable array \
++      __asm__ ( #variable ) \
++      __attribute__ (( section ( ".bss16" ) ))
+ 
+ #define __text16( variable )                                          \
+       __attribute__ (( section ( ".text16.data" ) ))                  \

ADDED    sysutils/xentools41/patches/patch-.._.._ipxe_src_core_settings.c
Index: sysutils/xentools41/patches/patch-.._.._ipxe_src_core_settings.c
==================================================================
--- sysutils/xentools41/patches/patch-.._.._ipxe_src_core_settings.c
+++ sysutils/xentools41/patches/patch-.._.._ipxe_src_core_settings.c
@@ -0,0 +1,34 @@
+$NetBSD$
+
+--- ../../ipxe/src/core/settings.c.orig        2013-03-25 18:48:57.000000000 
+0000
++++ ../../ipxe/src/core/settings.c
+@@ -263,10 +263,12 @@ static struct settings * find_child_sett
+  */
+ static struct settings * autovivify_child_settings ( struct settings *parent,
+                                                    const char *name ) {
++      size_t nlen = strlen ( name ) + 1 /* NUL */;
+       struct {
+               struct generic_settings generic;
+-              char name[ strlen ( name ) + 1 /* NUL */ ];
++              char name[];
+       } *new_child;
++      size_t tlen = sizeof(*new_child) + nlen;
+       struct settings *settings;
+ 
+       /* Return existing settings, if existent */
+@@ -274,13 +276,13 @@ static struct settings * autovivify_chil
+               return settings;
+ 
+       /* Create new generic settings block */
+-      new_child = zalloc ( sizeof ( *new_child ) );
++      new_child = zalloc ( tlen );
+       if ( ! new_child ) {
+               DBGC ( parent, "Settings %p could not create child %s\n",
+                      parent, name );
+               return NULL;
+       }
+-      memcpy ( new_child->name, name, sizeof ( new_child->name ) );
++      memcpy ( new_child->name, name, nlen );
+       generic_settings_init ( &new_child->generic, NULL, new_child->name );
+       settings = &new_child->generic.settings;
+       register_settings ( settings, parent );

ADDED    sysutils/xentools41/patches/patch-.._.._ipxe_src_net_tls.c
Index: sysutils/xentools41/patches/patch-.._.._ipxe_src_net_tls.c
==================================================================
--- sysutils/xentools41/patches/patch-.._.._ipxe_src_net_tls.c
+++ sysutils/xentools41/patches/patch-.._.._ipxe_src_net_tls.c
@@ -0,0 +1,69 @@
+$NetBSD$
+
+--- ../../ipxe/src/net/tls.c.orig      2013-03-25 18:53:57.000000000 +0000
++++ ../../ipxe/src/net/tls.c
+@@ -650,18 +650,22 @@ static int tls_send_client_key_exchange 
+       RSA_CTX *rsa_ctx;
+       RSA_pub_key_new ( &rsa_ctx, tls->rsa.modulus, tls->rsa.modulus_len,
+                         tls->rsa.exponent, tls->rsa.exponent_len );
++      size_t elen = rsa_ctx->num_octets;
+       struct {
+               uint32_t type_length;
+               uint16_t encrypted_pre_master_secret_len;
+-              uint8_t encrypted_pre_master_secret[rsa_ctx->num_octets];
+-      } __attribute__ (( packed )) key_xchg;
+-
+-      memset ( &key_xchg, 0, sizeof ( key_xchg ) );
+-      key_xchg.type_length = ( cpu_to_le32 ( TLS_CLIENT_KEY_EXCHANGE ) |
+-                               htonl ( sizeof ( key_xchg ) -
+-                                       sizeof ( key_xchg.type_length ) ) );
+-      key_xchg.encrypted_pre_master_secret_len
+-              = htons ( sizeof ( key_xchg.encrypted_pre_master_secret ) );
++              uint8_t encrypted_pre_master_secret[];
++      } __attribute__ (( packed )) *key_xchg;
++      size_t klen = sizeof(*key_xchg) + elen;
++
++      key_xchg = alloca(klen);
++
++      memset ( key_xchg, 0, klen );
++      key_xchg->type_length = ( cpu_to_le32 ( TLS_CLIENT_KEY_EXCHANGE ) |
++                               htonl ( klen -
++                                       sizeof ( key_xchg->type_length ) ) );
++      key_xchg->encrypted_pre_master_secret_len
++              = htons ( elen );
+ 
+       /* FIXME: Hack alert */
+       DBGC ( tls, "RSA encrypting plaintext, modulus, exponent:\n" );
+@@ -671,14 +675,13 @@ static int tls_send_client_key_exchange 
+       DBGC_HD ( tls, tls->rsa.exponent, tls->rsa.exponent_len );
+       RSA_encrypt ( rsa_ctx, ( const uint8_t * ) &tls->pre_master_secret,
+                     sizeof ( tls->pre_master_secret ),
+-                    key_xchg.encrypted_pre_master_secret, 0 );
++                    key_xchg->encrypted_pre_master_secret, 0 );
+       DBGC ( tls, "RSA encrypt done.  Ciphertext:\n" );
+-      DBGC_HD ( tls, &key_xchg.encrypted_pre_master_secret,
+-                sizeof ( key_xchg.encrypted_pre_master_secret ) );
++      DBGC_HD ( tls, &key_xchg->encrypted_pre_master_secret, elen );
+       RSA_free ( rsa_ctx );
+ 
+ 
+-      return tls_send_handshake ( tls, &key_xchg, sizeof ( key_xchg ) );
++      return tls_send_handshake ( tls, key_xchg, klen );
+ }
+ 
+ /**
+@@ -802,12 +805,12 @@ static int tls_new_server_hello ( struct
+               uint8_t session_id_len;
+               char next[0];
+       } __attribute__ (( packed )) *hello_a = data;
++      size_t slen = hello_a->session_id_len;
+       struct {
+-              uint8_t session_id[hello_a->session_id_len];
+               uint16_t cipher_suite;
+               uint8_t compression_method;
+               char next[0];
+-      } __attribute__ (( packed )) *hello_b = ( void * ) &hello_a->next;
++      } __attribute__ (( packed )) *hello_b = ( void * ) ((uint8_t 
*)&hello_a->next + slen);
+       void *end = hello_b->next;
+       int rc;
+ 

ADDED    sysutils/xentools41/patches/patch-.._Config.mk
Index: sysutils/xentools41/patches/patch-.._Config.mk
==================================================================
--- sysutils/xentools41/patches/patch-.._Config.mk
+++ sysutils/xentools41/patches/patch-.._Config.mk
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- ../Config.mk.orig  2013-03-25 09:51:57.000000000 +0000
++++ ../Config.mk
+@@ -15,7 +15,7 @@ SHELL     ?= /bin/sh
+ # Tools to run on system hosting the build
+ HOSTCC      = gcc
+ HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+-HOSTCFLAGS += -fno-strict-aliasing
++HOSTCFLAGS += -fno-strict-aliasing ${EXTRA_HOSTCFLAGS}
+ 
+ DISTDIR     ?= $(XEN_ROOT)/dist
+ DESTDIR     ?= /
+@@ -141,6 +141,8 @@ CFLAGS += -Wall -Wstrict-prototypes
+ # result of any casted expression causes a warning.
+ CFLAGS += -Wno-unused-value
+ 
++CFLAGS += ${EXTRA_CFLAGS}
++
+ $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement)
+ $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement)
+ $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable)

ADDED    sysutils/xentools41/patches/patch-examples_Makefile
Index: sysutils/xentools41/patches/patch-examples_Makefile
==================================================================
ADDED    sysutils/xentools41/patches/patch-firmware_hvmloader_Makefile
Index: sysutils/xentools41/patches/patch-firmware_hvmloader_Makefile
==================================================================
--- sysutils/xentools41/patches/patch-firmware_hvmloader_Makefile
+++ sysutils/xentools41/patches/patch-firmware_hvmloader_Makefile
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- firmware/hvmloader/Makefile.orig   2013-03-25 19:35:30.000000000 +0000
++++ firmware/hvmloader/Makefile
+@@ -26,7 +26,7 @@ SUBDIRS := acpi
+ # The HVM loader is started in 32-bit mode at the address below:
+ LOADADDR = 0x100000
+ 
+-CFLAGS += $(CFLAGS_include) -I.
++CFLAGS += $(CFLAGS_include) -I. $(EXTRA_CFLAGS)
+ 
+ SRCS  = hvmloader.c mp_tables.c util.c smbios.c 
+ SRCS += 32bitbios_support.c smp.c cacheattr.c xenbus.c

ADDED    sysutils/xentools41/patches/patch-hotplug_common_Makefile
Index: sysutils/xentools41/patches/patch-hotplug_common_Makefile
==================================================================
ADDED    sysutils/xentools41/patches/patch-libcx_xc__dom__boot.c
Index: sysutils/xentools41/patches/patch-libcx_xc__dom__boot.c
==================================================================
--- sysutils/xentools41/patches/patch-libcx_xc__dom__boot.c
+++ sysutils/xentools41/patches/patch-libcx_xc__dom__boot.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- libxc/xc_dom_boot.c.orig   2013-03-25 10:12:30.000000000 +0000
++++ libxc/xc_dom_boot.c
+@@ -265,7 +265,7 @@ int xc_dom_boot_image(struct xc_dom_imag
+         return rc;
+ 
+     /* let the vm run */
+-    memset(ctxt, 0, sizeof(ctxt));
++    memset(ctxt, 0, sizeof(*ctxt));
+     if ( (rc = dom->arch_hooks->vcpu(dom, ctxt)) != 0 )
+         return rc;
+     xc_dom_unmap_all(dom);

ADDED    sysutils/xentools41/patches/patch-xenstat_libxenstat_Makefile
Index: sysutils/xentools41/patches/patch-xenstat_libxenstat_Makefile
==================================================================
--- sysutils/xentools41/patches/patch-xenstat_libxenstat_Makefile
+++ sysutils/xentools41/patches/patch-xenstat_libxenstat_Makefile
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- xenstat/libxenstat/Makefile.orig   2013-03-25 19:37:42.000000000 +0000
++++ xenstat/libxenstat/Makefile
+@@ -57,13 +57,13 @@ $(SHLIB): $(OBJECTS-y)
+           $(OBJECTS-y) $(LDLIBS-y)
+ 
+ src/xenstat.o: src/xenstat.c src/xenstat.h src/xenstat_priv.h
+-      $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $<
++      $(CC) $(WARN_FLAGS) $(CFLAGS) -c -o $@ $<
+ 
+ src/xenstat_linux.o: src/xenstat_linux.c src/xenstat_priv.h
+-      $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $<
++      $(CC) $(WARN_FLAGS) $(CFLAGS) -c -o $@ $<
+ 
+ src/xenstat_solaris.o: src/xenstat_solaris.c src/xenstat_priv.h
+-      $(CC) $(CFLAGS) $(WARN_FLAGS) -c -o $@ $<
++      $(CC) $(WARN_FLAGS) $(CFLAGS) -c -o $@ $<
+ 
+ src/libxenstat.so.$(MAJOR): $(LIB)
+       $(MAKE_LINK) $(<F) $@



Home | Main Index | Thread Index | Old Index