summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/xen-pvgrub/files')
-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
10 files changed, 1074 insertions, 0 deletions
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,