aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-10-21 14:29:08 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-10-21 14:30:27 +0000
commit5d737bf73415d27f075e9dd0d6a58271419d97fc (patch)
tree79cab942b955c2d0084272674af1255a1f192de5 /main/xen
parent884c4d94f364f58f5356178d118e96b57317ae7e (diff)
downloadaports-5d737bf73415d27f075e9dd0d6a58271419d97fc.tar.bz2
aports-5d737bf73415d27f075e9dd0d6a58271419d97fc.tar.xz
main/xen: ipxe build fix
fixes issue similar to this: https://bugs.gentoo.org/show_bug.cgi?id=487254
Diffstat (limited to 'main/xen')
-rw-r--r--main/xen/0001-ipxe-dont-clobber-ebp.patch286
-rw-r--r--main/xen/APKBUILD8
2 files changed, 292 insertions, 2 deletions
diff --git a/main/xen/0001-ipxe-dont-clobber-ebp.patch b/main/xen/0001-ipxe-dont-clobber-ebp.patch
new file mode 100644
index 0000000000..2d2fe2f818
--- /dev/null
+++ b/main/xen/0001-ipxe-dont-clobber-ebp.patch
@@ -0,0 +1,286 @@
+From 65289dab529e8aefe6ef0e365739e05a8a574e0e Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Mon, 21 Oct 2013 14:22:17 +0000
+Subject: [PATCH] ipxe: dont clobber ebp
+
+build fix
+https://bugs.gentoo.org/show_bug.cgi?id=487254
+---
+ .../etherboot/patches/no-clobber-ebp.patch | 220 +++++++++++++++++++++
+ .../etherboot/patches/no-clobber-ebp2.patch | 26 +++
+ tools/firmware/etherboot/patches/series | 2 +
+ 3 files changed, 248 insertions(+)
+ create mode 100644 tools/firmware/etherboot/patches/no-clobber-ebp.patch
+ create mode 100644 tools/firmware/etherboot/patches/no-clobber-ebp2.patch
+
+diff --git a/tools/firmware/etherboot/patches/no-clobber-ebp.patch b/tools/firmware/etherboot/patches/no-clobber-ebp.patch
+new file mode 100644
+index 0000000..bbd8c06
+--- /dev/null
++++ b/tools/firmware/etherboot/patches/no-clobber-ebp.patch
+@@ -0,0 +1,220 @@
++From cba22d36b77da53890bd65fdadd0e63925687af0 Mon Sep 17 00:00:00 2001
++From: Michael Brown <mcb30@ipxe.org>
++Date: Wed, 25 Sep 2013 12:55:46 +0100
++Subject: [PATCH] [build] Work around bug in gcc >= 4.8
++MIME-Version: 1.0
++Content-Type: text/plain; charset=utf8
++Content-Transfer-Encoding: 8bit
++
++Commit 238050d ("[build] Work around bug in gcc >= 4.8") works around
++one instance of a bug in recent versions of gcc, in which "ebp" cannot
++be specified within an asm clobber list.
++
++Some versions of gcc seem to exhibit the same bug on other points in
++the codebase. Fix by changing all instances of "ebp" in a clobber
++list to use the push/pop %ebp workaround instead.
++
++Originally-implemented-by: Víctor Román Archidona <contacto@victor-roman.es>
++Signed-off-by: Michael Brown <mcb30@ipxe.org>
++---
++ src/arch/i386/drivers/net/undiload.c | 8 +++++---
++ src/arch/i386/firmware/pcbios/bios_console.c | 9 +++++----
++ src/arch/i386/image/bootsector.c | 7 ++++++-
++ src/arch/i386/image/elfboot.c | 7 ++++---
++ src/arch/i386/image/nbi.c | 16 ++++++++++------
++ src/arch/i386/interface/pxeparent/pxeparent.c | 8 +++++---
++ 6 files changed, 35 insertions(+), 20 deletions(-)
++
++diff --git a/src/arch/i386/drivers/net/undiload.c b/src/arch/i386/drivers/net/undiload.c
++index f0f15e6..77134dc 100644
++--- a/src/arch/i386/drivers/net/undiload.c
+++++ b/src/arch/i386/drivers/net/undiload.c
++@@ -103,13 +103,15 @@ int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) {
++
++ /* Call loader */
++ undi_loader_entry = undirom->loader_entry;
++- __asm__ __volatile__ ( REAL_CODE ( "pushw %%ds\n\t"
+++ __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
+++ "pushw %%ds\n\t"
++ "pushw %%ax\n\t"
++ "lcall *undi_loader_entry\n\t"
++- "addw $4, %%sp\n\t" )
+++ "popl %%ebp\n\t" /* discard */
+++ "popl %%ebp\n\t" /* gcc bug */ )
++ : "=a" ( exit )
++ : "a" ( __from_data16 ( &undi_loader ) )
++- : "ebx", "ecx", "edx", "esi", "edi", "ebp" );
+++ : "ebx", "ecx", "edx", "esi", "edi" );
++
++ if ( exit != PXENV_EXIT_SUCCESS ) {
++ /* Clear entry point */
++diff --git a/src/arch/i386/firmware/pcbios/bios_console.c b/src/arch/i386/firmware/pcbios/bios_console.c
++index 213ebd9..79e4370 100644
++--- a/src/arch/i386/firmware/pcbios/bios_console.c
+++++ b/src/arch/i386/firmware/pcbios/bios_console.c
++@@ -167,7 +167,8 @@ static void bios_putchar ( int character ) {
++ return;
++
++ /* Print character with attribute */
++- __asm__ __volatile__ ( REAL_CODE ( "sti\n\t"
+++ __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
+++ "sti\n\t"
++ /* Skip non-printable characters */
++ "cmpb $0x20, %%al\n\t"
++ "jb 1f\n\t"
++@@ -188,11 +189,11 @@ static void bios_putchar ( int character ) {
++ "xorw %%bx, %%bx\n\t"
++ "movb $0x0e, %%ah\n\t"
++ "int $0x10\n\t"
++- "cli\n\t" )
+++ "cli\n\t"
+++ "popl %%ebp\n\t" /* gcc bug */ )
++ : "=a" ( discard_a ), "=b" ( discard_b ),
++ "=c" ( discard_c )
++- : "a" ( character ), "b" ( bios_attr )
++- : "ebp" );
+++ : "a" ( character ), "b" ( bios_attr ) );
++ }
++
++ /**
++diff --git a/src/arch/i386/image/bootsector.c b/src/arch/i386/image/bootsector.c
++index ab3cf94..cb164fd 100644
++--- a/src/arch/i386/image/bootsector.c
+++++ b/src/arch/i386/image/bootsector.c
++@@ -80,6 +80,8 @@ int call_bootsector ( unsigned int segment, unsigned int offset,
++ "movw %%ss, %%ax\n\t"
++ "movw %%ax, %%cs:saved_ss\n\t"
++ "movw %%sp, %%cs:saved_sp\n\t"
+++ /* Save frame pointer (gcc bug) */
+++ "movl %%ebp, %%cs:saved_ebp\n\t"
++ /* Jump to boot sector */
++ "pushw %%bx\n\t"
++ "pushw %%di\n\t"
++@@ -99,11 +101,14 @@ int call_bootsector ( unsigned int segment, unsigned int offset,
++ "sti\n\t"
++ "lret\n\t"
++ /* Preserved variables */
+++ "\nsaved_ebp: .long 0\n\t"
++ "\nsaved_ss: .word 0\n\t"
++ "\nsaved_sp: .word 0\n\t"
++ "\nsaved_retaddr: .word 0\n\t"
++ /* Boot failure return point */
++ "\nbootsector_exec_fail:\n\t"
+++ /* Restore frame pointer (gcc bug) */
+++ "movl %%cs:saved_ebp, %%ebp\n\t"
++ /* Restore stack pointer */
++ "movw %%cs:saved_ss, %%ax\n\t"
++ "movw %%ax, %%ss\n\t"
++@@ -114,7 +119,7 @@ int call_bootsector ( unsigned int segment, unsigned int offset,
++ "=d" ( discard_d )
++ : "b" ( segment ), "D" ( offset ),
++ "d" ( drive )
++- : "eax", "ecx", "esi", "ebp" );
+++ : "eax", "ecx", "esi" );
++
++ DBG ( "Booted disk returned via INT 18 or 19\n" );
++
++diff --git a/src/arch/i386/image/elfboot.c b/src/arch/i386/image/elfboot.c
++index a867a95..0f6957f 100644
++--- a/src/arch/i386/image/elfboot.c
+++++ b/src/arch/i386/image/elfboot.c
++@@ -60,10 +60,11 @@ static int elfboot_exec ( struct image *image ) {
++
++ /* Jump to OS with flat physical addressing */
++ DBGC ( image, "ELF %p starting execution at %lx\n", image, entry );
++- __asm__ __volatile__ ( PHYS_CODE ( "call *%%edi\n\t" )
+++ __asm__ __volatile__ ( PHYS_CODE ( "pushl %%ebp\n\t" /* gcc bug */
+++ "call *%%edi\n\t"
+++ "popl %%ebp\n\t" /* gcc bug */ )
++ : : "D" ( entry )
++- : "eax", "ebx", "ecx", "edx", "esi", "ebp",
++- "memory" );
+++ : "eax", "ebx", "ecx", "edx", "esi", "memory" );
++
++ DBGC ( image, "ELF %p returned\n", image );
++
++diff --git a/src/arch/i386/image/nbi.c b/src/arch/i386/image/nbi.c
++index d3e523e..9904614 100644
++--- a/src/arch/i386/image/nbi.c
+++++ b/src/arch/i386/image/nbi.c
++@@ -248,7 +248,8 @@ static int nbi_boot16 ( struct image *image, struct imgheader *imgheader ) {
++ imgheader->execaddr.segoff.offset );
++
++ __asm__ __volatile__ (
++- REAL_CODE ( "pushw %%ds\n\t" /* far pointer to bootp data */
+++ REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
+++ "pushw %%ds\n\t" /* far pointer to bootp data */
++ "pushw %%bx\n\t"
++ "pushl %%esi\n\t" /* location */
++ "pushw %%cs\n\t" /* lcall execaddr */
++@@ -258,13 +259,14 @@ static int nbi_boot16 ( struct image *image, struct imgheader *imgheader ) {
++ "pushl %%edi\n\t"
++ "lret\n\t"
++ "\n2:\n\t"
++- "addw $8,%%sp\n\t" /* clean up stack */ )
+++ "addw $8,%%sp\n\t" /* clean up stack */
+++ "popl %%ebp\n\t" /* gcc bug */ )
++ : "=a" ( rc ), "=D" ( discard_D ), "=S" ( discard_S ),
++ "=b" ( discard_b )
++ : "D" ( imgheader->execaddr.segoff ),
++ "S" ( imgheader->location ),
++ "b" ( __from_data16 ( basemem_packet ) )
++- : "ecx", "edx", "ebp" );
+++ : "ecx", "edx" );
++
++ return rc;
++ }
++@@ -288,11 +290,13 @@ static int nbi_boot32 ( struct image *image, struct imgheader *imgheader ) {
++
++ /* Jump to OS with flat physical addressing */
++ __asm__ __volatile__ (
++- PHYS_CODE ( "pushl %%ebx\n\t" /* bootp data */
+++ PHYS_CODE ( "pushl %%ebp\n\t" /* gcc bug */
+++ "pushl %%ebx\n\t" /* bootp data */
++ "pushl %%esi\n\t" /* imgheader */
++ "pushl %%eax\n\t" /* loaderinfo */
++ "call *%%edi\n\t"
++- "addl $12, %%esp\n\t" /* clean up stack */ )
+++ "addl $12, %%esp\n\t" /* clean up stack */
+++ "popl %%ebp\n\t" /* gcc bug */ )
++ : "=a" ( rc ), "=D" ( discard_D ), "=S" ( discard_S ),
++ "=b" ( discard_b )
++ : "D" ( imgheader->execaddr.linear ),
++@@ -300,7 +304,7 @@ static int nbi_boot32 ( struct image *image, struct imgheader *imgheader ) {
++ imgheader->location.offset ),
++ "b" ( virt_to_phys ( basemem_packet ) ),
++ "a" ( virt_to_phys ( &loaderinfo ) )
++- : "ecx", "edx", "ebp", "memory" );
+++ : "ecx", "edx", "memory" );
++
++ return rc;
++ }
++diff --git a/src/arch/i386/interface/pxeparent/pxeparent.c b/src/arch/i386/interface/pxeparent/pxeparent.c
++index b2c6ffb..9d2948c 100644
++--- a/src/arch/i386/interface/pxeparent/pxeparent.c
+++++ b/src/arch/i386/interface/pxeparent/pxeparent.c
++@@ -143,16 +143,18 @@ int pxeparent_call ( SEGOFF16_t entry, unsigned int function,
++ /* Call real-mode entry point. This calling convention will
++ * work with both the !PXE and the PXENV+ entry points.
++ */
++- __asm__ __volatile__ ( REAL_CODE ( "pushw %%es\n\t"
+++ __asm__ __volatile__ ( REAL_CODE ( "pushl %%ebp\n\t" /* gcc bug */
+++ "pushw %%es\n\t"
++ "pushw %%di\n\t"
++ "pushw %%bx\n\t"
++ "lcall *pxeparent_entry_point\n\t"
++- "addw $6, %%sp\n\t" )
+++ "addw $6, %%sp\n\t"
+++ "popl %%ebp\n\t" /* gcc bug */ )
++ : "=a" ( exit ), "=b" ( discard_b ),
++ "=D" ( discard_D )
++ : "b" ( function ),
++ "D" ( __from_data16 ( &pxeparent_params ) )
++- : "ecx", "edx", "esi", "ebp" );
+++ : "ecx", "edx", "esi" );
++
++ /* Determine return status code based on PXENV_EXIT and
++ * PXENV_STATUS
++--
++1.7.9
++
+diff --git a/tools/firmware/etherboot/patches/no-clobber-ebp2.patch b/tools/firmware/etherboot/patches/no-clobber-ebp2.patch
+new file mode 100644
+index 0000000..6b9ac07
+--- /dev/null
++++ b/tools/firmware/etherboot/patches/no-clobber-ebp2.patch
+@@ -0,0 +1,26 @@
++--- a/src/arch/i386/interface/pxe/pxe_call.c.orig
+++++ b/src/arch/i386/interface/pxe/pxe_call.c
++@@ -265,11 +265,13 @@
++
++ /* Far call to PXE NBP */
++ __asm__ __volatile__ ( REAL_CODE ( "movw %%cx, %%es\n\t"
+++ "pushl %%ebp\n\t" /* gcc bug */
++ "pushw %%es\n\t"
++ "pushw %%di\n\t"
++ "sti\n\t"
++ "lcall $0, $0x7c00\n\t"
++- "addw $4, %%sp\n\t" )
+++ "addw $4, %%sp\n\t"
+++ "popl %%ebp\n\t" ) /* gcc bug */
++ : "=a" ( rc ), "=b" ( discard_b ),
++ "=c" ( discard_c ), "=d" ( discard_d ),
++ "=D" ( discard_D )
++@@ -277,7 +279,7 @@
++ "c" ( rm_cs ),
++ "d" ( virt_to_phys ( &pxenv ) ),
++ "D" ( __from_text16 ( &ppxe ) )
++- : "esi", "ebp", "memory" );
+++ : "esi", "memory" );
++
++ return rc;
++ }
+diff --git a/tools/firmware/etherboot/patches/series b/tools/firmware/etherboot/patches/series
+index 5bd7df8..154e65b 100644
+--- a/tools/firmware/etherboot/patches/series
++++ b/tools/firmware/etherboot/patches/series
+@@ -2,3 +2,5 @@ boot_prompt_option.patch
+ build_fix_1.patch
+ build_fix_2.patch
+ build_fix_3.patch
++no-clobber-ebp.patch
++no-clobber-ebp2.patch
+--
+1.8.4.1
+
diff --git a/main/xen/APKBUILD b/main/xen/APKBUILD
index 653b36dc09..300161fe65 100644
--- a/main/xen/APKBUILD
+++ b/main/xen/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=xen
pkgver=4.3.0
-pkgrel=5
+pkgrel=6
pkgdesc="Xen hypervisor"
url="http://www.xen.org/"
arch="x86_64"
@@ -34,6 +34,7 @@ source="http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.g
qemu-xen-vnc-robustness.patch
hotplug-vif-vtrill.patch
+ 0001-ipxe-dont-clobber-ebp.patch
xenstored.initd
xenstored.confd
@@ -66,7 +67,7 @@ prepare() {
find -name '*.mk' -o -name 'Make*' | xargs sed -i -e 's/-Werror//g'
unset CFLAGS
- unset LDFLAGS
+ unset LDFLAGS
}
# Unset CFLAGS and LDFLAGS because the xen build system
@@ -198,6 +199,7 @@ a4097e06a7e000ed00f4607db014d277 qemu-xen-websocket.patch
f8ea5786b0a6157b9cb3e67e323b592c qemu-xen-websocket-plain-hack.patch
066acc4af962c57e2f6cc0286bfdc270 qemu-xen-vnc-robustness.patch
e449bb3359b490804ffc7b0ae08d62a0 hotplug-vif-vtrill.patch
+229539a822e14a6a62babffd71ecfbf3 0001-ipxe-dont-clobber-ebp.patch
a90c36642f0701a8aaa4ebe4dde430f5 xenstored.initd
b017ccdd5e1c27bbf1513e3569d4ff07 xenstored.confd
ed262f15fb880badb53575539468646c xenconsoled.initd
@@ -224,6 +226,7 @@ e9f6c482fc449e0b540657a8988ad31f2e680b8933e50e6486687a52f6a9ed04 qemu-xen-webso
6c4c184462d47e7fd00e8d8f6bf12b33f6cf486f00415c1934ecf6c2b62f69c1 qemu-xen-websocket-plain-hack.patch
f34590761b627d69d2033c1350f2403e9d572b2172e852e3b30e7630bc009a9f qemu-xen-vnc-robustness.patch
dd1e784bc455eb62cb85b3fa24bfc34f575ceaab9597ef6a2f1ee7ff7b3cae0a hotplug-vif-vtrill.patch
+751ef06569de66578b8713dc170976832b0671ac2696f32eb9ad69d60332d594 0001-ipxe-dont-clobber-ebp.patch
868c77d689ae54b7041da169bfaa01868503337d4105a071eb771f4ec5a0543d xenstored.initd
ea9171e71ab3d33061979bcf3bb737156192aa4b0be4d1234438ced75b6fdef3 xenstored.confd
93bea2eb90ea1b4628854c8141dd351bbd1fbc5959b12795447ea933ad025f01 xenconsoled.initd
@@ -250,6 +253,7 @@ bda9105793f2327e1317991762120d0668af0e964076b18c9fdbfd509984b2e88d85df95702c46b2
692e29205fa3d0a6e4d1be69a242d55c44a1fee26c594e6e46d8809339f93dcdc31c0735723a46f63ae0a727741bdc8a899bb1ce9103a2cd701b236f63a17fa2 qemu-xen-websocket-plain-hack.patch
a52aa303dd3d9abae3ddb3af788b1f1f7a6bd9eb0c13f67f0995190238f7638f7909ea7d7bf7d778c64edbb6bdae87a5d5654e12440abded083e4818ff204b47 qemu-xen-vnc-robustness.patch
f095ea373f36381491ad36f0662fb4f53665031973721256b23166e596318581da7cbb0146d0beb2446729adfdb321e01468e377793f6563a67d68b8b0f7ffe3 hotplug-vif-vtrill.patch
+c3a1b270347a99c8ce21118010ad8d817b4462a31cc5c75352faa7086969ef0646f3f4d0922d85c2e504cff091ce7e9fe79c92f983c2ba4af2fae85c52c3835a 0001-ipxe-dont-clobber-ebp.patch
880584e0866b1efcf3b7a934f07072ec84c13c782e3e7a15848d38ba8af50259d46db037dca1e037b15274989f2c22acd1134954dd60c59f4ee693b417d03e0d xenstored.initd
100cf4112f401f45c1e4e885a5074698c484b40521262f6268fad286498e95f4c51e746f0e94eb43a590bb8e813a397bb53801ccacebec9541020799d8d70514 xenstored.confd
12f981b2459c65d66e67ec0b32d0d19b95a029bc54c2a79138cfe488d3524a22e51860f755abfe25ddcdaf1b27f2ded59b6e350b9d5f8791193d00e2d3673137 xenconsoled.initd