pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils/xenkernel42 Fix build with Clang.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f83e03aa3a18
branches:  trunk
changeset: 648760:f83e03aa3a18
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Mar 18 15:05:51 2015 +0000

description:
Fix build with Clang.

diffstat:

 sysutils/xenkernel42/Makefile                                   |   5 +-
 sysutils/xenkernel42/distinfo                                   |   3 +-
 sysutils/xenkernel42/patches/patch-xen_include_asm-x86_atomic.h |  30 ++++++++++
 3 files changed, 35 insertions(+), 3 deletions(-)

diffs (70 lines):

diff -r 59fb01253571 -r f83e03aa3a18 sysutils/xenkernel42/Makefile
--- a/sysutils/xenkernel42/Makefile     Wed Mar 18 15:05:46 2015 +0000
+++ b/sysutils/xenkernel42/Makefile     Wed Mar 18 15:05:51 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2015/03/10 19:50:15 spz Exp $
+# $NetBSD: Makefile,v 1.14 2015/03/18 15:05:51 joerg Exp $
 
 VERSION=       4.2.5
 DISTNAME=      xen-${VERSION}
@@ -33,7 +33,8 @@
 .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=unused-function -Wno-error=unused-const-variable
+               -Wno-error=unused-function -Wno-error=unused-const-variable \
+               -Wno-error=pointer-bool-conversion
 .endif
 
 MAKE_ENV+=     EXTRA_CFLAGS=${EXTRA_CFLAGS:Q}
diff -r 59fb01253571 -r f83e03aa3a18 sysutils/xenkernel42/distinfo
--- a/sysutils/xenkernel42/distinfo     Wed Mar 18 15:05:46 2015 +0000
+++ b/sysutils/xenkernel42/distinfo     Wed Mar 18 15:05:51 2015 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.11 2015/03/10 19:50:15 spz Exp $
+$NetBSD: distinfo,v 1.12 2015/03/18 15:05:51 joerg Exp $
 
 SHA1 (xen-4.2.5.tar.gz) = f42741e4ec174495ace70c4b17a6b9b0e60e798a
 RMD160 (xen-4.2.5.tar.gz) = 7d4f7f1b32ee541d341a756b1f8da02816438d19
@@ -19,6 +19,7 @@
 SHA1 (patch-xen_arch_x86_x86_emulate_x86_emulate.c) = 8b906e762c8f94a670398b4e033d50a2fb012f0a
 SHA1 (patch-xen_common_spinlock.c) = 06f06b5e9b098262ebaa8af0be4837005fb5b8b4
 SHA1 (patch-xen_include_asm-arm_spinlock.h) = fe2e35a5ebec4c551df5d1680c93e6ad19348d93
+SHA1 (patch-xen_include_asm-x86_atomic.h) = d406c6071ea3823c25113a801dd77ff32146d162
 SHA1 (patch-xen_include_asm-x86_spinlock.h) = fbaaf264e9aa4857635a81b63c4a77cba4bf560f
 SHA1 (patch-xen_include_xen_lib.h) = 36dcaf3874a1b1214babc45d7e19fe3b556c1044
 SHA1 (patch-xen_include_xen_spinlock.h) = 8e06de55c9b4bfc360e0b8ac5a605adedab8eb8f
diff -r 59fb01253571 -r f83e03aa3a18 sysutils/xenkernel42/patches/patch-xen_include_asm-x86_atomic.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenkernel42/patches/patch-xen_include_asm-x86_atomic.h   Wed Mar 18 15:05:51 2015 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-xen_include_asm-x86_atomic.h,v 1.1 2015/03/18 15:05:51 joerg Exp $
+
+read_atomic() is used in the condition part of while() loops, so don't
+use break here.
+
+--- xen/include/asm-x86/atomic.h.orig  2015-03-17 23:41:49.000000000 +0000
++++ xen/include/asm-x86/atomic.h
+@@ -46,12 +46,16 @@ void __bad_atomic_size(void);
+ 
+ #define read_atomic(p) ({                                               \
+     typeof(*p) __x;                                                     \
+-    switch ( sizeof(*p) ) {                                             \
+-    case 1: __x = (typeof(*p))read_u8_atomic((uint8_t *)p); break;      \
+-    case 2: __x = (typeof(*p))read_u16_atomic((uint16_t *)p); break;    \
+-    case 4: __x = (typeof(*p))read_u32_atomic((uint32_t *)p); break;    \
+-    case 8: __x = (typeof(*p))read_u64_atomic((uint64_t *)p); break;    \
+-    default: __x = 0; __bad_atomic_size(); break;                       \
++    if ( sizeof(*p) == 1 )                                              \
++        __x = (typeof(*p))read_u8_atomic((uint8_t *)p);                 \
++    else if ( sizeof(*p) == 2 )                                         \
++        __x = (typeof(*p))read_u16_atomic((uint16_t *)p);               \
++    else if ( sizeof(*p) == 4 )                                         \
++        __x = (typeof(*p))read_u32_atomic((uint32_t *)p);               \
++    else if ( sizeof(*p) == 8 )                                         \
++        __x = (typeof(*p))read_u64_atomic((uint64_t *)p);               \
++    else {                                                              \
++        __x = 0; __bad_atomic_size();                                   \
+     }                                                                   \
+     __x;                                                                \
+ })



Home | Main Index | Thread Index | Old Index