aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-11-21 12:42:58 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-11-21 12:43:43 +0000
commitf4f4d1fa23450f96ed01334e35a1c22631ec666c (patch)
tree04360bd52e6caf2c506943d90096a0231de6e10f /main
parent7b535d19c19ac2e51e687354d7898ffd9706cee6 (diff)
downloadaports-f4f4d1fa23450f96ed01334e35a1c22631ec666c.tar.bz2
aports-f4f4d1fa23450f96ed01334e35a1c22631ec666c.tar.xz
main/xen: fix build with gcc9, claim maintainership
patches are from upstream ipxe
Diffstat (limited to 'main')
-rw-r--r--main/xen/APKBUILD7
-rw-r--r--main/xen/ipxe-gcc9.patch164
2 files changed, 168 insertions, 3 deletions
diff --git a/main/xen/APKBUILD b/main/xen/APKBUILD
index 031f3cdb65..e799a46b74 100644
--- a/main/xen/APKBUILD
+++ b/main/xen/APKBUILD
@@ -1,9 +1,8 @@
-# Contributor:
# Contributor: Roger Pau Monne <roger.pau@entel.upc.edu>
-# Maintainer:
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=xen
pkgver=4.12.1
-pkgrel=1
+pkgrel=2
pkgdesc="Xen hypervisor"
url="https://www.xenproject.org/"
arch="x86_64 armhf aarch64" # enable armv7 when builds with gcc8
@@ -208,6 +207,7 @@ source="https://downloads.xenproject.org/release/$pkgname/$pkgver/$pkgname-$pkgv
xenqemu-xattr-size-max.patch
hotplug-Linux-iscsi-block-handle-lun-1.patch
+ ipxe-gcc9.patch
xenstored.initd
xenstored.confd
@@ -462,6 +462,7 @@ f095ea373f36381491ad36f0662fb4f53665031973721256b23166e596318581da7cbb0146d0beb2
e76816c6ad0e91dc5f81947f266da3429b20e6d976c3e8c41202c6179532eec878a3f0913921ef3ac853c5dbad8082da3c9cd53b65081910516feb492577b7fc xen-fd-is-file.c
2094ea964fa610b2bf72fd2c7ede7e954899a75c0f5b08030cf1d74460fb759ade84866176e32f8fe29c921dfdc6dafd2b31e23ab9b0a3874d3dceeabdd1913b xenqemu-xattr-size-max.patch
8c9cfc6afca325df1d8026e21ed03fa8cd2c7e1a21a56cc1968301c5ab634bfe849951899e75d328951d7a41273d1e49a2448edbadec0029ed410c43c0549812 hotplug-Linux-iscsi-block-handle-lun-1.patch
+a853eed96acf6f690daf123186b40d97a5a81e0ac9ce9306bd56acb6d0a9d765cc3bc55e8c987fdae977aa57b747062d0d04ac1ab3f20a49a7742bc625ef5108 ipxe-gcc9.patch
52c43beb2596d645934d0f909f2d21f7587b6898ed5e5e7046799a8ed6d58f7a09c5809e1634fa26152f3fd4f3e7cfa07da7076f01b4a20cc8f5df8b9cb77e50 xenstored.initd
093f7fbd43faf0a16a226486a0776bade5dc1681d281c5946a3191c32d74f9699c6bf5d0ab8de9d1195a2461165d1660788e92a3156c9b3c7054d7b2d52d7ff0 xenstored.confd
3c86ed48fbee0af4051c65c4a3893f131fa66e47bf083caf20c9b6aa4b63fdead8832f84a58d0e27964bc49ec8397251b34e5be5c212c139f556916dc8da9523 xenconsoled.initd
diff --git a/main/xen/ipxe-gcc9.patch b/main/xen/ipxe-gcc9.patch
new file mode 100644
index 0000000000..a89b8e7149
--- /dev/null
+++ b/main/xen/ipxe-gcc9.patch
@@ -0,0 +1,164 @@
+diff --git a/tools/firmware/etherboot/patches/build-Fix-%s-directive-argument-is-null-error.patch b/tools/firmware/etherboot/patches/build-Fix-%s-directive-argument-is-null-error.patch
+new file mode 100644
+index 0000000..03a0bd4
+--- /dev/null
++++ b/tools/firmware/etherboot/patches/build-Fix-%s-directive-argument-is-null-error.patch
+@@ -0,0 +1,32 @@
++From 412acd7854de10e7194f362a6b1a3257a17974f7 Mon Sep 17 00:00:00 2001
++From: Valentine Barshak <gvaxon@gmail.com>
++Date: Sun, 9 Jun 2019 13:30:11 +0300
++Subject: [PATCH] [build] Fix "'%s' directive argument is null" error
++
++Use '%p' directive, and print handle's address if the address is null
++and the handle doesn't have a name. This fixes the following
++compilation error:
++
++ interface/efi/efi_debug.c:334:3: error: '%s' directive
++ argument is null [-Werror=format-overflow=]
++
++Signed-off-by: Valentine Barshak <gvaxon@gmail.com>
++Signed-off-by: Michael Brown <mcb30@ipxe.org>
++---
++ src/interface/efi/efi_debug.c | 3 +--
++ 1 file changed, 1 insertion(+), 2 deletions(-)
++
++diff --git a/src/interface/efi/efi_debug.c b/src/interface/efi/efi_debug.c
++index 8ea0a822d..de9b1af55 100644
++--- a/src/interface/efi/efi_debug.c
+++++ b/src/interface/efi/efi_debug.c
++@@ -331,8 +331,7 @@ void dbg_efi_protocols ( EFI_HANDLE handle ) {
++
++ /* Sanity check */
++ if ( ! handle ) {
++- printf ( "HANDLE %s could not retrieve protocols\n",
++- efi_handle_name ( handle ) );
+++ printf ( "HANDLE %p could not retrieve protocols\n", handle );
++ return;
++ }
++
+diff --git a/tools/firmware/etherboot/patches/build-Workaround-compilation-error-with-gcc-9.1.patch b/tools/firmware/etherboot/patches/build-Workaround-compilation-error-with-gcc-9.1.patch
+new file mode 100644
+index 0000000..8ce1620
+--- /dev/null
++++ b/tools/firmware/etherboot/patches/build-Workaround-compilation-error-with-gcc-9.1.patch
+@@ -0,0 +1,51 @@
++From 1dd56dbd11082fb622c2ed21cfaced4f47d798a6 Mon Sep 17 00:00:00 2001
++From: Valentine Barshak <gvaxon@gmail.com>
++Date: Mon, 22 Jul 2019 10:47:50 +0100
++Subject: [PATCH] [build] Workaround compilation error with gcc 9.1
++
++Compiling with gcc 9.1 generates lots of "taking address of packed
++member of ... may result in an unaligned pointer value" warnings.
++
++Some of these warnings are genuine, and indicate correctly that parts
++of iPXE currently require the CPU (or runtime environment) to support
++unaligned accesses. For example: the TCP/IP receive data path will
++attempt to access 32-bit fields that may not be aligned to a 32-bit
++boundary.
++
++Other warnings are either spurious (such as when the pointer is to a
++variable-length byte array, which can have no alignment requirement
++anyway) or unhelpful (such as when the pointer is used solely to
++provide a debug colour value for the DBGC() macro).
++
++There appears to be no easy way to silence the spurious warnings.
++Since the ability to perform unaligned accesses is already a
++requirement for iPXE, work around the problem by silencing this class
++of warnings.
++
++Signed-off-by: Valentine Barshak <gvaxon@gmail.com>
++Modified-by: Michael Brown <mcb30@ipxe.org>
++Signed-off-by: Michael Brown <mcb30@ipxe.org>
++---
++ src/Makefile.housekeeping | 9 +++++++++
++ 1 file changed, 9 insertions(+)
++
++diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping
++index f8334921b..4b09e81f0 100644
++--- a/src/Makefile.housekeeping
+++++ b/src/Makefile.housekeeping
++@@ -185,6 +185,15 @@ WNST_TEST = $(CC) -Wstringop-truncation -x c -c /dev/null -o /dev/null \
++ >/dev/null 2>&1
++ WNST_FLAGS := $(shell $(WNST_TEST) && $(ECHO) '-Wno-stringop-truncation')
++ WORKAROUND_CFLAGS += $(WNST_FLAGS)
+++
+++# gcc 9.1 generates warnings for taking address of packed member which
+++# may result in an unaligned pointer value. Inhibit the warnings.
+++#
+++WNAPM_TEST = $(CC) -Wno-address-of-packed-member -x c -c /dev/null \
+++ -o /dev/null >/dev/null 2>&1
+++WNAPM_FLAGS := $(shell $(WNAPM_TEST) && \
+++ $(ECHO) '-Wno-address-of-packed-member')
+++WORKAROUND_CFLAGS += $(WNAPM_FLAGS)
++ endif
++
++ # Some versions of gas choke on division operators, treating them as
+diff --git a/tools/firmware/etherboot/patches/series b/tools/firmware/etherboot/patches/series
+index 86cb300..07c2c4b 100644
+--- a/tools/firmware/etherboot/patches/series
++++ b/tools/firmware/etherboot/patches/series
+@@ -1 +1,4 @@
+ boot_prompt_option.patch
++zbin-Fix-compiler-warning-with-gcc-9.patch
++build-Workaround-compilation-error-with-gcc-9.1.patch
++build-Fix-%s-directive-argument-is-null-error.patch
+diff --git a/tools/firmware/etherboot/patches/zbin-Fix-compiler-warning-with-gcc-9.patch b/tools/firmware/etherboot/patches/zbin-Fix-compiler-warning-with-gcc-9.patch
+new file mode 100644
+index 0000000..e48307f
+--- /dev/null
++++ b/tools/firmware/etherboot/patches/zbin-Fix-compiler-warning-with-gcc-9.patch
+@@ -0,0 +1,54 @@
++From 956f6a7227b62ce98d7840439af17bbca04f0c86 Mon Sep 17 00:00:00 2001
++From: Michael Brown <mcb30@ipxe.org>
++Date: Mon, 21 Jan 2019 11:17:04 +0000
++Subject: [PATCH] [zbin] Fix compiler warning with GCC 9
++MIME-Version: 1.0
++Content-Type: text/plain; charset=UTF-8
++Content-Transfer-Encoding: 8bit
++
++GCC 9 warns that abs() may truncate its signed long argument. Fix by
++using labs() instead.
++
++Reported-by: Martin Liška <mliska@suse.cz>
++Signed-off-by: Michael Brown <mcb30@ipxe.org>
++---
++ src/util/zbin.c | 12 ++++++------
++ 1 file changed, 6 insertions(+), 6 deletions(-)
++
++diff --git a/src/util/zbin.c b/src/util/zbin.c
++index 75fba583f..3a4670b88 100644
++--- a/src/util/zbin.c
+++++ b/src/util/zbin.c
++@@ -386,16 +386,16 @@ static int process_zinfo_add ( struct input_file *input
++ ( ( 1UL << ( 8 * datasize ) ) - 1 ) : ~0UL );
++
++ if ( val < 0 ) {
++- fprintf ( stderr, "Add %s%#x+%#lx at %#zx %sflows field\n",
++- ( ( addend < 0 ) ? "-" : "" ), abs ( addend ), size,
+++ fprintf ( stderr, "Add %s%#lx+%#lx at %#zx %sflows field\n",
+++ ( ( addend < 0 ) ? "-" : "" ), labs ( addend ), size,
++ offset, ( ( addend < 0 ) ? "under" : "over" ) );
++ return -1;
++ }
++
++ if ( val & ~mask ) {
++- fprintf ( stderr, "Add %s%#x+%#lx at %#zx overflows %zd-byte "
+++ fprintf ( stderr, "Add %s%#lx+%#lx at %#zx overflows %zd-byte "
++ "field (%d bytes too big)\n",
++- ( ( addend < 0 ) ? "-" : "" ), abs ( addend ), size,
+++ ( ( addend < 0 ) ? "-" : "" ), labs ( addend ), size,
++ offset, datasize,
++ ( int )( ( val - mask - 1 ) * add->divisor ) );
++ return -1;
++@@ -414,9 +414,9 @@ static int process_zinfo_add ( struct input_file *input
++ }
++
++ if ( DEBUG ) {
++- fprintf ( stderr, "ADDx [%#zx,%#zx) (%s%#x+(%#zx/%#x)) = "
+++ fprintf ( stderr, "ADDx [%#zx,%#zx) (%s%#lx+(%#zx/%#x)) = "
++ "%#lx\n", offset, ( offset + datasize ),
++- ( ( addend < 0 ) ? "-" : "" ), abs ( addend ),
+++ ( ( addend < 0 ) ? "-" : "" ), labs ( addend ),
++ len, add->divisor, val );
++ }
++