summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-emulation/xen-pvgrub
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-emulation/xen-pvgrub')
-rw-r--r--app-emulation/xen-pvgrub/Manifest8
-rw-r--r--app-emulation/xen-pvgrub/files/newlib-implicits.patch149
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4-fix_dotconfig-gcc.patch245
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4.2.1-externals.patch83
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4.3-externals.patch75
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4.3-fix_dotconfig-gcc.patch220
-rw-r--r--app-emulation/xen-pvgrub/files/xen-4.4-fix_dotconfig-gcc.patch171
-rw-r--r--app-emulation/xen-pvgrub/files/xen-pvgrub-4-qa.patch35
-rw-r--r--app-emulation/xen-pvgrub/files/xen-pvgrub-4.2-jserver.patch32
-rw-r--r--app-emulation/xen-pvgrub/files/xen-pvgrub-4.2.3-qa.patch34
-rw-r--r--app-emulation/xen-pvgrub/files/xen-pvgrub-4.3.1-qa.patch30
-rw-r--r--app-emulation/xen-pvgrub/metadata.xml5
-rw-r--r--app-emulation/xen-pvgrub/xen-pvgrub-4.2.5.ebuild162
-rw-r--r--app-emulation/xen-pvgrub/xen-pvgrub-4.5.1.ebuild143
14 files changed, 1392 insertions, 0 deletions
diff --git a/app-emulation/xen-pvgrub/Manifest b/app-emulation/xen-pvgrub/Manifest
new file mode 100644
index 000000000000..28309594b4ae
--- /dev/null
+++ b/app-emulation/xen-pvgrub/Manifest
@@ -0,0 +1,8 @@
+DIST grub-0.97.tar.gz 971783 SHA256 4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b SHA512 c2bc9ffc8583aeae71cee9ddcc4418969768d4e3764d47307da54f93981c0109fb07d84b061b3a3628bd00ba4d14a54742bc04848110eb3ae8ca25dbfbaabadb WHIRLPOOL 0ad7f5dc035e2a3ad5fd29b6388f06fd12a8cc694117b4cbd42b5302433aa522db23566222d35219fe17fb95edb5090553156198507f70208eda5d858fd52dd5
+DIST lwip-1.3.0.tar.gz 398933 SHA256 772e4d550e07826665ed0528c071dd5404ef7dbe1825a38c8adbc2a00bca948f SHA512 1465b58279af1647f909450e394fe002ca165f0ff4a0254bfa9fe0e64316f50facdde2729d79a4e632565b4500cf4d6c74192ac0dd3bc9fe09129bbd67ba089d WHIRLPOOL 63bdd9eb70f168ba2006a8f4bbe166b68528abe8364b23cdc1d468ccc4b137bb3447bf90695920f016e09d53d3b93ccf6e3697b3c46840f00b794789cb424acc
+DIST newlib-1.16.0.tar.gz 12024353 SHA256 db426394965c48c1d29023e1cc6d965ea6b9a9035d8a849be2750ca4659a3d07 SHA512 40eb96bbc6736a16b6399e0cdb73e853d0d90b685c967e77899183446664d64570277a633fdafdefc351b46ce210a99115769a1d9f47ac749d7e82837d4d1ac3 WHIRLPOOL 47f7afd525f482d79d9e964f0e75ee8a77e59551bd19cd94f9b95ac3af9406afa381c9d8d224f76eb568441ab613b2b194f8e5be50aa222f9ed2d9b9761829db
+DIST pciutils-2.2.9.tar.bz2 212265 SHA256 f60ae61cfbd5da1d849d0beaa21f593c38dac9359f0b3ddc612f447408265b24 SHA512 2b3d98d027e46d8c08037366dde6f0781ca03c610ef2b380984639e4ef39899ed8d8b8e4cd9c9dc54df101279b95879bd66bfd4d04ad07fef41e847ea7ae32b5 WHIRLPOOL ce801947fcf7ba0b56710029f25e746d3e03a80699af9d3570efcd417b12b546264f286b2e78b1402cca766c08e35bdd0ff0a692ab4ad419295f00bcfe91130e
+DIST polarssl-1.1.4-gpl.tgz 611340 SHA256 2d29fd04a0d0ba29dae6bd29fb418944c08d3916665dcca74afb297ef37584b6 SHA512 88da614e4d3f4409c4fd3bb3e44c7587ba051e3fed4e33d526069a67e8180212e1ea22da984656f50e290049f60ddca65383e5983c0f8884f648d71f698303ad WHIRLPOOL 39448c00dda142a836a78381b446c7b586272a44d8afc867a7ea702228f105bb2adffe757bd6c23af090cff64ef32e7af0c373dccc5145ff4c11552cf3f28383
+DIST xen-4.2.5.tar.gz 15671925 SHA256 3cf440866315e8085050eb0586f0447b6b47a08dbed6a72226bf5ed5d89ec567 SHA512 42c0fc241952fc55fc44480fb6752b004b54ae40e946159ec047adf229b65cbfbd810271d01b064ad8fdbddb73c640dcdcb6bc19f91e8968829889c129920dac WHIRLPOOL 762a91c0111892b33e6bd3e7f7714709b04697ad7c2b0919fef6cc9570a343a77fd5a2b82833e75dac9d12d4e41acdcf0743b0d593595910ddd326f5cd721368
+DIST xen-4.5.1.tar.gz 18410400 SHA256 668c11d4fca67ac44329e369f810356eacd37b28d28fb96e66aac77f3c5e1371 SHA512 9436243e26bc64bc836a179abdc3a6b1b6fa9d3f2170453092c18be71fa62e18cd4465a9154c0f28a7ac8d69d08361ba1defef240a51197f058c012c3855ba04 WHIRLPOOL 71d8559f86683dd9fb3eb09d3f602de227f281fbd3c8cc258bfdb67c425d9e7c4d21cb0284c123e4263262c1b821fea6d28109861ce60d627f6426d352808d99
+DIST zlib-1.2.3.tar.gz 496597 SHA256 1795c7d067a43174113fdf03447532f373e1c6c57c08d61d9e4e9be5e244b05e SHA512 021b958fcd0d346c4ba761bcf0cc40f3522de6186cf5a0a6ea34a70504ce9622b1c2626fce40675bc8282cf5f5ade18473656abc38050f72f5d6480507a2106e WHIRLPOOL 8fd7010faf6a48a9c7ff4bcfe3ce4fe9061eb541259e0a2d0def214e8c4becf2b22e8d6f96f65ca827abffeaa9d96e95ed2402844f99835f7b079fc9f3e84276
diff --git a/app-emulation/xen-pvgrub/files/newlib-implicits.patch b/app-emulation/xen-pvgrub/files/newlib-implicits.patch
new file mode 100644
index 000000000000..73c04931b31d
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/newlib-implicits.patch
@@ -0,0 +1,149 @@
+diff -ur newlib-1.16.0.orig/newlib/libc/stdlib/wcstoull.c newlib-1.16.0/newlib/libc/stdlib/wcstoull.c
+--- newlib/libc/stdlib/wcstoull.c 2007-07-07 04:03:28.000000000 +0800
++++ newlib/libc/stdlib/wcstoull.c 2012-12-02 14:19:40.905136553 +0800
+@@ -124,7 +124,7 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <reent.h>
+-
++#include <wchar.h>
+ #ifndef _REENT_ONLY
+
+ unsigned long long
+diff -ur newlib-1.16.0.orig/newlib/doc/makedoc.c
+newlib-1.16.0/newlib/doc/makedoc.c
+--- newlib/doc/makedoc.c 2007-01-03 01:59:59.000000000 +0900
++++ newlib/doc/makedoc.c 2012-12-02 16:53:42.700289294 +0800
+@@ -39,7 +39,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <ctype.h>
+-
++#include <string.h>
+ #define DEF_SIZE 5000
+ #define STACK 50
+
+diff -ur newlib-1.16.0.orig/newlib/libc/reent/lseek64r.c newlib-1.16.0/newlib/libc/reent/lseek64r.c
+--- newlib/libc/reent/lseek64r.c 2003-06-04 03:48:07.000000000 +0800
++++ newlib/libc/reent/lseek64r.c 2012-12-02 18:29:45.435760985 +0800
+@@ -1,8 +1,8 @@
+ /* Reentrant versions of lseek system call. */
+
+-#include <reent.h>
++#include "../include/reent.h"
+ #include <unistd.h>
+-#include <_syslist.h>
++#include "../include/_syslist.h"
+
+ /* Some targets provides their own versions of this functions. Those
+ targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
+diff -ur newlib-1.16.0.orig/newlib/libc/stdio64/fseeko64.c newlib-1.16.0/newlib/libc/stdio64/fseeko64.c
+--- newlib/libc/stdio64/fseeko64.c 2007-07-14 04:37:53.000000000 +0800
++++ newlib/libc/stdio64/fseeko64.c 2012-12-02 18:26:29.955778906 +0800
+@@ -119,7 +119,7 @@
+ ptr->_errno = EOVERFLOW;
+ return EOF;
+ }
+- return (_off64_t) _fseeko_r (ptr, fp, offset, whence);
++ return (_off64_t) _fseeko64_r (ptr, fp, offset, whence);
+ }
+
+ /* Make sure stdio is set up. */
+
+diff -ur newlib-1.16.0.orig/newlib/libc/reent/fstat64r.c newlib-1.16.0/newlib/libc/reent/fstat64r.c
+--- newlib/libc/reent/fstat64r.c 2012-12-03 13:17:26.569703981 +0800
++++ newlib/libc/reent/fstat64r.c 2003-06-04 03:48:07.000000000 +0800
+@@ -1,10 +1,10 @@
+ /* Reentrant versions of fstat system call. This implementation just
+ calls the fstat system call. */
+
+-#include <reent.h>
++#include "../include/reent.h">
+ #include <unistd.h>
+ #include <sys/stat.h>
+-#include <_syslist.h>
++#include "../include/_syslist.h"
+
+ #ifdef __LARGE64_FILES
+
+diff -ur newlib-1.16.0.orig/libgloss/i386/cygmon-gmon.c newlib-1.16.0/libgloss/i386/cygmon-gmon.c
+--- libgloss/i386/cygmon-gmon.c 2002-10-26 03:18:46.000000000 +0800
++++ libgloss/i386/cygmon-gmon.c 2012-12-03 14:38:41.454257066 +0800
+@@ -68,6 +68,9 @@
+
+ #include "cygmon-gmon.h"
+
++#include <unistd.h>
++#include <stdlib.h>
++#include <strings.h>
+ /*
+ * froms is actually a bunch of unsigned shorts indexing tos
+ */
+@@ -78,6 +78,8 @@
+ static char *s_lowpc = 0;
+ static char *s_highpc = 0;
+ static unsigned long s_textsize = 0;
++extern void profil_write(int, char*, int);
++extern int moncontrol (int);
+
+ static int ssiz;
+ static char *sbuf;
+diff -ur newlib-1.16.0.orig/newlib/libc/include/_syslist.h
+newlib-1.16.0/newlib/libc/include/_syslist.h
+--- newlib/libc/include/_syslist.h 2005-08-23 05:13:35.000000000 +0800
++++ newlib/libc/include/_syslist.h 2012-12-03 17:20:03.092369483 +0800
+@@ -2,6 +2,7 @@
+ and only provide C names, so that we end up in violation of ANSI */
+ #ifndef __SYSLIST_H
+ #define __SYSLIST_H
++#include <sys/types.h>
+
+ #ifdef MISSING_SYSCALL_NAMES
+ #define _close close
+
+#diff -ur newlib-1.16.0.orig/newlib/libc/Makefile.in newlib-1.16.0/newlib/libc/Makefile.in
+#--- newlib/libc/Makefile.in 2007-05-25 01:33:30.000000000 +0800
+#+++ newlib/libc/Makefile.in 2012-12-03 21:52:05.621873084 +0800
+diff -ur newlib-1.16.0.orig/newlib/libc/stdio64/ftello64.c newlib-1.16.0/newlib/libc/stdio64/ftello64.c
+--- newlib/libc/stdio64/ftello64.c 2007-07-14 04:37:53.000000000 +0800
++++ newlib/libc/stdio64/ftello64.c 2012-12-04 18:34:46.491509484 +0800
+@@ -93,7 +93,7 @@
+
+ /* Only do 64-bit tell on large file. */
+ if (!(fp->_flags & __SL64))
+- return (_off64_t) _ftello_r (ptr, fp);
++ return (_off64_t) _ftello64_r (ptr, fp);
+
+ /* Ensure stdio is set up. */
+
+diff -ur newlib-1.16.0.orig/newlib/libc/reent/open64r.c newlib-1.16.0/newlib/libc/reent/open64r.c
+--- newlib/libc/reent/open64r.c 2002-08-27 02:56:06.000000000 +0800
++++ newlib/libc/reent/open64r.c 2012-12-04 20:06:10.044006769 +0800
+@@ -1,8 +1,8 @@
+ /* Reentrant versions of open system call. */
+
+-#include <reent.h>
++#include "../include/reent.h">
+ #include <unistd.h>
+-#include <fcntl.h>
++#include <sys/_default_fcntl.h>
+ #include <_syslist.h>
+
+ #ifdef __LARGE64_FILES
+diff -ur newlib-1.16.0.orig/newlib/libc/reent/signalr.c newlib-1.16.0/newlib/libc/reent/signalr.c
+--- newlib/libc/reent/signalr.c 2012-12-05 07:33:25.623393126 +0800
++++ newlib/libc/reent/signalr.c 2012-12-05 07:34:03.943389613 +0800
+@@ -1,10 +1,10 @@
+ /* Reentrant versions of syscalls need to support signal/raise.
+ These implementations just call the usual system calls. */
+
+-#include <reent.h>
++#include "../include/reent.h"
+ #include <signal.h>
+ #include <unistd.h>
+-#include <_syslist.h>
++#include "../include/_syslist.h"
+
+ /* Some targets provides their own versions of these functions. Those
+ targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
+
diff --git a/app-emulation/xen-pvgrub/files/xen-4-fix_dotconfig-gcc.patch b/app-emulation/xen-pvgrub/files/xen-4-fix_dotconfig-gcc.patch
new file mode 100644
index 000000000000..4e08a30f323e
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4-fix_dotconfig-gcc.patch
@@ -0,0 +1,245 @@
+# Fix gcc-4.6
+diff -ur xen-4.2.0.orig/extras/mini-os/minios.mk xen-4.2.0/extras/mini-os/minios.mk
+--- extras/mini-os/minios.mk 2012-09-17 18:21:17.000000000 +0800
++++ extras/mini-os/minios.mk 2012-12-05 14:01:10.653260260 +0800
+@@ -6,7 +6,7 @@
+
+ # Define some default flags.
+ # NB. '-Wcast-qual' is nasty, so I omitted it.
+-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
++DEF_CFLAGS += -fno-builtin -Wall -Wredundant-decls -Wno-format -Wno-redundant-decls
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+diff -ur xen-4.2.0.orig/tools/libxc/Makefile xen-4.2.0/tools/libxc/Makefile
+--- tools/libxc/Makefile 2012-09-17 18:21:18.000000000 +0800
++++ tools/libxc/Makefile 2012-12-05 14:01:10.653260260 +0800
+@@ -73,7 +73,7 @@
+
+ -include $(XEN_TARGET_ARCH)/Makefile
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ CFLAGS += -I. $(CFLAGS_xeninclude)
+
+ # Needed for posix_fadvise64() in xc_linux.c
+# Drop .config
+diff -ur xen-4.2.0.orig/Config.mk xen-4.2.0/Config.mk
+--- Config.mk 2012-09-17 18:23:12.000000000 +0800
++++ Config.mk 2012-12-05 14:01:10.641260261 +0800
+@@ -7,7 +7,6 @@ Drop .config
+ # fallback for older make
+ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
+--include $(XEN_ROOT)/.config
+
+ # A debug build of Xen and tools?
+ debug ?= n
+@@ -24,7 +24,7 @@
+
+ # Tools to run on system hosting the build
+ HOSTCC = gcc
+-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS = -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
+
+ DISTDIR ?= $(XEN_ROOT)/dist
+@@ -156,7 +156,7 @@
+
+ CFLAGS += -std=gnu99
+
+-CFLAGS += -Wall -Wstrict-prototypes
++CFLAGS += -Wstrict-prototypes
+
+ # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
+ # and is over-zealous with the printf format lint
+diff -ur xen-4.2.1.orig/tools/blktap2/drivers/Makefile xen-4.2.1/tools/blktap2/drivers/Makefile
+--- tools/blktap2/drivers/Makefile 2012-12-17 23:00:11.000000000 +0800
++++ tools/blktap2/drivers/Makefile 2013-01-30 12:31:43.539941099 +0800
+@@ -9,7 +9,7 @@
+ LOCK_UTIL = lock-util
+ INST_DIR = $(SBINDIR)
+
+-CFLAGS += -Werror -g
++CFLAGS += -g
+ CFLAGS += -Wno-unused
+ CFLAGS += -fno-strict-aliasing
+ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
+diff -ur xen-4.2.1.orig/tools/debugger/gdbsx/Rules.mk xen-4.2.1/tools/debugger/gdbsx/Rules.mk
+--- tools/debugger/gdbsx/Rules.mk 2012-12-17 23:00:22.000000000 +0800
++++ tools/debugger/gdbsx/Rules.mk 2013-01-30 12:31:43.516941098 +0800
+@@ -1,4 +1,4 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ # (gcc 4.3x and later) -Wconversion -Wno-sign-conversion
+diff -ur xen-4.2.1.orig/tools/debugger/xenitp/Makefile xen-4.2.1/tools/debugger/xenitp/Makefile
+--- tools/debugger/xenitp/Makefile 2012-12-17 23:00:22.000000000 +0800
++++ tools/debugger/xenitp/Makefile 2013-01-30 12:31:43.516941098 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-#CFLAGS += -Werror -g -O0
++#CFLAGS += -g -O0
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+
+diff -ur xen-4.2.1.orig/tools/libaio/harness/Makefile xen-4.2.1/tools/libaio/harness/Makefile
+--- tools/libaio/harness/Makefile 2012-12-17 23:00:35.000000000 +0800
++++ tools/libaio/harness/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -4,7 +4,7 @@
+ HARNESS_SRCS:=main.c
+ # io_queue.c
+
+-CFLAGS=-Wall -Werror -g -O -laio
++CFLAGS=-Wall -g -O -laio
+ #-lpthread -lrt
+
+ all: $(PROGS)
+diff -ur xen-4.2.1.orig/tools/libfsimage/Rules.mk xen-4.2.1/tools/libfsimage/Rules.mk
+--- tools/libfsimage/Rules.mk 2012-12-17 23:00:36.000000000 +0800
++++ tools/libfsimage/Rules.mk 2013-01-30 12:31:43.515941097 +0800
+@@ -1,7 +1,7 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+ CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+-CFLAGS += -Werror -D_GNU_SOURCE
++CFLAGS += -D_GNU_SOURCE
+ LDFLAGS += -L../common/
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+diff -ur xen-4.2.1.orig/tools/libxl/Makefile xen-4.2.1/tools/libxl/Makefile
+--- tools/libxl/Makefile 2012-12-17 23:01:08.000000000 +0800
++++ tools/libxl/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -11,7 +11,7 @@
+ XLUMAJOR = 1.0
+ XLUMINOR = 1
+
+-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
++CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+ CFLAGS += -I. -fPIC
+
+diff -ur xen-4.2.1.orig/tools/qemu-xen/pc-bios/optionrom/Makefile xen-4.2.1/tools/qemu-xen/pc-bios/optionrom/Makefile
+--- tools/qemu-xen/pc-bios/optionrom/Makefile 2012-09-11 02:10:52.000000000 +0800
++++ tools/qemu-xen/pc-bios/optionrom/Makefile 2013-01-30 12:31:43.528941098 +0800
+@@ -9,7 +9,7 @@
+
+ .PHONY : all clean build-all
+
+-CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
++CFLAGS := -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-builtin
+ CFLAGS += -I$(SRC_PATH)
+ CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
+ QEMU_CFLAGS = $(CFLAGS)
+diff -ur xen-4.2.1.orig/tools/vtpm/Rules.mk xen-4.2.1/tools/vtpm/Rules.mk
+--- tools/vtpm/Rules.mk 2012-12-17 23:01:35.000000000 +0800
++++ tools/vtpm/Rules.mk 2013-01-30 12:31:43.515941097 +0800
+@@ -6,7 +6,7 @@
+ #
+
+ # General compiler flags
+-CFLAGS = -Werror -g3
++CFLAGS = -g3
+
+ # Generic project files
+ HDRS = $(wildcard *.h)
+diff -ur xen-4.2.1.orig/tools/vtpm_manager/Rules.mk xen-4.2.1/tools/vtpm_manager/Rules.mk
+--- tools/vtpm_manager/Rules.mk 2012-12-17 23:01:35.000000000 +0800
++++ tools/vtpm_manager/Rules.mk 2013-01-30 12:31:43.511941097 +0800
+@@ -6,7 +6,7 @@
+ #
+
+ # General compiler flags
+-CFLAGS = -Werror -g3
++CFLAGS = -g3
+
+ # Generic project files
+ HDRS = $(wildcard *.h)
+diff -ur xen-4.2.1.orig/tools/xenstat/xentop/Makefile xen-4.2.1/tools/xenstat/xentop/Makefile
+--- tools/xenstat/xentop/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/xenstat/xentop/Makefile 2013-01-30 12:31:43.535941098 +0800
+@@ -18,7 +18,7 @@
+ all install xentop:
+ else
+
+-CFLAGS += -DGCC_PRINTF -Wall -Werror $(CFLAGS_libxenstat)
++CFLAGS += -DGCC_PRINTF -Wall $(CFLAGS_libxenstat)
+ LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
+ CFLAGS += -DHOST_$(XEN_OS)
+
+diff -ur xen-4.2.1.orig/xen/arch/arm/Rules.mk xen-4.2.1/xen/arch/arm/Rules.mk
+--- xen/arch/arm/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/arm/Rules.mk 2013-01-30 12:31:43.498941097 +0800
+@@ -9,7 +9,7 @@
+ HAS_DEVICE_TREE := y
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+
+ # Prevent floating-point variables from creeping into Xen.
+diff -ur xen-4.2.1.orig/xen/arch/x86/Rules.mk xen-4.2.1/xen/arch/x86/Rules.mk
+--- xen/arch/x86/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/x86/Rules.mk 2013-01-30 12:31:43.490941096 +0800
+@@ -24,7 +24,7 @@
+ endif
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
+diff -ur xen-4.2.1.orig/xen/include/Makefile xen-4.2.1/xen/include/Makefile
+--- xen/include/Makefile 2012-12-17 23:01:55.000000000 +0800
++++ xen/include/Makefile 2013-01-30 12:31:43.502941097 +0800
+@@ -78,7 +78,7 @@
+ all: headers.chk
+
+ headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
+- for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
++ for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
+ mv $@.new $@
+
+ endif
+diff -ur xen-4.2.1.orig/tools/tests/mce-test/tools/Makefile xen-4.2.1/tools/tests/mce-test/tools/Makefile
+--- tools/tests/mce-test/tools/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mce-test/tools/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_libxenstore)
+diff -ur xen-4.2.1.orig/tools/tests/mem-sharing/Makefile xen-4.2.1/tools/tests/mem-sharing/Makefile
+--- tools/tests/mem-sharing/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mem-sharing/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.2.1.orig/tools/tests/xen-access/Makefile xen-4.2.1/tools/tests/xen-access/Makefile
+--- tools/tests/xen-access/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/xen-access/Makefile 2013-01-30 13:01:44.891020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+
diff --git a/app-emulation/xen-pvgrub/files/xen-4.2.1-externals.patch b/app-emulation/xen-pvgrub/files/xen-4.2.1-externals.patch
new file mode 100644
index 000000000000..f2525ae1b505
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4.2.1-externals.patch
@@ -0,0 +1,83 @@
+# Patch Makefile to patch insource newlib,
+# Prevent internal downloading of external packages
+diff -ur xen-4.2.0.orig/stubdom/Makefile xen-4.2.0/stubdom/Makefile
+--- stubdom/Makefile 2012-09-17 18:21:17.000000000 +0800
++++ stubdom/Makefile 2012-12-05 14:01:10.694260256 +0800
+@@ -95,12 +95,13 @@
+ ##############
+
+ newlib-$(NEWLIB_VERSION).tar.gz:
+- $(WGET) $(NEWLIB_URL)/$@
++# $(WGET) $(NEWLIB_URL)/$@
+
+ newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
+ tar xzf $<
+ patch -d $@ -p0 < newlib.patch
+ patch -d $@ -p0 < newlib-chk.patch
++ patch -d $@ -p0 < newlib-implicits.patch
+ patch -d $@ -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
+ find $@ -type f | xargs perl -i.bak \
+ -pe 's/\b_(tzname|daylight|timezone)\b/$$1/g'
+@@ -110,7 +110,7 @@
+ $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
+ mkdir -p newlib-$(XEN_TARGET_ARCH)
+ ( cd newlib-$(XEN_TARGET_ARCH) && \
+- CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
++ CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) LDFLAGS= RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
+ $(MAKE) DESTDIR= && \
+ $(MAKE) DESTDIR= install )
+
+@@ -121,7 +122,7 @@
+ ############
+
+ zlib-$(ZLIB_VERSION).tar.gz:
+- $(WGET) $(ZLIB_URL)/$@
++# $(WGET) $(ZLIB_URL)/$@
+
+ zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz
+ tar xzf $<
+@@ -130,7 +130,7 @@
+ cross-zlib: $(ZLIB_STAMPFILE)
+ $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+ ( cd $< && \
+- CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
++ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC="$(CC)" ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
+ $(MAKE) DESTDIR= libz.a && \
+ $(MAKE) DESTDIR= install )
+
+@@ -141,7 +142,7 @@
+ ##############
+
+ pciutils-$(LIBPCI_VERSION).tar.bz2:
+- $(WGET) $(LIBPCI_URL)/$@
++# $(WGET) $(LIBPCI_URL)/$@
+
+ pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
+ tar xjf $<
+@@ -169,7 +170,7 @@
+ ######
+
+ lwip-$(LWIP_VERSION).tar.gz:
+- $(WGET) $(LWIP_URL)/$@
++# $(WGET) $(LWIP_URL)/$@
+
+ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
+ tar xzf $<
+@@ -325,7 +326,7 @@
+ ######
+
+ grub-$(GRUB_VERSION).tar.gz:
+- $(WGET) $(GRUB_URL)/$@
++#$(WGET) $(GRUB_URL)/$@
+
+ grub-upstream: grub-$(GRUB_VERSION).tar.gz
+ tar xzf $<
+@@ -392,7 +393,7 @@
+ $(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+ $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-ioemu/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/ioemu-stubdom.gz"
+
+-install-grub: pv-grub
++install-grub:
+ $(INSTALL_DIR) "$(DESTDIR)$(XENFIRMWAREDIR)"
+ $(INSTALL_DATA) mini-os-$(XEN_TARGET_ARCH)-grub/mini-os.gz "$(DESTDIR)$(XENFIRMWAREDIR)/pv-grub-$(XEN_TARGET_ARCH).gz"
+
diff --git a/app-emulation/xen-pvgrub/files/xen-4.3-externals.patch b/app-emulation/xen-pvgrub/files/xen-4.3-externals.patch
new file mode 100644
index 000000000000..0d8956fac098
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4.3-externals.patch
@@ -0,0 +1,75 @@
+diff -ur xen-4.3.0.orig/stubdom/Makefile xen-4.3.0/stubdom/Makefile
+--- stubdom/Makefile 2013-07-09 18:46:56.000000000 +0800
++++ stubdom/Makefile 2013-07-21 16:07:08.094663570 +0800
+@@ -68,12 +68,12 @@
+ ##############
+
+ newlib-$(NEWLIB_VERSION).tar.gz:
+- $(FETCHER) $@ $(NEWLIB_URL)/$@
+
+ newlib-$(NEWLIB_VERSION): newlib-$(NEWLIB_VERSION).tar.gz
+ tar xzf $<
+ patch -d $@ -p0 < newlib.patch
+ patch -d $@ -p0 < newlib-chk.patch
++ patch -d $@ -p0 < newlib-implicits.patch
+ patch -d $@ -p1 < newlib-stdint-size_max-fix-from-1.17.0.patch
+ find $@ -type f | xargs perl -i.bak \
+ -pe 's/\b_(tzname|daylight|timezone)\b/$$1/g'
+@@ -85,7 +85,7 @@
+ $(NEWLIB_STAMPFILE): mk-headers-$(XEN_TARGET_ARCH) newlib-$(NEWLIB_VERSION)
+ mkdir -p newlib-$(XEN_TARGET_ARCH)
+ ( cd newlib-$(XEN_TARGET_ARCH) && \
+- CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
++ CC_FOR_TARGET="$(CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(NEWLIB_CFLAGS)" AR_FOR_TARGET=$(AR) LD_FOR_TARGET=$(LD) LDFLAGS= RANLIB_FOR_TARGET=$(RANLIB) ../newlib-$(NEWLIB_VERSION)/configure --prefix=$(CROSS_PREFIX) --verbose --target=$(GNU_TARGET_ARCH)-xen-elf --enable-newlib-io-long-long --disable-multilib && \
+ $(MAKE) DESTDIR= && \
+ $(MAKE) DESTDIR= install )
+
+@@ -94,7 +94,6 @@
+ ############
+
+ zlib-$(ZLIB_VERSION).tar.gz:
+- $(FETCHER) $@ $(ZLIB_URL)/$@
+
+ zlib-$(XEN_TARGET_ARCH): zlib-$(ZLIB_VERSION).tar.gz
+ tar xzf $<
+@@ -105,7 +104,7 @@
+ cross-zlib: $(ZLIB_STAMPFILE)
+ $(ZLIB_STAMPFILE): zlib-$(XEN_TARGET_ARCH) $(NEWLIB_STAMPFILE)
+ ( cd $< && \
+- CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC=$(CC) ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
++ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" CC="$(CC)" ./configure --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf && \
+ $(MAKE) DESTDIR= libz.a && \
+ $(MAKE) DESTDIR= install )
+
+@@ -114,7 +113,6 @@
+ ##############
+
+ pciutils-$(LIBPCI_VERSION).tar.bz2:
+- $(FETCHER) $@ $(LIBPCI_URL)/$@
+
+ pciutils-$(XEN_TARGET_ARCH): pciutils-$(LIBPCI_VERSION).tar.bz2
+ tar xjf $<
+@@ -142,7 +140,6 @@
+ ######
+
+ lwip-$(LWIP_VERSION).tar.gz:
+- $(FETCHER) $@ $(LWIP_URL)/$@
+
+ lwip-$(XEN_TARGET_ARCH): lwip-$(LWIP_VERSION).tar.gz
+ tar xzf $<
+@@ -180,7 +177,6 @@
+ # cross-polarssl
+ #############
+ polarssl-$(POLARSSL_VERSION)-gpl.tgz:
+- $(FETCHER) $@ $(POLARSSL_URL)/$@
+
+ polarssl-$(XEN_TARGET_ARCH): polarssl-$(POLARSSL_VERSION)-gpl.tgz
+ tar xzf $<
+@@ -385,7 +382,6 @@
+ ######
+
+ grub-$(GRUB_VERSION).tar.gz:
+- $(FETCHER) $@ $(GRUB_URL)/$@
+
+ grub-upstream: grub-$(GRUB_VERSION).tar.gz
+ tar xzf $<
diff --git a/app-emulation/xen-pvgrub/files/xen-4.3-fix_dotconfig-gcc.patch b/app-emulation/xen-pvgrub/files/xen-4.3-fix_dotconfig-gcc.patch
new file mode 100644
index 000000000000..588be7469760
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4.3-fix_dotconfig-gcc.patch
@@ -0,0 +1,220 @@
+# Fix gcc-4.6
+diff -ur xen-4.2.0.orig/extras/mini-os/minios.mk xen-4.2.0/extras/mini-os/minios.mk
+--- extras/mini-os/minios.mk 2012-09-17 18:21:17.000000000 +0800
++++ extras/mini-os/minios.mk 2012-12-05 14:01:10.653260260 +0800
+@@ -6,7 +6,7 @@
+
+ # Define some default flags.
+ # NB. '-Wcast-qual' is nasty, so I omitted it.
+-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
++DEF_CFLAGS += -fno-builtin -Wall -Wredundant-decls -Wno-format -Wno-redundant-decls
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+diff -ur xen-4.2.0.orig/tools/libxc/Makefile xen-4.2.0/tools/libxc/Makefile
+--- tools/libxc/Makefile 2012-09-17 18:21:18.000000000 +0800
++++ tools/libxc/Makefile 2012-12-05 14:01:10.653260260 +0800
+@@ -85,7 +85,7 @@
+
+ -include $(XEN_TARGET_ARCH)/Makefile
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ CFLAGS += -I. $(CFLAGS_xeninclude)
+
+ # Needed for posix_fadvise64() in xc_linux.c
+# Drop .config
+diff -ur xen-4.2.0.orig/Config.mk xen-4.2.0/Config.mk
+--- Config.mk 2012-09-17 18:23:12.000000000 +0800
++++ Config.mk 2012-12-05 14:01:10.641260261 +0800
+@@ -7,7 +7,6 @@ Drop .config
+ # fallback for older make
+ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
+--include $(XEN_ROOT)/.config
+
+ # A debug build of Xen and tools?
+ debug ?= n
+@@ -24,7 +24,7 @@
+
+ # Tools to run on system hosting the build
+ HOSTCC = gcc
+-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS = -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
+
+ DISTDIR ?= $(XEN_ROOT)/dist
+@@ -156,7 +156,7 @@
+
+ CFLAGS += -std=gnu99
+
+-CFLAGS += -Wall -Wstrict-prototypes
++CFLAGS += -Wstrict-prototypes
+
+ # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
+ # and is over-zealous with the printf format lint
+diff -ur xen-4.2.1.orig/tools/blktap2/drivers/Makefile xen-4.2.1/tools/blktap2/drivers/Makefile
+--- tools/blktap2/drivers/Makefile 2012-12-17 23:00:11.000000000 +0800
++++ tools/blktap2/drivers/Makefile 2013-01-30 12:31:43.539941099 +0800
+@@ -9,7 +9,7 @@
+ LOCK_UTIL = lock-util
+ INST_DIR = $(SBINDIR)
+
+-CFLAGS += -Werror -g
++CFLAGS += -g
+ CFLAGS += -Wno-unused
+ CFLAGS += -fno-strict-aliasing
+ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
+diff -ur xen-4.2.1.orig/tools/debugger/gdbsx/Rules.mk xen-4.2.1/tools/debugger/gdbsx/Rules.mk
+--- tools/debugger/gdbsx/Rules.mk 2012-12-17 23:00:22.000000000 +0800
++++ tools/debugger/gdbsx/Rules.mk 2013-01-30 12:31:43.516941098 +0800
+@@ -1,4 +1,4 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ # (gcc 4.3x and later) -Wconversion -Wno-sign-conversion
+diff -ur xen-4.2.1.orig/tools/libaio/harness/Makefile xen-4.2.1/tools/libaio/harness/Makefile
+--- tools/libaio/harness/Makefile 2012-12-17 23:00:35.000000000 +0800
++++ tools/libaio/harness/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -4,7 +4,7 @@
+ HARNESS_SRCS:=main.c
+ # io_queue.c
+
+-CFLAGS=-Wall -Werror -g -O -laio
++CFLAGS=-Wall -g -O -laio
+ #-lpthread -lrt
+
+ all: $(PROGS)
+diff -ur xen-4.2.1.orig/tools/libfsimage/Rules.mk xen-4.2.1/tools/libfsimage/Rules.mk
+--- tools/libfsimage/Rules.mk 2012-12-17 23:00:36.000000000 +0800
++++ tools/libfsimage/Rules.mk 2013-01-30 12:31:43.515941097 +0800
+@@ -1,7 +1,7 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+ CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+-CFLAGS += -Werror -D_GNU_SOURCE
++CFLAGS += -D_GNU_SOURCE
+ LDFLAGS += -L../common/
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+diff -ur xen-4.2.1.orig/tools/libxl/Makefile xen-4.2.1/tools/libxl/Makefile
+--- tools/libxl/Makefile 2012-12-17 23:01:08.000000000 +0800
++++ tools/libxl/Makefile 2013-01-30 12:31:43.541941099 +0800
+@@ -11,7 +11,7 @@
+ XLUMAJOR = 1.0
+ XLUMINOR = 1
+
+-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
++CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+ CFLAGS += -I. -fPIC
+
+diff -ur xen-4.2.1.orig/tools/qemu-xen/pc-bios/optionrom/Makefile xen-4.2.1/tools/qemu-xen/pc-bios/optionrom/Makefile
+--- tools/qemu-xen/pc-bios/optionrom/Makefile 2012-09-11 02:10:52.000000000 +0800
++++ tools/qemu-xen/pc-bios/optionrom/Makefile 2013-01-30 12:31:43.528941098 +0800
+@@ -9,7 +9,7 @@
+
+ .PHONY : all clean build-all
+
+-CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
++CFLAGS := -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-builtin
+ CFLAGS += -I$(SRC_PATH)
+ CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
+ QEMU_CFLAGS = $(CFLAGS)
+diff -ur xen-4.2.1.orig/tools/xenstat/xentop/Makefile xen-4.2.1/tools/xenstat/xentop/Makefile
+--- tools/xenstat/xentop/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/xenstat/xentop/Makefile 2013-01-30 12:31:43.535941098 +0800
+@@ -18,7 +18,7 @@
+ all install xentop:
+ else
+
+-CFLAGS += -DGCC_PRINTF -Wall -Werror $(CFLAGS_libxenstat)
++CFLAGS += -DGCC_PRINTF -Wall $(CFLAGS_libxenstat)
+ LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
+ CFLAGS += -DHOST_$(XEN_OS)
+
+diff -ur xen-4.2.1.orig/xen/arch/arm/Rules.mk xen-4.2.1/xen/arch/arm/Rules.mk
+--- xen/arch/arm/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/arm/Rules.mk 2013-01-30 12:31:43.498941097 +0800
+@@ -9,7 +9,7 @@
+ HAS_DEVICE_TREE := y
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+
+ # Prevent floating-point variables from creeping into Xen.
+diff -ur xen-4.2.1.orig/xen/arch/x86/Rules.mk xen-4.2.1/xen/arch/x86/Rules.mk
+--- xen/arch/x86/Rules.mk 2012-12-17 23:01:37.000000000 +0800
++++ xen/arch/x86/Rules.mk 2013-01-30 12:31:43.490941096 +0800
+@@ -24,7 +24,7 @@
+ endif
+
+ CFLAGS += -fno-builtin -fno-common -Wredundant-decls
+-CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
++CFLAGS += -iwithprefix include -Wno-pointer-arith -pipe
+ CFLAGS += -I$(BASEDIR)/include
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic
+ CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-default
+diff -ur xen-4.2.1.orig/xen/include/Makefile xen-4.2.1/xen/include/Makefile
+--- xen/include/Makefile 2012-12-17 23:01:55.000000000 +0800
++++ xen/include/Makefile 2013-01-30 12:31:43.502941097 +0800
+@@ -78,7 +78,7 @@
+ all: headers.chk
+
+ headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile
+- for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
++ for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new
+ mv $@.new $@
+
+ endif
+diff -ur xen-4.2.1.orig/tools/tests/mce-test/tools/Makefile xen-4.2.1/tools/tests/mce-test/tools/Makefile
+--- tools/tests/mce-test/tools/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mce-test/tools/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_libxenstore)
+diff -ur xen-4.2.1.orig/tools/tests/mem-sharing/Makefile xen-4.2.1/tools/tests/mem-sharing/Makefile
+--- tools/tests/mem-sharing/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/mem-sharing/Makefile 2013-01-30 13:01:44.890020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.2.1.orig/tools/tests/xen-access/Makefile xen-4.2.1/tools/tests/xen-access/Makefile
+--- tools/tests/xen-access/Makefile 2012-12-17 23:01:35.000000000 +0800
++++ tools/tests/xen-access/Makefile 2013-01-30 13:01:44.891020152 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+diff -ur xen-4.3.0.orig/tools/firmware/Rules.mk xen-4.3.0/tools/firmware/Rules.mk
+--- tools/firmware/Rules.mk 2013-07-09 18:46:56.000000000 +0800
++++ ttools/firmware/Rules.mk 2013-07-20 20:28:57.811836505 +0800
+@@ -11,8 +11,6 @@
+ CFLAGS += -DNDEBUG
+ endif
+
+-CFLAGS += -Werror
+-
+ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
+
+ # Extra CFLAGS suitable for an embedded type of environment.
diff --git a/app-emulation/xen-pvgrub/files/xen-4.4-fix_dotconfig-gcc.patch b/app-emulation/xen-pvgrub/files/xen-4.4-fix_dotconfig-gcc.patch
new file mode 100644
index 000000000000..5bba0fdab3ee
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-4.4-fix_dotconfig-gcc.patch
@@ -0,0 +1,171 @@
+diff -ur xen-4.4.0.orig/Config.mk xen-4.4.0/Config.mk
+--- xen-4.4.0.orig/Config.mk 2014-03-10 18:47:38.000000000 +0800
++++ xen-4.4.0/Config.mk 2014-03-23 21:54:07.327717400 +0800
+@@ -13,8 +13,6 @@
+ # fallback for older make
+ realpath = $(wildcard $(foreach file,$(1),$(shell cd -P $(dir $(file)) && echo "$$PWD/$(notdir $(file))")))
+
+--include $(XEN_ROOT)/.config
+-
+ # A debug build of Xen and tools?
+ debug ?= n
+ debug_symbols ?= $(debug)
+@@ -36,7 +34,7 @@
+
+ # Tools to run on system hosting the build
+ HOSTCC = gcc
+-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
++HOSTCFLAGS = -Wstrict-prototypes -O2 -fomit-frame-pointer
+ HOSTCFLAGS += -fno-strict-aliasing
+
+ DISTDIR ?= $(XEN_ROOT)/dist
+@@ -187,7 +185,7 @@
+
+ CFLAGS += -std=gnu99
+
+-CFLAGS += -Wall -Wstrict-prototypes
++CFLAGS += -Wstrict-prototypes
+
+ # Clang complains about macros that expand to 'if ( ( foo == bar ) ) ...'
+ # and is over-zealous with the printf format lint
+diff -ur xen-4.4.0.orig/extras/mini-os/minios.mk xen-4.4.0/extras/mini-os/minios.mk
+--- xen-4.4.0.orig/extras/mini-os/minios.mk 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/extras/mini-os/minios.mk 2014-03-23 21:48:41.110722054 +0800
+@@ -6,7 +6,7 @@
+
+ # Define some default flags.
+ # NB. '-Wcast-qual' is nasty, so I omitted it.
+-DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format -Wno-redundant-decls
++DEF_CFLAGS += -fno-builtin -Wall -Wredundant-decls -Wno-format -Wno-redundant-decls
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
+diff -ur xen-4.4.0.orig/tools/blktap2/drivers/Makefile xen-4.4.0/tools/blktap2/drivers/Makefile
+--- xen-4.4.0.orig/tools/blktap2/drivers/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/blktap2/drivers/Makefile 2014-03-23 21:55:52.215715903 +0800
+@@ -9,7 +9,7 @@
+ LOCK_UTIL = lock-util
+ INST_DIR = $(SBINDIR)
+
+-CFLAGS += -Werror -g
++CFLAGS += -g
+ CFLAGS += -Wno-unused
+ CFLAGS += -fno-strict-aliasing
+ CFLAGS += -I$(BLKTAP_ROOT)/include -I$(BLKTAP_ROOT)/drivers
+diff -ur xen-4.4.0.orig/tools/debugger/gdbsx/Rules.mk xen-4.4.0/tools/debugger/gdbsx/Rules.mk
+--- xen-4.4.0.orig/tools/debugger/gdbsx/Rules.mk 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/debugger/gdbsx/Rules.mk 2014-03-23 21:56:21.399715487 +0800
+@@ -1,4 +1,4 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ # (gcc 4.3x and later) -Wconversion -Wno-sign-conversion
+diff -ur xen-4.4.0.orig/tools/firmware/Rules.mk xen-4.4.0/tools/firmware/Rules.mk
+--- xen-4.4.0.orig/tools/firmware/Rules.mk 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/firmware/Rules.mk 2014-03-23 22:30:36.056686174 +0800
+@@ -11,7 +11,7 @@
+ CFLAGS += -DNDEBUG
+ endif
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
+
+diff -ur xen-4.4.0.orig/tools/libfsimage/Rules.mk xen-4.4.0/tools/libfsimage/Rules.mk
+--- xen-4.4.0.orig/tools/libfsimage/Rules.mk 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/libfsimage/Rules.mk 2014-03-23 21:57:21.767714626 +0800
+@@ -1,7 +1,7 @@
+ include $(XEN_ROOT)/tools/Rules.mk
+
+ CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+-CFLAGS += -Werror -D_GNU_SOURCE
++CFLAGS += -D_GNU_SOURCE
+ LDFLAGS += -L../common/
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+diff -ur xen-4.4.0.orig/tools/libxc/Makefile xen-4.4.0/tools/libxc/Makefile
+--- xen-4.4.0.orig/tools/libxc/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/libxc/Makefile 2014-03-23 21:49:37.919721243 +0800
+@@ -87,7 +87,7 @@
+
+ -include $(XEN_TARGET_ARCH)/Makefile
+
+-CFLAGS += -Werror -Wmissing-prototypes
++CFLAGS += -Wmissing-prototypes
+ CFLAGS += -I. $(CFLAGS_xeninclude)
+
+ # Needed for posix_fadvise64() in xc_linux.c
+diff -ur xen-4.4.0.orig/tools/libxl/Makefile xen-4.4.0/tools/libxl/Makefile
+--- xen-4.4.0.orig/tools/libxl/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/libxl/Makefile 2014-03-23 21:58:09.983713938 +0800
+@@ -11,7 +11,7 @@
+ XLUMAJOR = 4.3
+ XLUMINOR = 0
+
+-CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
++CFLAGS += -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+ CFLAGS += -I. -fPIC
+
+diff -ur xen-4.4.0.orig/tools/qemu-xen/pc-bios/optionrom/Makefile xen-4.4.0/tools/qemu-xen/pc-bios/optionrom/Makefile
+--- xen-4.4.0.orig/tools/qemu-xen/pc-bios/optionrom/Makefile 2014-02-06 00:59:14.000000000 +0800
++++ xen-4.4.0/tools/qemu-xen/pc-bios/optionrom/Makefile 2014-03-23 21:59:13.175713036 +0800
+@@ -9,7 +9,7 @@
+
+ .PHONY : all clean build-all
+
+-CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
++CFLAGS := -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-builtin
+ CFLAGS += -I$(SRC_PATH)
+ CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
+ QEMU_CFLAGS = $(CFLAGS)
+diff -ur xen-4.4.0.orig/tools/tests/mce-test/tools/Makefile xen-4.4.0/tools/tests/mce-test/tools/Makefile
+--- xen-4.4.0.orig/tools/tests/mce-test/tools/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/tests/mce-test/tools/Makefile 2014-03-23 22:28:45.160687756 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_libxenstore)
+diff -ur xen-4.4.0.orig/tools/tests/mem-sharing/Makefile xen-4.4.0/tools/tests/mem-sharing/Makefile
+--- xen-4.4.0.orig/tools/tests/mem-sharing/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/tests/mem-sharing/Makefile 2014-03-23 22:29:15.472687324 +0800
+@@ -1,7 +1,7 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
++CFLAGS +=
+
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.4.0.orig/tools/tests/xen-access/Makefile xen-4.4.0/tools/tests/xen-access/Makefile
+--- xen-4.4.0.orig/tools/tests/xen-access/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/tests/xen-access/Makefile 2014-03-23 22:30:02.064686659 +0800
+@@ -1,8 +1,6 @@
+ XEN_ROOT=$(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-CFLAGS += -Werror
+-
+ CFLAGS += $(CFLAGS_libxenctrl)
+ CFLAGS += $(CFLAGS_libxenguest)
+ CFLAGS += $(CFLAGS_xeninclude)
+diff -ur xen-4.4.0.orig/tools/xenstat/xentop/Makefile xen-4.4.0/tools/xenstat/xentop/Makefile
+--- xen-4.4.0.orig/tools/xenstat/xentop/Makefile 2014-03-10 18:43:57.000000000 +0800
++++ xen-4.4.0/tools/xenstat/xentop/Makefile 2014-03-23 22:23:59.944691825 +0800
+@@ -18,7 +18,7 @@
+ all install xentop:
+ else
+
+-CFLAGS += -DGCC_PRINTF -Wall -Werror $(CFLAGS_libxenstat)
++CFLAGS += -DGCC_PRINTF -Wall $(CFLAGS_libxenstat)
+ LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
+ CFLAGS += -DHOST_$(XEN_OS)
+
diff --git a/app-emulation/xen-pvgrub/files/xen-pvgrub-4-qa.patch b/app-emulation/xen-pvgrub/files/xen-pvgrub-4-qa.patch
new file mode 100644
index 000000000000..33d56db54e60
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-pvgrub-4-qa.patch
@@ -0,0 +1,35 @@
+This includes a few headers to fix some missing function declarations.
+
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+diff --git a/stubdom/grub/config.h b/stubdom/grub/config.h
+index 1649d51..15a6583 100644
+--- a/stubdom/grub/config.h
++++ b/stubdom/grub/config.h
+@@ -2,6 +2,7 @@
+ #undef putchar
+ #include <ctype.h>
+ #include <string.h>
++#include <kernel.h>
+ #define debug _debug
+ #define grub_halt(a) do_exit()
+ #define printf grub_printf
+diff --git a/xen/include/xen/libelf.h b/xen/include/xen/libelf.h
+index 2a6fa54..e65db6d 100644
+--- a/xen/include/xen/libelf.h
++++ b/xen/include/xen/libelf.h
+@@ -39,11 +39,13 @@ typedef int elf_negerrnoval; /* 0: ok; -EFOO: error */
+ #ifdef __XEN__
+ #include <public/elfnote.h>
+ #include <public/features.h>
++#include <xen/string.h>
+ #else
+ #include <xen/elfnote.h>
+ #include <xen/features.h>
+
+ #include <stdarg.h>
++#include <string.h>
+
+ struct elf_binary;
+ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
+
diff --git a/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2-jserver.patch b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2-jserver.patch
new file mode 100644
index 000000000000..514fd0575b23
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2-jserver.patch
@@ -0,0 +1,32 @@
+diff -ur xen-4.2.0.orig/tools/tests/x86_emulator/Makefile xen-4.2.0/tools/tests/x86_emulator/Makefile
+--- tools/tests/x86_emulator/Makefile 2012-09-17 18:21:19.000000000 +0800
++++ tools/tests/x86_emulator/Makefile 2012-11-24 05:06:24.355778737 +0800
+@@ -14,13 +14,13 @@
+ .PHONY: blowfish.h
+ blowfish.h:
+ rm -f blowfish.bin
+- XEN_TARGET_ARCH=x86_32 make -f blowfish.mk all
++ XEN_TARGET_ARCH=x86_32 $(MAKE) -f blowfish.mk all
+ (echo "static unsigned int blowfish32_code[] = {"; \
+ od -v -t x blowfish.bin | sed 's/^[0-9]* /0x/' | sed 's/ /, 0x/g' | sed 's/$$/,/';\
+ echo "};") >$@
+ rm -f blowfish.bin
+ ifeq ($(XEN_COMPILE_ARCH),x86_64)
+- XEN_TARGET_ARCH=x86_64 make -f blowfish.mk all
++ XEN_TARGET_ARCH=x86_64 $(MAKE) -f blowfish.mk all
+ (echo "static unsigned int blowfish64_code[] = {"; \
+ od -v -t x blowfish.bin | sed 's/^[0-9]* /0x/' | sed 's/ /, 0x/g' | sed 's/$$/,/';\
+ echo "};") >>$@
+
+diff -ur xen-4.2.0.orig/tools/firmware/vgabios/Makefile xen-4.2.0/tools/firmware/vgabios/Makefile
+--- tools/firmware/vgabios/Makefile 2013-02-04 13:56:50.973533544 +0800
++++ tools/firmware/vgabios/Makefile 2013-02-04 13:57:21.380535958 +0800
+@@ -27,7 +27,7 @@
+
+ .PHONY: release
+ release:
+- VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" make bios cirrus-bios
++ VGABIOS_VERS=\"-DVGABIOS_VERS=\\\"$(RELVERS)\\\"\" $(MAKE) bios cirrus-bios
+ /bin/rm -f *.o *.s *.ld86 \
+ temp.awk.* vgabios.*.orig _vgabios_.*.c core *.bak .#*
+ cp VGABIOS-lgpl-latest.bin ../$(RELEASE).bin
diff --git a/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2.3-qa.patch b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2.3-qa.patch
new file mode 100644
index 000000000000..ea693666f022
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.2.3-qa.patch
@@ -0,0 +1,34 @@
+This includes a few headers to fix some missing function declarations.
+
+Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
+
+diff --git a/stubdom/grub/config.h b/stubdom/grub/config.h
+index 1649d51..15a6583 100644
+--- a/stubdom/grub/config.h
++++ b/stubdom/grub/config.h
+@@ -2,6 +2,7 @@
+ #undef putchar
+ #include <ctype.h>
+ #include <string.h>
++#include <kernel.h>
+ #define debug _debug
+ #define grub_halt(a) do_exit()
+ #define printf grub_printf
+diff -ur xen-4.2.3.orig/xen/include/xen/libelf.h xen-4.2.3/xen/include/xen/libelf.h
+--- xen-4.2.3.orig/xen/include/xen/libelf.h 2013-09-09 20:27:41.000000000 +0800
++++ xen-4.2.3/xen/include/xen/libelf.h 2014-02-15 13:42:24.491435783 +0800
+@@ -37,12 +37,14 @@
+ #ifdef __XEN__
+ #include <public/elfnote.h>
+ #include <public/features.h>
++#include <xen/string.h>
+ #include <xen/stdbool.h>
+ #else
+ #include <xen/elfnote.h>
+ #include <xen/features.h>
+
+ #include <stdarg.h>
++#include <string.h>
+ #include <stdbool.h>
+
+ struct elf_binary;
diff --git a/app-emulation/xen-pvgrub/files/xen-pvgrub-4.3.1-qa.patch b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.3.1-qa.patch
new file mode 100644
index 000000000000..f5cb3d2a3032
--- /dev/null
+++ b/app-emulation/xen-pvgrub/files/xen-pvgrub-4.3.1-qa.patch
@@ -0,0 +1,30 @@
+diff -ur xen-4.3.1.orig/stubdom/grub/config.h xen-4.3.1/stubdom/grub/config.h
+--- stubdom/grub/config.h 2013-10-30 16:18:28.000000000 +0800
++++ stubdom/grub/config.h 2013-12-09 17:12:14.209783970 +0800
+@@ -2,6 +2,7 @@
+ #undef putchar
+ #include <ctype.h>
+ #include <string.h>
++#include <kernel.h>
+ #define debug _debug
+ #define grub_halt(a) do_exit()
+ #define printf grub_printf
+diff -ur xen-4.3.1.orig/xen/include/xen/libelf.h xen-4.3.1/xen/include/xen/libelf.h
+--- xen/include/xen/libelf.h 2013-10-30 16:18:28.000000000 +0800
++++ xen/include/xen/libelf.h 2013-12-09 17:14:09.249788085 +0800
+@@ -37,6 +37,7 @@
+ #ifdef __XEN__
+ #include <public/elfnote.h>
+ #include <public/features.h>
++#include <xen/string.h>
+ #include <xen/stdbool.h>
+ #else
+ #include <xen/elfnote.h>
+@@ -44,6 +45,7 @@
+
+ #include <stdarg.h>
+ #include <stdbool.h>
++#include <string.h>
+
+ struct elf_binary;
+ typedef void elf_log_callback(struct elf_binary*, void *caller_data,
diff --git a/app-emulation/xen-pvgrub/metadata.xml b/app-emulation/xen-pvgrub/metadata.xml
new file mode 100644
index 000000000000..cc9d568a3360
--- /dev/null
+++ b/app-emulation/xen-pvgrub/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>xen</herd>
+</pkgmetadata>
diff --git a/app-emulation/xen-pvgrub/xen-pvgrub-4.2.5.ebuild b/app-emulation/xen-pvgrub/xen-pvgrub-4.2.5.ebuild
new file mode 100644
index 000000000000..3f02a0d7ae1d
--- /dev/null
+++ b/app-emulation/xen-pvgrub/xen-pvgrub-4.2.5.ebuild
@@ -0,0 +1,162 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='xml,threads'
+
+inherit flag-o-matic eutils multilib python-single-r1 toolchain-funcs
+
+XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
+LIBPCI_URL=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
+GRUB_URL=mirror://gnu-alpha/grub
+
+UPSTREAM_VER=
+GENTOO_VER=
+
+[[ -n ${UPSTREAM_VER} ]] && \
+ UPSTREAM_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-pvgrub/}-upstream-patches-${UPSTREAM_VER}.tar.xz"
+[[ -n ${GENTOO_VER} ]] && \
+ GENTOO_PATCHSET_URI="http://dev.gentoo.org/~dlan/distfiles/${P/-pvgrub/}-gentoo-patches-${GENTOO_VER}.tar.xz"
+
+SRC_URI="
+ http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
+ $GRUB_URL/grub-0.97.tar.gz
+ $XEN_EXTFILES_URL/zlib-1.2.3.tar.gz
+ $LIBPCI_URL/pciutils-2.2.9.tar.bz2
+ $XEN_EXTFILES_URL/lwip-1.3.0.tar.gz
+ $XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz
+ ${UPSTREAM_PATCHSET_URI}
+ ${GENTOO_PATCHSET_URI}
+ "
+
+S="${WORKDIR}/xen-${PV}"
+
+DESCRIPTION="allows to boot Xen domU kernels from a menu.lst laying inside guest filesystem"
+HOMEPAGE="http://xen.org/"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="custom-cflags"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="sys-devel/gettext
+ sys-devel/bin86"
+
+RDEPEND=">=app-emulation/xen-4.2.1"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+retar-externals() {
+ # Purely to unclutter src_prepare
+ local set="grub-0.97.tar.gz lwip-1.3.0.tar.gz newlib-1.16.0.tar.gz zlib-1.2.3.tar.gz"
+
+ # epatch can't patch in $WORKDIR, requires a sed; Bug #455194. Patchable, but sed informative
+ sed -e s':AR=${AR-"ar rc"}:AR=${AR-"ar"}:' \
+ -i "${WORKDIR}"/zlib-1.2.3/configure
+ sed -e 's:^AR=ar rc:AR=ar:' \
+ -e s':$(AR) $@:$(AR) rc $@:' \
+ -i "${WORKDIR}"/zlib-1.2.3/{Makefile,Makefile.in}
+ einfo "zlib Makefile edited"
+
+ cd "${WORKDIR}"
+ tar czp zlib-1.2.3 -f zlib-1.2.3.tar.gz
+ tar czp grub-0.97 -f grub-0.97.tar.gz
+ tar czp lwip -f lwip-1.3.0.tar.gz
+ tar czp newlib-1.16.0 -f newlib-1.16.0.tar.gz
+ mv $set "${S}"/stubdom/
+ einfo "tarballs moved to source"
+}
+
+src_prepare() {
+ # Upstream's patchset
+ if [[ -n ${UPSTREAM_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-upstream
+ fi
+
+ # Gentoo's patchset
+ if [[ -n ${GENTOO_VER} ]]; then
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"/patches-gentoo
+ fi
+
+ # if the user *really* wants to use their own custom-cflags, let them
+ if use custom-cflags; then
+ einfo "User wants their own CFLAGS - removing defaults"
+ # try and remove all the default custom-cflags
+ find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
+ -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
+ -i {} \;
+ fi
+
+ # Patch the unmergeable newlib, fix most of the leftover gcc QA issues
+ cp "${FILESDIR}"/newlib-implicits.patch stubdom || die
+
+ # Patch stubdom/Makefile to patch insource newlib & prevent internal downloading
+ epatch "${FILESDIR}"/${PN/-pvgrub/}-4.2.1-externals.patch
+
+ # Drop .config and Fix gcc-4.6
+ epatch "${FILESDIR}"/${PN/-pvgrub/}-4-fix_dotconfig-gcc.patch
+
+ # fix jobserver in Makefile
+ epatch "${FILESDIR}"/${PN}-4.2-jserver.patch
+
+ # gcc warnings/QA fix
+ epatch "${FILESDIR}"/${PN}-4.2.3-qa.patch
+
+ #Substitute for internal downloading. pciutils copied only due to the only .bz2
+ cp "${DISTDIR}"/pciutils-2.2.9.tar.bz2 ./stubdom/ || die "pciutils not copied to stubdom"
+ retar-externals || die "re-tar procedure failed"
+}
+
+src_compile() {
+ use custom-cflags || unset CFLAGS
+ if test-flag-CC -fno-strict-overflow; then
+ append-flags -fno-strict-overflow
+ fi
+
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" -C tools/include
+
+ if use x86; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub
+ elif use amd64; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_64" -C stubdom pv-grub
+ if has_multilib_profile; then
+ multilib_toolchain_setup x86
+ emake CC="$(tc-getCC)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub
+ fi
+ fi
+}
+
+src_install() {
+ if use x86; then
+ emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub
+ fi
+ if use amd64; then
+ emake XEN_TARGET_ARCH="x86_64" DESTDIR="${D}" -C stubdom install-grub
+ if has_multilib_profile; then
+ emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub
+ fi
+ fi
+}
+
+pkg_postinst() {
+ elog "Official Xen Guide and the offical wiki page:"
+ elog "http://www.gentoo.org/doc/en/xen-guide.xml"
+ elog "http://wiki.xen.org/wiki/Main_Page"
+}
diff --git a/app-emulation/xen-pvgrub/xen-pvgrub-4.5.1.ebuild b/app-emulation/xen-pvgrub/xen-pvgrub-4.5.1.ebuild
new file mode 100644
index 000000000000..8e1c138209c3
--- /dev/null
+++ b/app-emulation/xen-pvgrub/xen-pvgrub-4.5.1.ebuild
@@ -0,0 +1,143 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE='xml,threads'
+
+inherit flag-o-matic eutils multilib python-single-r1 toolchain-funcs
+
+XEN_EXTFILES_URL="http://xenbits.xensource.com/xen-extfiles"
+LIBPCI_URL=ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci
+GRUB_URL=mirror://gnu-alpha/grub
+SRC_URI="
+ http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz
+ $GRUB_URL/grub-0.97.tar.gz
+ $XEN_EXTFILES_URL/zlib-1.2.3.tar.gz
+ $LIBPCI_URL/pciutils-2.2.9.tar.bz2
+ $XEN_EXTFILES_URL/lwip-1.3.0.tar.gz
+ $XEN_EXTFILES_URL/newlib/newlib-1.16.0.tar.gz
+ $XEN_EXTFILES_URL/polarssl-1.1.4-gpl.tgz"
+
+S="${WORKDIR}/xen-${PV}"
+
+DESCRIPTION="allows to boot Xen domU kernels from a menu.lst laying inside guest filesystem"
+HOMEPAGE="http://xen.org/"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 -x86"
+IUSE="custom-cflags"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="sys-devel/gettext
+ sys-devel/bin86
+ sys-apps/texinfo"
+
+RDEPEND=">=app-emulation/xen-4.2.1"
+
+pkg_setup() {
+ python-single-r1_pkg_setup
+}
+
+retar-externals() {
+ # Purely to unclutter src_prepare
+ local set="grub-0.97.tar.gz lwip-1.3.0.tar.gz newlib-1.16.0.tar.gz polarssl-1.1.4-gpl.tgz zlib-1.2.3.tar.gz"
+
+ # epatch can't patch in $WORKDIR, requires a sed; Bug #455194. Patchable, but sed informative
+ sed -e s':AR=${AR-"ar rc"}:AR=${AR-"ar"}:' \
+ -i "${WORKDIR}"/zlib-1.2.3/configure
+ sed -e 's:^AR=ar rc:AR=ar:' \
+ -e s':$(AR) $@:$(AR) rc $@:' \
+ -i "${WORKDIR}"/zlib-1.2.3/{Makefile,Makefile.in}
+ einfo "zlib Makefile edited"
+
+ cd "${WORKDIR}"
+ tar czp zlib-1.2.3 -f zlib-1.2.3.tar.gz
+ tar czp grub-0.97 -f grub-0.97.tar.gz
+ tar czp lwip -f lwip-1.3.0.tar.gz
+ tar czp newlib-1.16.0 -f newlib-1.16.0.tar.gz
+ tar czp polarssl-1.1.4 -f polarssl-1.1.4-gpl.tgz
+ mv $set "${S}"/stubdom/
+ einfo "tarballs moved to source"
+}
+
+src_prepare() {
+ # if the user *really* wants to use their own custom-cflags, let them
+ if use custom-cflags; then
+ einfo "User wants their own CFLAGS - removing defaults"
+ # try and remove all the default custom-cflags
+ find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
+ -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
+ -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
+ -i {} \;
+ fi
+
+ # Patch the unmergeable newlib, fix most of the leftover gcc QA issues
+ cp "${FILESDIR}"/newlib-implicits.patch stubdom || die
+
+ # Patch stubdom/Makefile to patch insource newlib & prevent internal downloading
+ epatch "${FILESDIR}"/${PN/-pvgrub/}-4.3-externals.patch
+
+ # fix jobserver in Makefile
+ epatch "${FILESDIR}"/${PN}-4.2-jserver.patch
+
+ #Substitute for internal downloading. pciutils copied only due to the only .bz2
+ cp "${DISTDIR}"/pciutils-2.2.9.tar.bz2 ./stubdom/ || die "pciutils not copied to stubdom"
+ retar-externals || die "re-tar procedure failed"
+}
+
+src_configure() {
+ local myconf="--prefix=${PREFIX}/usr \
+ --libdir=${PREFIX}/usr/$(get_libdir) \
+ --libexecdir=${PREFIX}/usr/libexec \
+ --disable-werror \
+ --disable-xen"
+
+ econf ${myconf}
+}
+
+src_compile() {
+ use custom-cflags || unset CFLAGS
+ if test-flag-CC -fno-strict-overflow; then
+ append-flags -fno-strict-overflow
+ fi
+
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" -C tools/include
+
+ if use x86; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub
+ elif use amd64; then
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_64" -C stubdom pv-grub
+ if has_multilib_profile; then
+ multilib_toolchain_setup x86
+ emake CC="$(tc-getCC)" AR="$(tc-getAR)" \
+ XEN_TARGET_ARCH="x86_32" -C stubdom pv-grub
+ fi
+ fi
+}
+
+src_install() {
+ if use x86; then
+ emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub
+ fi
+ if use amd64; then
+ emake XEN_TARGET_ARCH="x86_64" DESTDIR="${D}" -C stubdom install-grub
+ if has_multilib_profile; then
+ emake XEN_TARGET_ARCH="x86_32" DESTDIR="${D}" -C stubdom install-grub
+ fi
+ fi
+}
+
+pkg_postinst() {
+ elog "Official Xen Guide and the offical wiki page:"
+ elog "https://wiki.gentoo.org/wiki/Xen"
+ elog "http://wiki.xen.org/wiki/Main_Page"
+}