summaryrefslogtreecommitdiff
path: root/sysutils/xentools41
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2013-04-11 19:57:51 +0000
committerjoerg <joerg@pkgsrc.org>2013-04-11 19:57:51 +0000
commite441ebed12521528c8ca5be7d24f3c880abd2a71 (patch)
treea48bd646c2a7b3e6340b8037d55ab035cbba1f29 /sysutils/xentools41
parentdcceeb788f49a4372be2f50b5e1727fa5ae6cade (diff)
downloadpkgsrc-e441ebed12521528c8ca5be7d24f3c880abd2a71.tar.gz
Allow building Xen infrastructure with Clang. Fix various bugs in
xenkernel3, xenkernel41, xentools3 and xentools41 exposed by Clang default warnings. Bump revisions for those.
Diffstat (limited to 'sysutils/xentools41')
-rw-r--r--sysutils/xentools41/Makefile15
-rw-r--r--sysutils/xentools41/distinfo11
-rw-r--r--sysutils/xentools41/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h16
-rw-r--r--sysutils/xentools41/patches/patch-.._.._ipxe_src_core_settings.c34
-rw-r--r--sysutils/xentools41/patches/patch-.._.._ipxe_src_net_tls.c69
-rw-r--r--sysutils/xentools41/patches/patch-.._Config.mk22
-rw-r--r--sysutils/xentools41/patches/patch-firmware_hvmloader_Makefile13
-rw-r--r--sysutils/xentools41/patches/patch-libcx_xc__dom__boot.c13
-rw-r--r--sysutils/xentools41/patches/patch-xenstat_libxenstat_Makefile21
9 files changed, 211 insertions, 3 deletions
diff --git a/sysutils/xentools41/Makefile b/sysutils/xentools41/Makefile
index 768633676df..9900e45e7b7 100644
--- a/sysutils/xentools41/Makefile
+++ b/sysutils/xentools41/Makefile
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.29 2013/03/15 16:10:57 is Exp $
+# $NetBSD: Makefile,v 1.30 2013/04/11 19:57:53 joerg Exp $
#
# VERSION is set in version.mk as it is shared with other packages
.include "version.mk"
DISTNAME= xen-${VERSION}
PKGNAME= xentools41-${VERSION}
-PKGREVISION= 2
+PKGREVISION= 3
CATEGORIES= sysutils
MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/
@@ -176,6 +176,17 @@ post-install:
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"
diff --git a/sysutils/xentools41/distinfo b/sysutils/xentools41/distinfo
index dd464eb726c..12360ba136e 100644
--- a/sysutils/xentools41/distinfo
+++ b/sysutils/xentools41/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.26 2013/03/15 16:10:57 is Exp $
+$NetBSD: distinfo,v 1.27 2013/04/11 19:57:53 joerg Exp $
SHA1 (ipxe-git-v1.0.0.tar.gz) = da052c8de5f3485fe0253c19cf52ed6d72528485
RMD160 (ipxe-git-v1.0.0.tar.gz) = dcd9b6eaafa1ce05c1ebf2a15f2f73ad7a8c5547
@@ -6,6 +6,10 @@ 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
@@ -37,6 +41,9 @@ 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
@@ -44,6 +51,7 @@ SHA1 (patch-ioemu-qemu-xen_hw_pt-graphics.c) = 3c03404f1d711c667559a1332e717a5f1
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
@@ -51,4 +59,5 @@ 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
diff --git a/sysutils/xentools41/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h b/sysutils/xentools41/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h
new file mode 100644
index 00000000000..8627e8a2470
--- /dev/null
+++ b/sysutils/xentools41/patches/patch-.._.._ipxe_src_arch_i386_include_librm.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-.._.._ipxe_src_arch_i386_include_librm.h,v 1.1 2013/04/11 19:57:53 joerg Exp $
+
+--- ../../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" ) )) \
diff --git a/sysutils/xentools41/patches/patch-.._.._ipxe_src_core_settings.c b/sysutils/xentools41/patches/patch-.._.._ipxe_src_core_settings.c
new file mode 100644
index 00000000000..5b5bdbc27d6
--- /dev/null
+++ b/sysutils/xentools41/patches/patch-.._.._ipxe_src_core_settings.c
@@ -0,0 +1,34 @@
+$NetBSD: patch-.._.._ipxe_src_core_settings.c,v 1.1 2013/04/11 19:57:53 joerg Exp $
+
+--- ../../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 );
diff --git a/sysutils/xentools41/patches/patch-.._.._ipxe_src_net_tls.c b/sysutils/xentools41/patches/patch-.._.._ipxe_src_net_tls.c
new file mode 100644
index 00000000000..6a3da777c66
--- /dev/null
+++ b/sysutils/xentools41/patches/patch-.._.._ipxe_src_net_tls.c
@@ -0,0 +1,69 @@
+$NetBSD: patch-.._.._ipxe_src_net_tls.c,v 1.1 2013/04/11 19:57:53 joerg Exp $
+
+--- ../../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;
+
diff --git a/sysutils/xentools41/patches/patch-.._Config.mk b/sysutils/xentools41/patches/patch-.._Config.mk
new file mode 100644
index 00000000000..9bf3cef29cd
--- /dev/null
+++ b/sysutils/xentools41/patches/patch-.._Config.mk
@@ -0,0 +1,22 @@
+$NetBSD: patch-.._Config.mk,v 1.1 2013/04/11 19:57:53 joerg Exp $
+
+--- ../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)
diff --git a/sysutils/xentools41/patches/patch-firmware_hvmloader_Makefile b/sysutils/xentools41/patches/patch-firmware_hvmloader_Makefile
new file mode 100644
index 00000000000..3c0d5803166
--- /dev/null
+++ b/sysutils/xentools41/patches/patch-firmware_hvmloader_Makefile
@@ -0,0 +1,13 @@
+$NetBSD: patch-firmware_hvmloader_Makefile,v 1.1 2013/04/11 19:57:53 joerg Exp $
+
+--- 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
diff --git a/sysutils/xentools41/patches/patch-libcx_xc__dom__boot.c b/sysutils/xentools41/patches/patch-libcx_xc__dom__boot.c
new file mode 100644
index 00000000000..a117a554f79
--- /dev/null
+++ b/sysutils/xentools41/patches/patch-libcx_xc__dom__boot.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-libcx_xc__dom__boot.c,v 1.1 2013/04/11 19:57:53 joerg Exp $
+
+--- 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);
diff --git a/sysutils/xentools41/patches/patch-xenstat_libxenstat_Makefile b/sysutils/xentools41/patches/patch-xenstat_libxenstat_Makefile
new file mode 100644
index 00000000000..3a438ef3676
--- /dev/null
+++ b/sysutils/xentools41/patches/patch-xenstat_libxenstat_Makefile
@@ -0,0 +1,21 @@
+$NetBSD: patch-xenstat_libxenstat_Makefile,v 1.1 2013/04/11 19:57:53 joerg Exp $
+
+--- 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) $@