--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:45 +0200
+X-Dgit-Generated: 4.8.0-1 b0e794e71f5860aa45c034890bbbe7dbaf7dbe41
+Subject: config-prefix.diff
+
+Patch-Name: config-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/Config.mk
++++ xen-4.8.0/Config.mk
+@@ -82,7 +82,7 @@ EXTRA_LIB += $(EXTRA_PREFIX)/lib
+ endif
+
+ PYTHON ?= python
+-PYTHON_PREFIX_ARG ?= --prefix="$(prefix)"
++PYTHON_PREFIX_ARG ?= --home="$(LIBEXEC)"
+ # The above requires that prefix contains *no spaces*. This variable is here
+ # to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
+ # https://bugs.launchpad.net/ubuntu/+bug/362570
+--- xen-4.8.0.orig/config/Paths.mk.in
++++ xen-4.8.0/config/Paths.mk.in
+@@ -13,6 +13,7 @@
+ # http://wiki.xen.org/wiki/Category:Host_Configuration#System_wide_xen_configuration
+
+ PACKAGE_TARNAME := @PACKAGE_TARNAME@
++PACKAGE_VERSION := @PACKAGE_VERSION@
+ prefix := @prefix@
+ bindir := @bindir@
+ sbindir := @sbindir@
--- /dev/null
+From: Ian Jackson <ian.jackson@citrix.com>
+Date: Fri, 28 Oct 2016 14:52:13 +0100
+X-Dgit-Generated: 4.8.0-1 bd556f73ea104ab691ce11b68905f7f05fa72274
+Subject: Rerun autogen.sh (stretch)
+
+Using autoconf 2.69-10 (amd64)
+
+Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
+
+---
+
+--- xen-4.8.0.orig/configure
++++ xen-4.8.0/configure
+@@ -641,6 +641,7 @@ infodir
+ docdir
+ oldincludedir
+ includedir
++runstatedir
+ localstatedir
+ sharedstatedir
+ sysconfdir
+@@ -717,6 +718,7 @@ datadir='${datarootdir}'
+ sysconfdir='${prefix}/etc'
+ sharedstatedir='${prefix}/com'
+ localstatedir='${prefix}/var'
++runstatedir='${localstatedir}/run'
+ includedir='${prefix}/include'
+ oldincludedir='/usr/include'
+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+@@ -969,6 +971,15 @@ do
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
++ -runstatedir | --runstatedir | --runstatedi | --runstated \
++ | --runstate | --runstat | --runsta | --runst | --runs \
++ | --run | --ru | --r)
++ ac_prev=runstatedir ;;
++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
++ | --run=* | --ru=* | --r=*)
++ runstatedir=$ac_optarg ;;
++
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+@@ -1106,7 +1117,7 @@ fi
+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+- libdir localedir mandir
++ libdir localedir mandir runstatedir
+ do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+@@ -1259,6 +1270,7 @@ Fine tuning of the installation director
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+--- xen-4.8.0.orig/docs/configure
++++ xen-4.8.0/docs/configure
+@@ -632,6 +632,7 @@ infodir
+ docdir
+ oldincludedir
+ includedir
++runstatedir
+ localstatedir
+ sharedstatedir
+ sysconfdir
+@@ -707,6 +708,7 @@ datadir='${datarootdir}'
+ sysconfdir='${prefix}/etc'
+ sharedstatedir='${prefix}/com'
+ localstatedir='${prefix}/var'
++runstatedir='${localstatedir}/run'
+ includedir='${prefix}/include'
+ oldincludedir='/usr/include'
+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+@@ -959,6 +961,15 @@ do
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
++ -runstatedir | --runstatedir | --runstatedi | --runstated \
++ | --runstate | --runstat | --runsta | --runst | --runs \
++ | --run | --ru | --r)
++ ac_prev=runstatedir ;;
++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
++ | --run=* | --ru=* | --r=*)
++ runstatedir=$ac_optarg ;;
++
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+@@ -1096,7 +1107,7 @@ fi
+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+- libdir localedir mandir
++ libdir localedir mandir runstatedir
+ do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+@@ -1249,6 +1260,7 @@ Fine tuning of the installation director
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+--- xen-4.8.0.orig/stubdom/configure
++++ xen-4.8.0/stubdom/configure
+@@ -659,6 +659,7 @@ infodir
+ docdir
+ oldincludedir
+ includedir
++runstatedir
+ localstatedir
+ sharedstatedir
+ sysconfdir
+@@ -748,6 +749,7 @@ datadir='${datarootdir}'
+ sysconfdir='${prefix}/etc'
+ sharedstatedir='${prefix}/com'
+ localstatedir='${prefix}/var'
++runstatedir='${localstatedir}/run'
+ includedir='${prefix}/include'
+ oldincludedir='/usr/include'
+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+@@ -1000,6 +1002,15 @@ do
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
++ -runstatedir | --runstatedir | --runstatedi | --runstated \
++ | --runstate | --runstat | --runsta | --runst | --runs \
++ | --run | --ru | --r)
++ ac_prev=runstatedir ;;
++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
++ | --run=* | --ru=* | --r=*)
++ runstatedir=$ac_optarg ;;
++
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+@@ -1137,7 +1148,7 @@ fi
+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+- libdir localedir mandir
++ libdir localedir mandir runstatedir
+ do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+@@ -1290,6 +1301,7 @@ Fine tuning of the installation director
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+--- xen-4.8.0.orig/tools/configure
++++ xen-4.8.0/tools/configure
+@@ -767,6 +767,7 @@ infodir
+ docdir
+ oldincludedir
+ includedir
++runstatedir
+ localstatedir
+ sharedstatedir
+ sysconfdir
+@@ -889,6 +890,7 @@ datadir='${datarootdir}'
+ sysconfdir='${prefix}/etc'
+ sharedstatedir='${prefix}/com'
+ localstatedir='${prefix}/var'
++runstatedir='${localstatedir}/run'
+ includedir='${prefix}/include'
+ oldincludedir='/usr/include'
+ docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+@@ -1141,6 +1143,15 @@ do
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
++ -runstatedir | --runstatedir | --runstatedi | --runstated \
++ | --runstate | --runstat | --runsta | --runst | --runs \
++ | --run | --ru | --r)
++ ac_prev=runstatedir ;;
++ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
++ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
++ | --run=* | --ru=* | --r=*)
++ runstatedir=$ac_optarg ;;
++
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+@@ -1278,7 +1289,7 @@ fi
+ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+- libdir localedir mandir
++ libdir localedir mandir runstatedir
+ do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+@@ -1431,6 +1442,7 @@ Fine tuning of the installation director
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
++ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
gitarchiveinfo-reset
+rerun-autogen.sh-stretch
+version.diff
+config-prefix.diff
+tools-libfsimage-abiname.diff
+tools-libxc-abiname.diff
+tools-libxl-abiname.diff
+tools-xenstat-abiname.diff
+tools-rpath.diff
+tools-blktap2-prefix.diff
+tools-console-prefix.diff
+tools-libfsimage-prefix.diff
+tools-libxl-prefix.diff
+tools-misc-prefix.diff
+tools-pygrub-prefix.diff
+tools-python-prefix.diff
+tools-xcutils-rpath.diff
+tools-xenmon-prefix.diff
+tools-xenpaging-prefix.diff
+tools-xenpmd-prefix.diff
+tools-xenstat-prefix.diff
+tools-xenstore-prefix.diff
+tools-xentrace-prefix.diff
+tools-pygrub-remove-static-solaris-support
+tools-include-install.diff
+tools-xenmon-install.diff
+tools-xenstore-compatibility.diff
+ubuntu-tools-libs-abiname.diff
+toolstestsx86_emulator-pass--no-pie--fno
+x86-force-eflags.if-on-when-exiting-to-p
+x86hvm-add-missing-null-check-before-usi
+x86emul-correct-the-handling-of-eflags-w
+x86emul-add-likelyunlikely-to-test-harne
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:53 +0200
+X-Dgit-Generated: 4.8.0-1 b555310b511dc66899cb910408d7fb3fa9457c08
+Subject: tools-blktap2-prefix.diff
+
+Patch-Name: tools-blktap2-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/blktap2/control/Makefile
++++ xen-4.8.0/tools/blktap2/control/Makefile
+@@ -1,10 +1,7 @@
+ XEN_ROOT := $(CURDIR)/../../../
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-MAJOR = 1.0
+-MINOR = 0
+ LIBNAME = libblktapctl
+-LIBSONAME = $(LIBNAME).so.$(MAJOR)
+
+ IBIN = tap-ctl
+
+@@ -38,39 +35,32 @@ OBJS = $(CTL_OBJS) tap-ctl.o
+ PICS = $(CTL_PICS)
+
+ LIB_STATIC = $(LIBNAME).a
+-LIB_SHARED = $(LIBSONAME).$(MINOR)
++LIB_SHARED = $(LIBNAME).so
+ IBIN = tap-ctl
+
+ all: build
+
+ build: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+
+-$(LIBNAME).so: $(LIBSONAME)
+- ln -sf $< $@
+-
+-$(LIBSONAME): $(LIB_SHARED)
+- ln -sf $< $@
+-
+ tap-ctl: tap-ctl.o $(LIBNAME).so
+- $(CC) $(LDFLAGS) -o $@ $^ $(APPEND_LDFLAGS)
++ $(CC) $(LDFLAGS) $(call LDFLAGS_RPATH,../lib) -o $@ $^ $(APPEND_LDFLAGS)
+
+ $(LIB_STATIC): $(CTL_OBJS)
+ $(AR) r $@ $^
+
+ $(LIB_SHARED): $(CTL_PICS)
+- $(CC) $(LDFLAGS) -fPIC -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) $(SHLIB_LDFLAGS) -rdynamic $^ -o $@ $(APPEND_LDFLAGS)
++ $(CC) $(LDFLAGS) -fPIC $(SHLIB_LDFLAGS) -rdynamic $^ -o $@ $(APPEND_LDFLAGS)
+
+ install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+- $(INSTALL_DIR) -p $(DESTDIR)$(sbindir)
+- $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(sbindir)
++ $(INSTALL_DIR) -p $(DESTDIR)$(libdir)
++ $(INSTALL_DIR) -p $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_DIR) -p $(DESTDIR)$(LIBEXEC_LIB)
++ $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(LIBEXEC_BIN)
+ $(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(libdir)
+- $(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(libdir)
+- ln -sf $(LIBSONAME) $(DESTDIR)$(libdir)/$(LIBNAME).so
+- ln -sf $(LIB_SHARED) $(DESTDIR)$(libdir)/$(LIBSONAME)
++ $(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(LIBEXEC_LIB)
+
+ clean:
+ rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+- rm -f $(LIBNAME).so $(LIBSONAME)
+ rm -f *~
+
+ distclean: clean
+--- xen-4.8.0.orig/tools/blktap2/vhd/Makefile
++++ xen-4.8.0/tools/blktap2/vhd/Makefile
+@@ -12,6 +12,7 @@ CFLAGS += -Werror
+ CFLAGS += -Wno-unused
+ CFLAGS += -I../include
+ CFLAGS += -D_GNU_SOURCE
++CFLAGS += $(CFLAGS_libxenctrl)
+
+ ifeq ($(CONFIG_X86_64),y)
+ CFLAGS += -fPIC
+--- xen-4.8.0.orig/tools/blktap2/vhd/lib/Makefile
++++ xen-4.8.0/tools/blktap2/vhd/lib/Makefile
+@@ -2,25 +2,19 @@ XEN_ROOT=$(CURDIR)/../../../..
+ BLKTAP_ROOT := ../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-LIBVHD-MAJOR = 1.0
+-LIBVHD-MINOR = 0
+-LIBVHD-SONAME = libvhd.so.$(LIBVHD-MAJOR)
+-
+ LVM-UTIL-OBJ := $(BLKTAP_ROOT)/lvm/lvm-util.o
+
+-LIBVHD-BUILD := libvhd.a
+-
+-INST-DIR = $(libdir)
+-
+ CFLAGS += -Werror
+ CFLAGS += -Wno-unused
+ CFLAGS += -I../../include
+ CFLAGS += -D_GNU_SOURCE
+ CFLAGS += -fPIC
++CFLAGS += $(CFLAGS_libxenctrl)
+
+ ifeq ($(CONFIG_Linux),y)
+ LIBS := -luuid
+ endif
++LDFLAGS += $(LDFLAGS_libxenctrl) $(call LDFLAGS_RPATH)
+
+ ifeq ($(CONFIG_LIBICONV),y)
+ LIBS += -liconv
+@@ -50,27 +44,22 @@ LIB-OBJS += $(LVM-UTIL-OBJ)
+
+ LIB-PICOBJS = $(patsubst %.o,%.opic,$(LIB-OBJS))
+
+-LIBVHD = libvhd.a libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR)
++LIBVHD = libvhd.a libvhd.so
+
+ all: build
+
+-build: libvhd.a libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR)
++build: libvhd.a libvhd.so
+
+ libvhd.a: $(LIB-OBJS)
+ $(AR) rc $@ $^
+
+-libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR): $(LIB-PICOBJS)
+- $(CC) -Wl,$(SONAME_LDFLAG),$(LIBVHD-SONAME) $(SHLIB_LDFLAGS) \
+- $(LDFLAGS) -o libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $^ $(LIBS)
+- ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) libvhd.so.$(LIBVHD-MAJOR)
+- ln -sf libvhd.so.$(LIBVHD-MAJOR) libvhd.so
++libvhd.so: $(LIB-PICOBJS)
++ $(CC) $(SHLIB_LDFLAGS) $(LDFLAGS) -o libvhd.so $^ $(LIBS)
+
+ install: all
+- $(INSTALL_DIR) -p $(DESTDIR)$(INST-DIR)
+- $(INSTALL_DATA) libvhd.a $(DESTDIR)$(INST-DIR)
+- $(INSTALL_PROG) libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)
+- ln -sf libvhd.so.$(LIBVHD-MAJOR).$(LIBVHD-MINOR) $(DESTDIR)$(INST-DIR)/libvhd.so.$(LIBVHD-MAJOR)
+- ln -sf libvhd.so.$(LIBVHD-MAJOR) $(DESTDIR)$(INST-DIR)/libvhd.so
++ $(INSTALL_DIR) -p $(DESTDIR)$(libdir)
++ $(INSTALL_DATA) libvhd.a $(DESTDIR)$(libdir)
++ $(INSTALL_PROG) libvhd.so $(DESTDIR)$(libdir)
+
+ clean:
+ rm -rf *.a *.so* *.o *.opic *~ $(DEPS) $(LIBVHD)
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:54 +0200
+X-Dgit-Generated: 4.8.0-1 1a0999bcbb1353ef27c9492386478fbbf57f4d15
+Subject: tools-console-prefix.diff
+
+Patch-Name: tools-console-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/console/Makefile
++++ xen-4.8.0/tools/console/Makefile
+@@ -8,6 +8,7 @@ CFLAGS += $(CFLAGS_libxenstore)
+ LDLIBS += $(LDLIBS_libxenctrl)
+ LDLIBS += $(LDLIBS_libxenstore)
+ LDLIBS += $(SOCKET_LIBS)
++LDFLAGS += $(call LDFLAGS_RPATH,../lib)
+
+ LDLIBS_xenconsoled += $(UTIL_LIBS)
+ LDLIBS_xenconsoled += -lrt
+@@ -44,9 +45,7 @@ $(eval $(genpath-target))
+
+ .PHONY: install
+ install: $(BIN)
+- $(INSTALL_DIR) $(DESTDIR)/$(sbindir)
+- $(INSTALL_PROG) xenconsoled $(DESTDIR)/$(sbindir)
+ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+- $(INSTALL_PROG) xenconsole $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_PROG) xenconsole xenconsoled $(DESTDIR)$(LIBEXEC_BIN)
+
+ -include $(DEPS)
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:30 +0200
+X-Dgit-Generated: 4.8.0-1 60e6ab661ea1c5a49f9e3a1448d997492c9f6658
+Subject: tools-include-install.diff
+
+Patch-Name: tools-include-install.diff
+
+---
+
+--- xen-4.8.0.orig/tools/include/Makefile
++++ xen-4.8.0/tools/include/Makefile
+@@ -14,7 +14,6 @@ xen-foreign:
+ xen/.dir:
+ @rm -rf xen
+ mkdir -p xen/libelf
+- ln -sf $(XEN_ROOT)/xen/include/public/COPYING xen
+ ln -sf $(wildcard $(XEN_ROOT)/xen/include/public/*.h) xen
+ ln -sf $(addprefix $(XEN_ROOT)/xen/include/public/,arch-x86 arch-arm hvm io xsm) xen
+ ln -sf ../xen-sys/$(XEN_OS) xen/sys
+@@ -43,7 +42,6 @@ install: all
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)/xen/io
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)/xen/sys
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)/xen/xsm
+- $(INSTALL_DATA) xen/COPYING $(DESTDIR)$(includedir)/xen
+ $(INSTALL_DATA) xen/*.h $(DESTDIR)$(includedir)/xen
+ $(INSTALL_DATA) xen/arch-x86/*.h $(DESTDIR)$(includedir)/xen/arch-x86
+ $(INSTALL_DATA) xen/arch-x86/hvm/*.h $(DESTDIR)$(includedir)/xen/arch-x86/hvm
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:47 +0200
+X-Dgit-Generated: 4.8.0-1 56f0d2bc148d4994820d353c8a790d4c2824c557
+Subject: tools-libfsimage-abiname.diff
+
+Patch-Name: tools-libfsimage-abiname.diff
+
+---
+
+--- xen-4.8.0.orig/tools/libfsimage/common/Makefile
++++ xen-4.8.0/tools/libfsimage/common/Makefile
+@@ -1,9 +1,6 @@
+ XEN_ROOT = $(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/libfsimage/Rules.mk
+
+-MAJOR = 1.0
+-MINOR = 0
+-
+ LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
+ LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
+ LDFLAGS = $(LDFLAGS-y)
+@@ -15,7 +12,7 @@ LIB_SRCS-y = fsimage.c fsimage_plugin.c
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+
+-LIB = libfsimage.so libfsimage.so.$(MAJOR) libfsimage.so.$(MAJOR).$(MINOR)
++LIB = libfsimage.so
+
+ .PHONY: all
+ all: $(LIB)
+@@ -24,9 +21,7 @@ all: $(LIB)
+ install: all
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+- $(INSTALL_PROG) libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+- ln -sf libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libfsimage.so.$(MAJOR)
+- ln -sf libfsimage.so.$(MAJOR) $(DESTDIR)$(libdir)/libfsimage.so
++ $(INSTALL_PROG) libfsimage.so $(DESTDIR)$(libdir)
+ $(INSTALL_DATA) fsimage.h $(DESTDIR)$(includedir)
+ $(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(includedir)
+ $(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(includedir)
+@@ -34,13 +29,8 @@ install: all
+ clean distclean::
+ rm -f $(LIB)
+
+-libfsimage.so: libfsimage.so.$(MAJOR)
+- ln -sf $< $@
+-libfsimage.so.$(MAJOR): libfsimage.so.$(MAJOR).$(MINOR)
+- ln -sf $< $@
+-
+-libfsimage.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libfsimage.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
++libfsimage.so: $(PIC_OBJS)
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(SHLIB_LDFLAGS) -o $@ $^ $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+
+ -include $(DEPS)
+
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:55 +0200
+X-Dgit-Generated: 4.8.0-1 090d51b2db5c61998cf4484e95953bce59d07b0f
+Subject: tools-libfsimage-prefix.diff
+
+Patch-Name: tools-libfsimage-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/libfsimage/Rules.mk
++++ xen-4.8.0/tools/libfsimage/Rules.mk
+@@ -3,10 +3,11 @@ include $(XEN_ROOT)/tools/Rules.mk
+ CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
+ CFLAGS += -Werror -D_GNU_SOURCE
+ LDFLAGS += -L../common/
++LDFLAGS += $(call LDFLAGS_RPATH,../..)
+
+ PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
+
+-FSDIR = $(libdir)/fs
++FSDIR = $(LIBEXEC_LIB)/fs
+
+ FSLIB = fsimage.so
+
+--- xen-4.8.0.orig/tools/libfsimage/common/Makefile
++++ xen-4.8.0/tools/libfsimage/common/Makefile
+@@ -1,6 +1,8 @@
+ XEN_ROOT = $(CURDIR)/../../..
+ include $(XEN_ROOT)/tools/libfsimage/Rules.mk
+
++CFLAGS += -DFSDIR="\"$(LIBEXEC_LIB)/fs\""
++
+ LDFLAGS-$(CONFIG_SunOS) = -Wl,-M -Wl,mapfile-SunOS
+ LDFLAGS-$(CONFIG_Linux) = -Wl,mapfile-GNU
+ LDFLAGS = $(LDFLAGS-y)
+@@ -19,9 +21,9 @@ all: $(LIB)
+
+ .PHONY: install
+ install: all
+- $(INSTALL_DIR) $(DESTDIR)$(libdir)
++ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_LIB)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+- $(INSTALL_PROG) libfsimage.so $(DESTDIR)$(libdir)
++ $(INSTALL_PROG) libfsimage.so $(DESTDIR)$(LIBEXEC_LIB)
+ $(INSTALL_DATA) fsimage.h $(DESTDIR)$(includedir)
+ $(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(includedir)
+ $(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(includedir)
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:48 +0200
+X-Dgit-Generated: 4.8.0-1 dfe5c0728e9ba76bd325925e0f6a4061abec66f4
+Subject: tools-libxc-abiname.diff
+
+Patch-Name: tools-libxc-abiname.diff
+
+---
+
+--- xen-4.8.0.orig/tools/libxc/Makefile
++++ xen-4.8.0/tools/libxc/Makefile
+@@ -1,9 +1,6 @@
+ XEN_ROOT = $(CURDIR)/../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-MAJOR = 4.8
+-MINOR = 0
+-
+ ifeq ($(CONFIG_LIBXC_MINIOS),y)
+ # Save/restore of a domain is currently incompatible with a stubdom environment
+ override CONFIG_MIGRATE := n
+@@ -132,12 +129,12 @@ $(CTRL_LIB_OBJS) $(CTRL_PIC_OBJS): CFLAG
+
+ LIB := libxenctrl.a
+ ifneq ($(nosharedlibs),y)
+-LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
++LIB += libxenctrl.so libxenctrl-$(PACKAGE_VERSION).so
+ endif
+
+ LIB += libxenguest.a
+ ifneq ($(nosharedlibs),y)
+-LIB += libxenguest.so libxenguest.so.$(MAJOR) libxenguest.so.$(MAJOR).$(MINOR)
++LIB += libxenguest.so libxenguest-$(PACKAGE_VERSION).so
+ endif
+
+ genpath-target = $(call buildmakevars2header,_paths.h)
+@@ -171,15 +168,13 @@ libs: $(LIB)
+ install: build
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+- $(INSTALL_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
++ $(INSTALL_SHLIB) libxenctrl-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)
++ $(SYMLINK_SHLIB) libxenctrl-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libxenctrl.so
+ $(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenctrl.so.$(MAJOR)
+- $(SYMLINK_SHLIB) libxenctrl.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenctrl.so
+ $(INSTALL_DATA) include/xenctrl.h include/xenctrl_compat.h $(DESTDIR)$(includedir)
+- $(INSTALL_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
++ $(INSTALL_SHLIB) libxenguest-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)
++ $(SYMLINK_SHLIB) libxenguest-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libxenguest.so
+ $(INSTALL_DATA) libxenguest.a $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenguest.so.$(MAJOR)
+- $(SYMLINK_SHLIB) libxenguest.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenguest.so
+ $(INSTALL_DATA) include/xenguest.h $(DESTDIR)$(includedir)
+
+ .PHONY: TAGS
+@@ -211,22 +206,18 @@ rpm: build
+ libxenctrl.a: $(CTRL_LIB_OBJS)
+ $(AR) rc $@ $^
+
+-libxenctrl.so: libxenctrl.so.$(MAJOR)
+- $(SYMLINK_SHLIB) $< $@
+-libxenctrl.so.$(MAJOR): libxenctrl.so.$(MAJOR).$(MINOR)
++libxenctrl.so: libxenctrl-$(PACKAGE_VERSION).so
+ $(SYMLINK_SHLIB) $< $@
+
+-libxenctrl.so.$(MAJOR).$(MINOR): $(CTRL_PIC_OBJS)
+- $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenctrl.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxencall) $(LDLIBS_libxenforeignmemory) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
++libxenctrl-$(PACKAGE_VERSION).so: $(CTRL_PIC_OBJS)
++ $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(SHLIB_LDFLAGS) -o $@ $^ $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxengntshr) $(LDLIBS_libxencall) $(LDLIBS_libxenforeignmemory) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+
+ # libxenguest
+
+ libxenguest.a: $(GUEST_LIB_OBJS)
+ $(AR) rc $@ $^
+
+-libxenguest.so: libxenguest.so.$(MAJOR)
+- $(SYMLINK_SHLIB) $< $@
+-libxenguest.so.$(MAJOR): libxenguest.so.$(MAJOR).$(MINOR)
++libxenguest.so: libxenguest-$(PACKAGE_VERSION).so
+ $(SYMLINK_SHLIB) $< $@
+
+ ifeq ($(CONFIG_MiniOS),y)
+@@ -238,9 +229,9 @@ endif
+ xc_dom_bzimageloader.o: CFLAGS += $(filter -D%,$(zlib-options))
+ xc_dom_bzimageloader.opic: CFLAGS += $(filter -D%,$(zlib-options))
+
+-libxenguest.so.$(MAJOR).$(MINOR): COMPRESSION_LIBS = $(filter -l%,$(zlib-options))
+-libxenguest.so.$(MAJOR).$(MINOR): $(GUEST_PIC_OBJS) libxenctrl.so
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenguest.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
++libxenguest-$(PACKAGE_VERSION).so: COMPRESSION_LIBS = $(call zlib-options,l)
++libxenguest-$(PACKAGE_VERSION).so: $(GUEST_PIC_OBJS) libxenctrl-$(PACKAGE_VERSION).so
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(SHLIB_LDFLAGS) -o $@ $(GUEST_PIC_OBJS) $(COMPRESSION_LIBS) -lz $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(PTHREAD_LIBS) $(APPEND_LDFLAGS)
+
+ -include $(DEPS)
+
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:49 +0200
+X-Dgit-Generated: 4.8.0-1 61afd0e75a56b040d4c4c59bc134bb4baaed7072
+Subject: tools-libxl-abiname.diff
+
+Patch-Name: tools-libxl-abiname.diff
+
+---
+
+--- xen-4.8.0.orig/tools/libxl/Makefile
++++ xen-4.8.0/tools/libxl/Makefile
+@@ -5,12 +5,6 @@
+ XEN_ROOT = $(CURDIR)/../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
+-MAJOR = 4.8
+-MINOR = 0
+-
+-XLUMAJOR = 4.8
+-XLUMINOR = 0
+-
+ CFLAGS += -Werror -Wno-format-zero-length -Wmissing-declarations \
+ -Wno-declaration-after-statement -Wformat-nonliteral
+ CFLAGS += -I. -fPIC
+@@ -258,29 +252,23 @@ _libxl_type%.h _libxl_type%_json.h _libx
+ $(call move-if-changed,__libxl_type$*_json.h,_libxl_type$*_json.h)
+ $(call move-if-changed,__libxl_type$*.c,_libxl_type$*.c)
+
+-libxenlight.so: libxenlight.so.$(MAJOR)
+- $(SYMLINK_SHLIB) $< $@
+-
+-libxenlight.so.$(MAJOR): libxenlight.so.$(MAJOR).$(MINOR)
++libxenlight.so: libxenlight-$(PACKAGE_VERSION).so
+ $(SYMLINK_SHLIB) $< $@
+
+-libxenlight.so.$(MAJOR).$(MINOR): $(LIBXL_OBJS)
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS)
++libxenlight-$(PACKAGE_VERSION).so: $(LIBXL_OBJS)
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS)
+
+ libxenlight_test.so: $(LIBXL_OBJS) $(LIBXL_TEST_OBJS)
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenlight.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS)
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS)
+
+ libxenlight.a: $(LIBXL_OBJS)
+ $(AR) rcs libxenlight.a $^
+
+-libxlutil.so: libxlutil.so.$(XLUMAJOR)
+- $(SYMLINK_SHLIB) $< $@
+-
+-libxlutil.so.$(XLUMAJOR): libxlutil.so.$(XLUMAJOR).$(XLUMINOR)
++libxlutil.so: libxlutil-$(PACKAGE_VERSION).so
+ $(SYMLINK_SHLIB) $< $@
+
+-libxlutil.so.$(XLUMAJOR).$(XLUMINOR): $(LIBXLU_OBJS) libxenlight.so
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxlutil.so.$(XLUMAJOR) $(SHLIB_LDFLAGS) -o $@ $(LIBXLU_OBJS) $(LIBXLU_LIBS) $(APPEND_LDFLAGS)
++libxlutil-$(PACKAGE_VERSION).so: $(LIBXLU_OBJS) libxenlight.so
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(SHLIB_LDFLAGS) -o $@ $(LIBXLU_OBJS) $(LIBXLU_LIBS) $(APPEND_LDFLAGS)
+
+ libxlutil.a: $(LIBXLU_OBJS)
+ $(AR) rcs libxlutil.a $^
+@@ -298,7 +286,7 @@ testidl: testidl.o libxlutil.so libxenli
+ $(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+ $(PKG_CONFIG): % : %.in Makefile
+- @sed -e 's/@@version@@/$(MAJOR).$(MINOR)/g' < $< > $@.new
++ @sed -e 's/@@version@@/$(PACKAGE_VERSION)/g' < $< > $@.new
+ @mv -f $@.new $@
+
+ .PHONY: install
+@@ -311,13 +299,11 @@ install: all
+ $(INSTALL_DIR) $(DESTDIR)$(PKG_INSTALLDIR)
+ $(INSTALL_PROG) xl $(DESTDIR)$(sbindir)
+ $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
+- $(INSTALL_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxenlight.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenlight.so.$(MAJOR)
+- $(SYMLINK_SHLIB) libxenlight.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenlight.so
++ $(INSTALL_SHLIB) libxenlight-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)
++ $(SYMLINK_SHLIB) libxenlight-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libxenlight.so
+ $(INSTALL_DATA) libxenlight.a $(DESTDIR)$(libdir)
+- $(INSTALL_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR).$(XLUMINOR) $(DESTDIR)$(libdir)/libxlutil.so.$(XLUMAJOR)
+- $(SYMLINK_SHLIB) libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(libdir)/libxlutil.so
++ $(INSTALL_SHLIB) libxlutil-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)
++ $(SYMLINK_SHLIB) libxlutil-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libxlutil.so
+ $(INSTALL_DATA) libxlutil.a $(DESTDIR)$(libdir)
+ $(INSTALL_DATA) libxl.h libxl_event.h libxl_json.h _libxl_types.h _libxl_types_json.h _libxl_list.h libxl_utils.h libxl_uuid.h libxlutil.h $(DESTDIR)$(includedir)
+ $(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:57 +0200
+X-Dgit-Generated: 4.8.0-1 6145c0f51f09d6751b38a28b913ead2e44906b52
+Subject: tools-libxl-prefix.diff
+
+Patch-Name: tools-libxl-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/libxl/Makefile
++++ xen-4.8.0/tools/libxl/Makefile
+@@ -12,6 +12,8 @@ CFLAGS += -I. -fPIC
+ ifeq ($(CONFIG_Linux),y)
+ LIBUUID_LIBS += -luuid
+ endif
++LDFLAGS_XL = $(call LDFLAGS_RPATH,../lib)
++LDFLAGS_LIBXL = $(call LDFLAGS_RPATH)
+
+ LIBXL_LIBS =
+ LIBXL_LIBS = $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenstore) $(LDLIBS_libblktapctl) $(PTYFUNCS_LIBS) $(LIBUUID_LIBS)
+@@ -256,7 +258,7 @@ libxenlight.so: libxenlight-$(PACKAGE_VE
+ $(SYMLINK_SHLIB) $< $@
+
+ libxenlight-$(PACKAGE_VERSION).so: $(LIBXL_OBJS)
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS)
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(LDFLAGS_LIBXL) $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS)
+
+ libxenlight_test.so: $(LIBXL_OBJS) $(LIBXL_TEST_OBJS)
+ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG),$@ $(SHLIB_LDFLAGS) -o $@ $^ $(LIBXL_LIBS) $(APPEND_LDFLAGS)
+@@ -274,7 +276,7 @@ libxlutil.a: $(LIBXLU_OBJS)
+ $(AR) rcs libxlutil.a $^
+
+ xl: $(XL_OBJS) libxlutil.so libxenlight.so
+- $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
++ $(CC) $(LDFLAGS) $(LDFLAGS_XL) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
+
+ test_%: test_%.o test_common.o libxlutil.so libxenlight_test.so
+ $(CC) $(LDFLAGS) -o $@ $^ $(filter-out %libxenlight.so, $(LDLIBS_libxenlight)) $(LDLIBS_libxentoollog) -lyajl $(APPEND_LDFLAGS)
+@@ -291,13 +293,12 @@ $(PKG_CONFIG): % : %.in Makefile
+
+ .PHONY: install
+ install: all
+- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+ $(INSTALL_DIR) $(DESTDIR)$(BASH_COMPLETION_DIR)
+ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+ $(INSTALL_DIR) $(DESTDIR)$(PKG_INSTALLDIR)
+- $(INSTALL_PROG) xl $(DESTDIR)$(sbindir)
++ $(INSTALL_PROG) xl $(DESTDIR)$(LIBEXEC_BIN)
+ $(INSTALL_PROG) libxl-save-helper $(DESTDIR)$(LIBEXEC_BIN)
+ $(INSTALL_SHLIB) libxenlight-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)
+ $(SYMLINK_SHLIB) libxenlight-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libxenlight.so
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:59 +0200
+X-Dgit-Generated: 4.8.0-1 0f9add61cf5bc5c16679583be852f6fa6d14b3cb
+Subject: tools-misc-prefix.diff
+
+Patch-Name: tools-misc-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/misc/Makefile
++++ xen-4.8.0/tools/misc/Makefile
+@@ -54,12 +54,8 @@ all build: $(TARGETS_BUILD)
+
+ .PHONY: install
+ install: build
+- $(INSTALL_DIR) $(DESTDIR)$(bindir)
+- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
+ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+- $(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(DESTDIR)$(bindir)
+- $(INSTALL_PYTHON_PROG) $(INSTALL_SBIN) $(DESTDIR)$(sbindir)
+- $(INSTALL_PYTHON_PROG) $(INSTALL_PRIVBIN) $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_PYTHON_PROG) $(INSTALL_BIN) $(INSTALL_SBIN) $(INSTALL_PRIVBIN) $(DESTDIR)$(LIBEXEC_BIN)
+
+ .PHONY: clean
+ clean:
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:01 +0200
+X-Dgit-Generated: 4.8.0-1 b97429ed3ffcc955cddefb2434cdefe10a63bea0
+Subject: tools-pygrub-prefix.diff
+
+Patch-Name: tools-pygrub-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/pygrub/Makefile
++++ xen-4.8.0/tools/pygrub/Makefile
+@@ -16,11 +16,6 @@ install: all
+ CC="$(CC)" CFLAGS="$(PY_CFLAGS)" LDFLAGS="$(PY_LDFLAGS)" $(PYTHON) \
+ setup.py install $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
+ --install-scripts=$(LIBEXEC_BIN) --force
+- set -e; if [ $(bindir) != $(LIBEXEC_BIN) -a \
+- "`readlink -f $(DESTDIR)/$(bindir)`" != \
+- "`readlink -f $(LIBEXEC_BIN)`" ]; then \
+- ln -sf $(LIBEXEC_BIN)/pygrub $(DESTDIR)/$(bindir); \
+- fi
+
+ .PHONY: clean
+ clean:
+--- xen-4.8.0.orig/tools/pygrub/setup.py
++++ xen-4.8.0/tools/pygrub/setup.py
+@@ -4,11 +4,13 @@ import os
+ import sys
+
+ extra_compile_args = [ "-fno-strict-aliasing", "-Werror" ]
++extra_link_args = [ "-Wl,-rpath,${ORIGIN}/.." ]
+
+ XEN_ROOT = "../.."
+
+ fsimage = Extension("fsimage",
+ extra_compile_args = extra_compile_args,
++ extra_link_args = extra_link_args,
+ include_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
+ library_dirs = [ XEN_ROOT + "/tools/libfsimage/common/" ],
+ libraries = ["fsimage"],
+--- xen-4.8.0.orig/tools/pygrub/src/pygrub
++++ xen-4.8.0/tools/pygrub/src/pygrub
+@@ -21,6 +21,8 @@ import xen.lowlevel.xc
+ import curses, _curses, curses.wrapper, curses.textpad, curses.ascii
+ import getopt
+
++sys.path.insert(1, sys.path[0] + '/../lib/python')
++
+ import fsimage
+ import grub.GrubConf
+ import grub.LiloConf
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:29 +0200
+X-Dgit-Generated: 4.8.0-1 e248ab24fad6d000bdd0b7c80b41899cc7ae089b
+Subject: Remove static solaris support from pygrub
+
+Patch-Name: tools-pygrub-remove-static-solaris-support
+
+---
+
+--- xen-4.8.0.orig/tools/pygrub/src/pygrub
++++ xen-4.8.0/tools/pygrub/src/pygrub
+@@ -16,7 +16,6 @@ import os, sys, string, struct, tempfile
+ import copy
+ import logging
+ import platform
+-import xen.lowlevel.xc
+
+ import curses, _curses, curses.wrapper, curses.textpad, curses.ascii
+ import getopt
+@@ -668,51 +667,6 @@ def run_grub(file, entry, fs, cfg_args):
+
+ return grubcfg
+
+-def supports64bitPVguest():
+- xc = xen.lowlevel.xc.xc()
+- caps = xc.xeninfo()['xen_caps'].split(" ")
+- for cap in caps:
+- if cap == "xen-3.0-x86_64":
+- return True
+- return False
+-
+-# If nothing has been specified, look for a Solaris domU. If found, perform the
+-# necessary tweaks.
+-def sniff_solaris(fs, cfg):
+- if not fs.file_exists("/platform/i86xpv/kernel/unix") and \
+- not fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
+- return cfg
+-
+- if not cfg["kernel"]:
+- if supports64bitPVguest() and \
+- fs.file_exists("/platform/i86xpv/kernel/amd64/unix"):
+- cfg["kernel"] = "/platform/i86xpv/kernel/amd64/unix"
+- cfg["ramdisk"] = "/platform/i86pc/amd64/boot_archive"
+- elif fs.file_exists("/platform/i86xpv/kernel/unix"):
+- cfg["kernel"] = "/platform/i86xpv/kernel/unix"
+- cfg["ramdisk"] = "/platform/i86pc/boot_archive"
+- else:
+- return cfg
+-
+- # Unpleasant. Typically we'll have 'root=foo -k' or 'root=foo /kernel -k',
+- # and we need to maintain Xen properties (root= and ip=) and the kernel
+- # before any user args.
+-
+- xenargs = ""
+- userargs = ""
+-
+- if not cfg["args"]:
+- cfg["args"] = cfg["kernel"]
+- else:
+- for arg in cfg["args"].split():
+- if re.match("^root=", arg) or re.match("^ip=", arg):
+- xenargs += arg + " "
+- elif arg != cfg["kernel"]:
+- userargs += arg + " "
+- cfg["args"] = xenargs + " " + cfg["kernel"] + " " + userargs
+-
+- return cfg
+-
+ def sniff_netware(fs, cfg):
+ if not fs.file_exists("/nwserver/xnloader.sys"):
+ return cfg
+@@ -901,10 +855,7 @@ if __name__ == "__main__":
+ try:
+ fs = fsimage.open(file, offset, bootfsoptions)
+
+- chosencfg = sniff_solaris(fs, incfg)
+-
+- if not chosencfg["kernel"]:
+- chosencfg = sniff_netware(fs, incfg)
++ chosencfg = sniff_netware(fs, incfg)
+
+ if not chosencfg["kernel"]:
+ chosencfg = run_grub(file, entry, fs, incfg["args"])
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:02 +0200
+X-Dgit-Generated: 4.8.0-1 19c11a0cbbd0ee148d0cc929ad3b874d264b3bb7
+Subject: tools-python-prefix.diff
+
+Patch-Name: tools-python-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/python/setup.py
++++ xen-4.8.0/tools/python/setup.py
+@@ -5,6 +5,7 @@ import os, sys
+ XEN_ROOT = "../.."
+
+ extra_compile_args = [ "-fno-strict-aliasing", "-Werror" ]
++extra_link_args = [ "-Wl,-rpath,${ORIGIN}/../../.." ]
+
+ PATH_XEN = XEN_ROOT + "/tools/include"
+ PATH_LIBXENTOOLLOG = XEN_ROOT + "/tools/libs/toollog"
+@@ -23,11 +24,12 @@ xc = Extension("xc",
+ library_dirs = [ PATH_LIBXC ],
+ libraries = [ "xenctrl", "xenguest" ],
+ depends = [ PATH_LIBXC + "/libxenctrl.so", PATH_LIBXC + "/libxenguest.so" ],
+- extra_link_args = [ "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
++ extra_link_args = extra_link_args + [ "-Wl,-rpath-link="+PATH_LIBXENTOOLLOG ],
+ sources = [ "xen/lowlevel/xc/xc.c" ])
+
+ xs = Extension("xs",
+ extra_compile_args = extra_compile_args,
++ extra_link_args = extra_link_args,
+ include_dirs = [ PATH_XEN, PATH_XENSTORE + "/include", "xen/lowlevel/xs" ],
+ library_dirs = [ PATH_XENSTORE ],
+ libraries = [ "xenstore" ],
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:51 +0200
+X-Dgit-Generated: 4.8.0-1 24aea617bb0d5fa2192de6d273f8381b42356814
+Subject: tools-rpath.diff
+
+Patch-Name: tools-rpath.diff
+
+---
+
+--- xen-4.8.0.orig/tools/Rules.mk
++++ xen-4.8.0/tools/Rules.mk
+@@ -9,6 +9,8 @@ include $(XEN_ROOT)/Config.mk
+ export _INSTALL := $(INSTALL)
+ INSTALL = $(XEN_ROOT)/tools/cross-install
+
++LDFLAGS_RPATH = -Wl,-rpath,'$${ORIGIN}$(if $(1),/$(1))'
++
+ XEN_INCLUDE = $(XEN_ROOT)/tools/include
+ XEN_LIBXENTOOLLOG = $(XEN_ROOT)/tools/libs/toollog
+ XEN_LIBXENEVTCHN = $(XEN_ROOT)/tools/libs/evtchn
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:05 +0200
+X-Dgit-Generated: 4.8.0-1 7a0d6bd02b05da839198aacbd2f89273a615afe2
+Subject: tools-xcutils-rpath.diff
+
+Patch-Name: tools-xcutils-rpath.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xcutils/Makefile
++++ xen-4.8.0/tools/xcutils/Makefile
+@@ -19,6 +19,8 @@ CFLAGS += -Werror
+ CFLAGS_readnotes.o := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall)
+ CFLAGS_lsevtchn.o := $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl)
+
++APPEND_LDFLAGS += $(call LDFLAGS_RPATH,../lib)
++
+ .PHONY: all
+ all: build
+
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:31 +0200
+X-Dgit-Generated: 4.8.0-1 9ec2fb473f9f58e6c168bf9826e762091dc8d663
+Subject: tools-xenmon-install.diff
+
+Patch-Name: tools-xenmon-install.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xenmon/Makefile
++++ xen-4.8.0/tools/xenmon/Makefile
+@@ -13,6 +13,10 @@
+ XEN_ROOT=$(CURDIR)/../..
+ include $(XEN_ROOT)/tools/Rules.mk
+
++DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path)
++PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH)
++INSTALL_PYTHON_PROG = $(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG)
++
+ CFLAGS += -Werror
+ CFLAGS += $(CFLAGS_libxenevtchn)
+ CFLAGS += $(CFLAGS_libxenctrl)
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:06 +0200
+X-Dgit-Generated: 4.8.0-1 4a89833869a969dc2b995319886e2c956ae80c3e
+Subject: tools-xenmon-prefix.diff
+
+Patch-Name: tools-xenmon-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xenmon/Makefile
++++ xen-4.8.0/tools/xenmon/Makefile
+@@ -18,6 +18,7 @@ CFLAGS += $(CFLAGS_libxenevtchn)
+ CFLAGS += $(CFLAGS_libxenctrl)
+ LDLIBS += $(LDLIBS_libxenctrl)
+ LDLIBS += $(LDLIBS_libxenevtchn)
++LDFLAGS += $(call LDFLAGS_RPATH,../lib)
+
+ SCRIPTS = xenmon.py
+
+@@ -29,10 +30,10 @@ build: xentrace_setmask xenbaked
+
+ .PHONY: install
+ install: build
+- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
+- $(INSTALL_PROG) xenbaked $(DESTDIR)$(sbindir)/xenbaked
+- $(INSTALL_PROG) xentrace_setmask $(DESTDIR)$(sbindir)/xentrace_setmask
+- $(INSTALL_PROG) xenmon.py $(DESTDIR)$(sbindir)/xenmon.py
++ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_PROG) xenbaked $(DESTDIR)$(LIBEXEC_BIN)/xenbaked
++ $(INSTALL_PROG) xentrace_setmask $(DESTDIR)$(LIBEXEC_BIN)/xentrace_setmask
++ $(INSTALL_PROG) xenmon.py $(DESTDIR)$(LIBEXEC_BIN)/xenmon.py
+
+ .PHONY: clean
+ clean:
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:08 +0200
+X-Dgit-Generated: 4.8.0-1 26811faa1d2ddf9d8a3a92b75fb360a877529e9b
+Subject: tools-xenpaging-prefix.diff
+
+Patch-Name: tools-xenpaging-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xenpaging/Makefile
++++ xen-4.8.0/tools/xenpaging/Makefile
+@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
+ # xenpaging.c and file_ops.c incorrectly use libxc internals
+ CFLAGS += $(CFLAGS_libxentoollog) $(CFLAGS_libxenevtchn) $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(PTHREAD_CFLAGS) -I$(XEN_ROOT)/tools/libxc $(CFLAGS_libxencall)
+ LDLIBS += $(LDLIBS_libxentoollog) $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(PTHREAD_LIBS)
+-LDFLAGS += $(PTHREAD_LDFLAGS)
++LDFLAGS += $(PTHREAD_LDFLAGS) $(call LDFLAGS_RPATH,../lib)
+
+ POLICY = default
+
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 13 Dec 2014 19:37:02 +0100
+X-Dgit-Generated: 4.8.0-1 ac34f64df80d650a1bb579f762c5738ef3990e15
+Subject: tools-xenpmd-prefix.diff
+
+Patch-Name: tools-xenpmd-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xenpmd/Makefile
++++ xen-4.8.0/tools/xenpmd/Makefile
+@@ -11,8 +11,8 @@ all: xenpmd
+
+ .PHONY: install
+ install: all
+- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
+- $(INSTALL_PROG) xenpmd $(DESTDIR)$(sbindir)
++ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_PROG) xenpmd $(DESTDIR)$(LIBEXEC_BIN)
+
+ .PHONY: clean
+ clean:
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:50 +0200
+X-Dgit-Generated: 4.8.0-1 22015d652df3325f847789b2b4a0021e48455fd9
+Subject: tools-xenstat-abiname.diff
+
+Patch-Name: tools-xenstat-abiname.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xenstat/libxenstat/Makefile
++++ xen-4.8.0/tools/xenstat/libxenstat/Makefile
+@@ -18,18 +18,14 @@ include $(XEN_ROOT)/tools/Rules.mk
+ LDCONFIG=ldconfig
+ MAKE_LINK=ln -sf
+
+-MAJOR=0
+-MINOR=0
+-
+ LIB=src/libxenstat.a
+-SHLIB=src/libxenstat.so.$(MAJOR).$(MINOR)
+-SHLIB_LINKS=src/libxenstat.so.$(MAJOR) src/libxenstat.so
+-OBJECTS-y=src/xenstat.o src/xenstat_qmp.o
++SHLIB=src/libxenstat.so
++OBJECTS-y=src/xenstat.o
+ OBJECTS-$(CONFIG_Linux) += src/xenstat_linux.o
+ OBJECTS-$(CONFIG_SunOS) += src/xenstat_solaris.o
+ OBJECTS-$(CONFIG_NetBSD) += src/xenstat_netbsd.o
+ OBJECTS-$(CONFIG_FreeBSD) += src/xenstat_freebsd.o
+-SONAME_FLAGS=-Wl,$(SONAME_LDFLAG) -Wl,libxenstat.so.$(MAJOR)
++SONAME_FLAGS=-Wl,$(SONAME_LDFLAG),libxenstat.so
+
+ CFLAGS+=-fPIC
+ CFLAGS+=-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) -include $(XEN_ROOT)/tools/config.h
+@@ -38,7 +34,7 @@ LDLIBS-y = $(LDLIBS_libxenstore) $(LDLIB
+ LDLIBS-$(CONFIG_SunOS) += -lkstat
+
+ .PHONY: all
+-all: $(LIB) $(SHLIB) $(SHLIB_LINKS)
++all: $(LIB) $(SHLIB)
+
+ $(OBJECTS-y): src/_paths.h
+
+@@ -50,19 +46,11 @@ $(SHLIB): $(OBJECTS-y)
+ $(CC) $(LDFLAGS) $(SONAME_FLAGS) $(SHLIB_LDFLAGS) -o $@ \
+ $(OBJECTS-y) $(LDLIBS-y) $(APPEND_LDFLAGS)
+
+-src/libxenstat.so.$(MAJOR): $(SHLIB)
+- $(MAKE_LINK) $(<F) $@
+-
+-src/libxenstat.so: src/libxenstat.so.$(MAJOR)
+- $(MAKE_LINK) $(<F) $@
+-
+ .PHONY: install
+ install: all
+ $(INSTALL_DATA) src/xenstat.h $(DESTDIR)$(includedir)
+ $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/libxenstat.a
+- $(INSTALL_PROG) src/libxenstat.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+- ln -sf libxenstat.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenstat.so.$(MAJOR)
+- ln -sf libxenstat.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenstat.so
++ $(INSTALL_PROG) src/libxenstat.so $(DESTDIR)$(libdir)
+
+ PYLIB=bindings/swig/python/_xenstat.so
+ PYMOD=bindings/swig/python/xenstat.py
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:09 +0200
+X-Dgit-Generated: 4.8.0-1 e66eb91ce36d0fc6f1e77edc3a7c38b0b5ac8224
+Subject: tools-xenstat-prefix.diff
+
+Patch-Name: tools-xenstat-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xenstat/libxenstat/Makefile
++++ xen-4.8.0/tools/xenstat/libxenstat/Makefile
+@@ -20,7 +20,7 @@ MAKE_LINK=ln -sf
+
+ LIB=src/libxenstat.a
+ SHLIB=src/libxenstat.so
+-OBJECTS-y=src/xenstat.o
++OBJECTS-y=src/xenstat.o src/xenstat_qmp.o
+ OBJECTS-$(CONFIG_Linux) += src/xenstat_linux.o
+ OBJECTS-$(CONFIG_SunOS) += src/xenstat_solaris.o
+ OBJECTS-$(CONFIG_NetBSD) += src/xenstat_netbsd.o
+@@ -48,9 +48,11 @@ $(SHLIB): $(OBJECTS-y)
+
+ .PHONY: install
+ install: all
++ $(INSTALL_DIR) $(DESTDIR)$(includedir)
++ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_LIB)
+ $(INSTALL_DATA) src/xenstat.h $(DESTDIR)$(includedir)
+ $(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/libxenstat.a
+- $(INSTALL_PROG) src/libxenstat.so $(DESTDIR)$(libdir)
++ $(INSTALL_PROG) src/libxenstat.so $(DESTDIR)$(LIBEXEC_LIB)
+
+ PYLIB=bindings/swig/python/_xenstat.so
+ PYMOD=bindings/swig/python/xenstat.py
+--- xen-4.8.0.orig/tools/xenstat/xentop/Makefile
++++ xen-4.8.0/tools/xenstat/xentop/Makefile
+@@ -19,7 +19,9 @@ all install xentop:
+ else
+
+ CFLAGS += -DGCC_PRINTF -Werror $(CFLAGS_libxenstat)
++LDFLAGS += $(call LDFLAGS_RPATH,../lib)
+ LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(TINFO_LIBS) $(SOCKET_LIBS) -lm -lyajl
++LDLIBS += $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore)
+ CFLAGS += -DHOST_$(XEN_OS)
+
+ # Include configure output (config.h)
+@@ -31,8 +33,8 @@ all: xentop
+
+ .PHONY: install
+ install: xentop
+- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
+- $(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
++ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_PROG) xentop $(DESTDIR)$(LIBEXEC_BIN)/xentop
+
+ endif
+
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:36 +0200
+X-Dgit-Generated: 4.8.0-1 d1702f551b27b4f14bd88377848a571ed6c53967
+Subject: tools-xenstore-compatibility.diff
+
+Patch-Name: tools-xenstore-compatibility.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xenstore/include/xenstore.h
++++ xen-4.8.0/tools/xenstore/include/xenstore.h
+@@ -25,6 +25,7 @@
+
+ #define XS_OPEN_READONLY 1UL<<0
+ #define XS_OPEN_SOCKETONLY 1UL<<1
++#define XS_OPEN_DOMAINONLY 1UL<<2
+
+ /*
+ * Setting XS_UNWATCH_FILTER arranges that after xs_unwatch, no
+--- xen-4.8.0.orig/tools/xenstore/xenstore_client.c
++++ xen-4.8.0/tools/xenstore/xenstore_client.c
+@@ -636,7 +636,7 @@ main(int argc, char **argv)
+ max_width = ws.ws_col - 2;
+ }
+
+- xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : 0);
++ xsh = xs_open(socket ? XS_OPEN_SOCKETONLY : XS_OPEN_DOMAINONLY);
+ if (xsh == NULL) err(1, "xs_open");
+
+ again:
+--- xen-4.8.0.orig/tools/xenstore/xs.c
++++ xen-4.8.0/tools/xenstore/xs.c
+@@ -281,17 +281,19 @@ struct xs_handle *xs_daemon_open_readonl
+
+ struct xs_handle *xs_domain_open(void)
+ {
+- return xs_open(0);
++ return xs_open(XS_OPEN_DOMAINONLY);
+ }
+
+ struct xs_handle *xs_open(unsigned long flags)
+ {
+ struct xs_handle *xsh = NULL;
+
++ if (!(flags & XS_OPEN_DOMAINONLY)) {
+ if (flags & XS_OPEN_READONLY)
+ xsh = get_handle(xs_daemon_socket_ro());
+ else
+ xsh = get_handle(xs_daemon_socket());
++ }
+
+ if (!xsh && !(flags & XS_OPEN_SOCKETONLY))
+ xsh = get_handle(xs_domain_dev());
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:12 +0200
+X-Dgit-Generated: 4.8.0-1 a9d985943d374c77555ab55eed996c931a18ec70
+Subject: tools-xenstore-prefix.diff
+
+Patch-Name: tools-xenstore-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/helpers/Makefile
++++ xen-4.8.0/tools/helpers/Makefile
+@@ -31,7 +31,7 @@ xen-init-dom0: $(XEN_INIT_DOM0_OBJS)
+ $(INIT_XENSTORE_DOMAIN_OBJS): _paths.h
+
+ init-xenstore-domain: $(INIT_XENSTORE_DOMAIN_OBJS)
+- $(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenlight) $(APPEND_LDFLAGS)
++ $(CC) $(LDFLAGS) -o $@ $(INIT_XENSTORE_DOMAIN_OBJS) $(LDLIBS_libxentoollog) $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) $(LDLIBS_libxenguest) $(LDLIBS_libxenlight) $(call LDFLAGS_RPATH,../lib) $(APPEND_LDFLAGS)
+
+ .PHONY: install
+ install: all
+--- xen-4.8.0.orig/tools/xenstore/Makefile
++++ xen-4.8.0/tools/xenstore/Makefile
+@@ -20,6 +20,8 @@ LDFLAGS-$(CONFIG_SYSTEMD) += $(SYSTEMD_L
+ CFLAGS += $(CFLAGS-y)
+ LDFLAGS += $(LDFLAGS-y)
+
++LDFLAGS_libxenctrl += $(call LDFLAGS_RPATH,../lib)
++
+ CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
+ CLIENTS += xenstore-write xenstore-ls xenstore-watch
+
+@@ -73,7 +75,7 @@ endif
+ $(XENSTORED_OBJS): CFLAGS += $(CFLAGS_libxengnttab)
+
+ xenstored: $(XENSTORED_OBJS)
+- $(CC) $^ $(LDFLAGS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@ $(APPEND_LDFLAGS)
++ $(CC) $^ $(LDFLAGS) $(LDLIBS_libxenevtchn) $(LDLIBS_libxengnttab) $(LDLIBS_libxenctrl) $(SOCKET_LIBS) $(call LDFLAGS_RPATH,../lib) -o $@ $(APPEND_LDFLAGS)
+
+ xenstored.a: $(XENSTORED_OBJS)
+ $(AR) cr $@ $^
+@@ -126,13 +128,13 @@ tarball: clean
+ install: all
+ $(INSTALL_DIR) $(DESTDIR)$(bindir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
++ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)/xenstore-compat
+ ifeq ($(XENSTORE_XENSTORED),y)
+- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
+ $(INSTALL_DIR) $(DESTDIR)$(XEN_LIB_STORED)
+- $(INSTALL_PROG) xenstored $(DESTDIR)$(sbindir)
++ $(INSTALL_PROG) xenstored $(DESTDIR)$(LIBEXEC_BIN)
+ endif
+- $(INSTALL_PROG) xenstore-control $(DESTDIR)$(bindir)
++ $(INSTALL_PROG) xenstore-control $(DESTDIR)$(LIBEXEC_BIN)
+ $(INSTALL_PROG) xenstore $(DESTDIR)$(bindir)
+ set -e ; for c in $(CLIENTS) ; do \
+ ln -f $(DESTDIR)$(bindir)/xenstore $(DESTDIR)$(bindir)/$${c} ; \
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:47:14 +0200
+X-Dgit-Generated: 4.8.0-1 3d511fcf76167cd3020f4524d654a09979497d7c
+Subject: tools-xentrace-prefix.diff
+
+Patch-Name: tools-xentrace-prefix.diff
+
+---
+
+--- xen-4.8.0.orig/tools/xentrace/Makefile
++++ xen-4.8.0/tools/xentrace/Makefile
+@@ -8,6 +8,7 @@ CFLAGS += $(CFLAGS_libxenctrl)
+ LDLIBS += $(LDLIBS_libxenevtchn)
+ LDLIBS += $(LDLIBS_libxenctrl)
+ LDLIBS += $(ARGP_LDFLAGS)
++LDFLAGS += $(call LDFLAGS_RPATH,../lib)
+
+ BIN-$(CONFIG_X86) = xenalyze
+ BIN = $(BIN-y)
+@@ -23,15 +24,9 @@ build: $(BIN) $(SBIN) $(LIBBIN)
+
+ .PHONY: install
+ install: build
+- $(INSTALL_DIR) $(DESTDIR)$(bindir)
+- $(INSTALL_DIR) $(DESTDIR)$(sbindir)
+- [ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
+-ifneq ($(BIN),)
+- $(INSTALL_PROG) $(BIN) $(DESTDIR)$(bindir)
+-endif
+- $(INSTALL_PROG) $(SBIN) $(DESTDIR)$(sbindir)
+- $(INSTALL_PYTHON_PROG) $(SCRIPTS) $(DESTDIR)$(bindir)
+- [ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_PROG) $(BIN) $(SBIN) $(LIBBIN) $(DESTDIR)$(LIBEXEC_BIN)
++ $(INSTALL_PYTHON_PROG) $(SCRIPTS) $(DESTDIR)$(LIBEXEC_BIN)
+
+ .PHONY: clean
+ clean:
--- /dev/null
+From: Ian Jackson <ian.jackson@citrix.com>
+Date: Tue, 1 Nov 2016 16:20:27 +0000
+X-Dgit-Generated: 4.8.0-1 85085e05a424add9c3d899e5dbfbadc8a1e1fd38
+Subject: tools/tests/x86_emulator: Pass -no-pie -fno-pic to gcc on x86_32
+
+The current build fails with GCC6 on Debian sid i386 (unstable):
+
+ /tmp/ccqjaueF.s: Assembler messages:
+ /tmp/ccqjaueF.s:3713: Error: missing or invalid displacement expression `vmovd_to_reg_len@GOT'
+
+This is due to the combination of GCC6, and Debian's decision to
+enable some hardening flags by default (to try to make runtime
+addresses less predictable):
+ https://wiki.debian.org/Hardening/PIEByDefaultTransition
+
+This is of no benefit for the x86 instruction emulator test, which is
+a rebuild of the emulator code for testing purposes only. So pass
+options to disable this.
+
+These options will be no-ops if they are the same as the compiler
+default.
+
+On amd64, the -fno-pic breaks the build in a different way. So do
+this only on i386.
+
+Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
+CC: Jan Beulich <jbeulich@suse.com>
+CC: Andrew Cooper <andrew.cooper3@citrix.com>
+
+squash! tools/tests/x86_emulator: Pass -no-pie -fno-pic to gcc
+
+Signed-off-by: Ian Jackson <ian.jackson@citrix.com>
+
+---
+
+--- xen-4.8.0.orig/tools/tests/x86_emulator/Makefile
++++ xen-4.8.0/tools/tests/x86_emulator/Makefile
+@@ -45,6 +45,10 @@ x86_emulate/x86_emulate.c x86_emulate/x8
+
+ HOSTCFLAGS += $(CFLAGS_xeninclude)
+
++ifeq ($(XEN_TARGET_ARCH),x86_32)
++HOSTCFLAGS += -no-pie -fno-pic
++endif
++
+ x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h
+ $(HOSTCC) $(HOSTCFLAGS) -c -g -o $@ $<
+
--- /dev/null
+From: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+Date: Thu, 6 Oct 2016 14:24:46 +0100
+X-Dgit-Generated: 4.8.0-1 7dbcd758eb593e691ac1ae04b0b634e7bfff0342
+Subject: ubuntu-tools-libs-abiname
+
+
+---
+
+--- xen-4.8.0.orig/tools/libs/call/Makefile
++++ xen-4.8.0/tools/libs/call/Makefile
+@@ -39,22 +39,22 @@ headers.chk: $(wildcard include/*.h)
+ libxencall.a: $(LIB_OBJS)
+ $(AR) rc $@ $^
+
+-libxencall.so: libxencall.so.$(MAJOR)
++libxencall.so: libxencall-$(PACKAGE_VERSION).so.$(MAJOR)
+ $(SYMLINK_SHLIB) $< $@
+-libxencall.so.$(MAJOR): libxencall.so.$(MAJOR).$(MINOR)
++libxencall-$(PACKAGE_VERSION).so.$(MAJOR): libxencall-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR)
+ $(SYMLINK_SHLIB) $< $@
+
+-libxencall.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxencall.map
+- $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxencall.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
++libxencall-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxencall.map
++ $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxencall-$(PACKAGE_VERSION).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+ .PHONY: install
+ install: build
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+- $(INSTALL_SHLIB) libxencall.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
++ $(INSTALL_SHLIB) libxencall-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+ $(INSTALL_DATA) libxencall.a $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxencall.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxencall.so.$(MAJOR)
+- $(SYMLINK_SHLIB) libxencall.so.$(MAJOR) $(DESTDIR)$(libdir)/libxencall.so
++ $(SYMLINK_SHLIB) libxencall-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxencall-$(PACKAGE_VERSION).so.$(MAJOR)
++ $(SYMLINK_SHLIB) libxencall-$(PACKAGE_VERSION).so.$(MAJOR) $(DESTDIR)$(libdir)/libxencall.so
+ $(INSTALL_DATA) include/xencall.h $(DESTDIR)$(includedir)
+
+ .PHONY: TAGS
+@@ -64,7 +64,7 @@ TAGS:
+ .PHONY: clean
+ clean:
+ rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+- rm -f libxencall.so.$(MAJOR).$(MINOR) libxencall.so.$(MAJOR)
++ rm -f libxencall-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) libxencall-$(PACKAGE_VERSION).so.$(MAJOR)
+ rm -f headers.chk
+
+ .PHONY: distclean
+--- xen-4.8.0.orig/tools/libs/evtchn/Makefile
++++ xen-4.8.0/tools/libs/evtchn/Makefile
+@@ -39,22 +39,22 @@ headers.chk: $(wildcard include/*.h)
+ libxenevtchn.a: $(LIB_OBJS)
+ $(AR) rc $@ $^
+
+-libxenevtchn.so: libxenevtchn.so.$(MAJOR)
++libxenevtchn.so: libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR)
+ $(SYMLINK_SHLIB) $< $@
+-libxenevtchn.so.$(MAJOR): libxenevtchn.so.$(MAJOR).$(MINOR)
++libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR): libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR)
+ $(SYMLINK_SHLIB) $< $@
+
+-libxenevtchn.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenevtchn.map
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenevtchn.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
++libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenevtchn.map
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+ .PHONY: install
+ install: build
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+- $(INSTALL_SHLIB) libxenevtchn.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
++ $(INSTALL_SHLIB) libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+ $(INSTALL_DATA) libxenevtchn.a $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxenevtchn.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenevtchn.so.$(MAJOR)
+- $(SYMLINK_SHLIB) libxenevtchn.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenevtchn.so
++ $(SYMLINK_SHLIB) libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR)
++ $(SYMLINK_SHLIB) libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR) $(DESTDIR)$(libdir)/libxenevtchn.so
+ $(INSTALL_DATA) include/xenevtchn.h $(DESTDIR)$(includedir)
+
+ .PHONY: TAGS
+@@ -64,7 +64,7 @@ TAGS:
+ .PHONY: clean
+ clean:
+ rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+- rm -f libxenevtchn.so.$(MAJOR).$(MINOR) libxenevtchn.so.$(MAJOR)
++ rm -f libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) libxenevtchn-$(PACKAGE_VERSION).so.$(MAJOR)
+ rm -f headers.chk
+
+ .PHONY: distclean
+--- xen-4.8.0.orig/tools/libs/foreignmemory/Makefile
++++ xen-4.8.0/tools/libs/foreignmemory/Makefile
+@@ -39,22 +39,22 @@ headers.chk: $(wildcard include/*.h)
+ libxenforeignmemory.a: $(LIB_OBJS)
+ $(AR) rc $@ $^
+
+-libxenforeignmemory.so: libxenforeignmemory.so.$(MAJOR)
++libxenforeignmemory.so: libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR)
+ $(SYMLINK_SHLIB) $< $@
+-libxenforeignmemory.so.$(MAJOR): libxenforeignmemory.so.$(MAJOR).$(MINOR)
++libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR): libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR)
+ $(SYMLINK_SHLIB) $< $@
+
+-libxenforeignmemory.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenforeignmemory.map
+- $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenforeignmemory.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
++libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxenforeignmemory.map
++ $(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+ .PHONY: install
+ install: build
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+- $(INSTALL_SHLIB) libxenforeignmemory.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
++ $(INSTALL_SHLIB) libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+ $(INSTALL_DATA) libxenforeignmemory.a $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxenforeignmemory.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenforeignmemory.so.$(MAJOR)
+- $(SYMLINK_SHLIB) libxenforeignmemory.so.$(MAJOR) $(DESTDIR)$(libdir)/libxenforeignmemory.so
++ $(SYMLINK_SHLIB) libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR)
++ $(SYMLINK_SHLIB) libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR) $(DESTDIR)$(libdir)/libxenforeignmemory.so
+ $(INSTALL_DATA) include/xenforeignmemory.h $(DESTDIR)$(includedir)
+
+ .PHONY: TAGS
+@@ -64,7 +64,7 @@ TAGS:
+ .PHONY: clean
+ clean:
+ rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+- rm -f libxenforeignmemory.so.$(MAJOR).$(MINOR) libxenforeignmemory.so.$(MAJOR)
++ rm -f libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) libxenforeignmemory-$(PACKAGE_VERSION).so.$(MAJOR)
+ rm -f headers.chk
+
+ .PHONY: distclean
+--- xen-4.8.0.orig/tools/libs/gnttab/Makefile
++++ xen-4.8.0/tools/libs/gnttab/Makefile
+@@ -41,22 +41,22 @@ headers.chk: $(wildcard include/*.h)
+ libxengnttab.a: $(LIB_OBJS)
+ $(AR) rc $@ $^
+
+-libxengnttab.so: libxengnttab.so.$(MAJOR)
++libxengnttab.so: libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR)
+ $(SYMLINK_SHLIB) $< $@
+-libxengnttab.so.$(MAJOR): libxengnttab.so.$(MAJOR).$(MINOR)
++libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR): libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR)
+ $(SYMLINK_SHLIB) $< $@
+
+-libxengnttab.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxengnttab.map
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxengnttab.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
++libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxengnttab.map
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
+
+ .PHONY: install
+ install: build
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+- $(INSTALL_SHLIB) libxengnttab.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
++ $(INSTALL_SHLIB) libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+ $(INSTALL_DATA) libxengnttab.a $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxengnttab.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxengnttab.so.$(MAJOR)
+- $(SYMLINK_SHLIB) libxengnttab.so.$(MAJOR) $(DESTDIR)$(libdir)/libxengnttab.so
++ $(SYMLINK_SHLIB) libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR)
++ $(SYMLINK_SHLIB) libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR) $(DESTDIR)$(libdir)/libxengnttab.so
+ $(INSTALL_DATA) include/xengnttab.h $(DESTDIR)$(includedir)
+
+ .PHONY: TAGS
+@@ -66,7 +66,7 @@ TAGS:
+ .PHONY: clean
+ clean:
+ rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+- rm -f libxengnttab.so.$(MAJOR).$(MINOR) libxengnttab.so.$(MAJOR)
++ rm -f libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) libxengnttab-$(PACKAGE_VERSION).so.$(MAJOR)
+ rm -f headers.chk
+
+ .PHONY: distclean
+--- xen-4.8.0.orig/tools/libs/toollog/Makefile
++++ xen-4.8.0/tools/libs/toollog/Makefile
+@@ -34,22 +34,22 @@ headers.chk: $(wildcard include/*.h)
+ libxentoollog.a: $(LIB_OBJS)
+ $(AR) rc $@ $^
+
+-libxentoollog.so: libxentoollog.so.$(MAJOR)
++libxentoollog.so: libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR)
+ $(SYMLINK_SHLIB) $< $@
+-libxentoollog.so.$(MAJOR): libxentoollog.so.$(MAJOR).$(MINOR)
++libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR): libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR)
+ $(SYMLINK_SHLIB) $< $@
+
+-libxentoollog.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxentoollog.map
+- $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxentoollog.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(APPEND_LDFLAGS)
++libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxentoollog.map
++ $(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(APPEND_LDFLAGS)
+
+ .PHONY: install
+ install: build
+ $(INSTALL_DIR) $(DESTDIR)$(libdir)
+ $(INSTALL_DIR) $(DESTDIR)$(includedir)
+- $(INSTALL_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
++ $(INSTALL_SHLIB) libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
+ $(INSTALL_DATA) libxentoollog.a $(DESTDIR)$(libdir)
+- $(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxentoollog.so.$(MAJOR)
+- $(SYMLINK_SHLIB) libxentoollog.so.$(MAJOR) $(DESTDIR)$(libdir)/libxentoollog.so
++ $(SYMLINK_SHLIB) libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR)
++ $(SYMLINK_SHLIB) libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR) $(DESTDIR)$(libdir)/libxentoollog.so
+ $(INSTALL_DATA) include/xentoollog.h $(DESTDIR)$(includedir)
+
+ .PHONY: TAGS
+@@ -59,7 +59,7 @@ TAGS:
+ .PHONY: clean
+ clean:
+ rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
+- rm -f libxentoollog.so.$(MAJOR).$(MINOR) libxentoollog.so.$(MAJOR)
++ rm -f libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR).$(MINOR) libxentoollog-$(PACKAGE_VERSION).so.$(MAJOR)
+ rm -f headers.chk
+
+ .PHONY: distclean
--- /dev/null
+From: Bastian Blank <waldi@debian.org>
+Date: Sat, 5 Jul 2014 11:46:43 +0200
+X-Dgit-Generated: 4.8.0-1 a38321ead31352d843b479e117d628b9c246ea1d
+Subject: version
+
+Patch-Name: version.diff
+
+---
+
+--- xen-4.8.0.orig/xen/Makefile
++++ xen-4.8.0/xen/Makefile
+@@ -160,7 +160,7 @@ delete-unfresh-files:
+ @mv -f $@.tmp $@
+
+ # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
+-include/xen/compile.h: include/xen/compile.h.in .banner
++include/xen/compile.h: include/xen/compile.h.in
+ @sed -e 's/@@date@@/$(XEN_BUILD_DATE)/g' \
+ -e 's/@@time@@/$(XEN_BUILD_TIME)/g' \
+ -e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
+@@ -171,9 +171,11 @@ include/xen/compile.h: include/xen/compi
+ -e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
+ -e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
+ -e 's!@@changeset@@!$(shell tools/scmversion $(XEN_ROOT) || echo "unavailable")!g' \
++ -e 's/@@system_distribution@@/$(shell lsb_release -is)/g' \
++ -e 's/@@system_maintainer_domain@@/$(shell cd ../../../..; dpkg-parsechangelog | sed -ne 's,^Maintainer: .[^<]*<[^@>]*@\([^>]*\)>,\1,p')/g' \
++ -e 's/@@system_maintainer_local@@/$(shell cd ../../../..; dpkg-parsechangelog | sed -ne 's,^Maintainer: .[^<]*<\([^@>]*\)@.*>,\1,p')/g' \
++ -e 's/@@system_version@@/$(shell cd ../../../..; dpkg-parsechangelog | awk '/^Version:/ {print $$2}')/g' \
+ < include/xen/compile.h.in > $@.new
+- @cat .banner
+- @$(PYTHON) tools/fig-to-oct.py < .banner >> $@.new
+ @mv -f $@.new $@
+
+ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
+--- xen-4.8.0.orig/xen/common/kernel.c
++++ xen-4.8.0/xen/common/kernel.c
+@@ -252,8 +252,8 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDL
+
+ memset(&info, 0, sizeof(info));
+ safe_strcpy(info.compiler, deny ? xen_deny() : xen_compiler());
+- safe_strcpy(info.compile_by, deny ? xen_deny() : xen_compile_by());
+- safe_strcpy(info.compile_domain, deny ? xen_deny() : xen_compile_domain());
++ safe_strcpy(info.compile_by, deny ? xen_deny() : xen_compile_system_maintainer_local());
++ safe_strcpy(info.compile_domain, deny ? xen_deny() : xen_compile_system_maintainer_domain());
+ safe_strcpy(info.compile_date, deny ? xen_deny() : xen_compile_date());
+ if ( copy_to_guest(arg, &info, 1) )
+ return -EFAULT;
+--- xen-4.8.0.orig/xen/common/version.c
++++ xen-4.8.0/xen/common/version.c
+@@ -20,19 +20,24 @@ const char *xen_compile_time(void)
+ return XEN_COMPILE_TIME;
+ }
+
+-const char *xen_compile_by(void)
++const char *xen_compile_system_distribution(void)
+ {
+- return XEN_COMPILE_BY;
++ return XEN_COMPILE_SYSTEM_DISTRIBUTION;
+ }
+
+-const char *xen_compile_domain(void)
++const char *xen_compile_system_maintainer_local(void)
+ {
+- return XEN_COMPILE_DOMAIN;
++ return XEN_COMPILE_SYSTEM_MAINTAINER_LOCAL;
+ }
+
+-const char *xen_compile_host(void)
++const char *xen_compile_system_maintainer_domain(void)
+ {
+- return XEN_COMPILE_HOST;
++ return XEN_COMPILE_SYSTEM_MAINTAINER_DOMAIN;
++}
++
++const char *xen_compile_system_version(void)
++{
++ return XEN_COMPILE_SYSTEM_VERSION;
+ }
+
+ const char *xen_compiler(void)
+@@ -60,11 +65,6 @@ const char *xen_changeset(void)
+ return XEN_CHANGESET;
+ }
+
+-const char *xen_banner(void)
+-{
+- return XEN_BANNER;
+-}
+-
+ const char *xen_deny(void)
+ {
+ return "<denied>";
+--- xen-4.8.0.orig/xen/drivers/char/console.c
++++ xen-4.8.0/xen/drivers/char/console.c
+@@ -732,14 +732,11 @@ void __init console_init_preirq(void)
+ serial_set_rx_handler(sercon_handle, serial_rx);
+
+ /* HELLO WORLD --- start-of-day banner text. */
+- spin_lock(&console_lock);
+- __putstr(xen_banner());
+- spin_unlock(&console_lock);
+- printk("Xen version %d.%d%s (%s@%s) (%s) debug=%c " gcov_string " %s\n",
++ printk("Xen version %d.%d%s (%s %s) (%s@%s) (%s) debug=%c " gcov_string " %s\n",
+ xen_major_version(), xen_minor_version(), xen_extra_version(),
+- xen_compile_by(), xen_compile_domain(),
++ xen_compile_system_distribution(), xen_compile_system_version(),
++ xen_compile_system_maintainer_local(), xen_compile_system_maintainer_domain(),
+ xen_compiler(), debug_build() ? 'y' : 'n', xen_compile_date());
+- printk("Latest ChangeSet: %s\n", xen_changeset());
+
+ if ( opt_sync_console )
+ {
+--- xen-4.8.0.orig/xen/include/xen/compile.h.in
++++ xen-4.8.0/xen/include/xen/compile.h.in
+@@ -1,8 +1,9 @@
+ #define XEN_COMPILE_DATE "@@date@@"
+ #define XEN_COMPILE_TIME "@@time@@"
+-#define XEN_COMPILE_BY "@@whoami@@"
+-#define XEN_COMPILE_DOMAIN "@@domain@@"
+-#define XEN_COMPILE_HOST "@@hostname@@"
++#define XEN_COMPILE_SYSTEM_DISTRIBUTION "@@system_distribution@@"
++#define XEN_COMPILE_SYSTEM_MAINTAINER_DOMAIN "@@system_maintainer_domain@@"
++#define XEN_COMPILE_SYSTEM_MAINTAINER_LOCAL "@@system_maintainer_local@@"
++#define XEN_COMPILE_SYSTEM_VERSION "@@system_version@@"
+ #define XEN_COMPILER "@@compiler@@"
+
+ #define XEN_VERSION @@version@@
+@@ -10,4 +11,3 @@
+ #define XEN_EXTRAVERSION "@@extraversion@@"
+
+ #define XEN_CHANGESET "@@changeset@@"
+-#define XEN_BANNER \
+--- xen-4.8.0.orig/xen/include/xen/version.h
++++ xen-4.8.0/xen/include/xen/version.h
+@@ -6,9 +6,10 @@
+
+ const char *xen_compile_date(void);
+ const char *xen_compile_time(void);
+-const char *xen_compile_by(void);
+-const char *xen_compile_domain(void);
+-const char *xen_compile_host(void);
++const char *xen_compile_system_distribution(void);
++const char *xen_compile_system_maintainer_domain(void);
++const char *xen_compile_system_maintainer_local(void);
++const char *xen_compile_system_version(void);
+ const char *xen_compiler(void);
+ unsigned int xen_major_version(void);
+ unsigned int xen_minor_version(void);
--- /dev/null
+From: Jan Beulich <jbeulich@suse.com>
+Date: Wed, 21 Dec 2016 15:00:32 +0000
+X-Dgit-Generated: 4.8.0-1 29982087979f3a6157eeadf1549c5ba59ac8d967
+Subject: x86: force EFLAGS.IF on when exiting to PV guests
+
+Guest kernels modifying instructions in the process of being emulated
+for another of their vCPU-s may effect EFLAGS.IF to be cleared upon
+next exiting to guest context, by converting the being emulated
+instruction to CLI (at the right point in time). Prevent any such bad
+effects by always forcing EFLAGS.IF on. And to cover hypothetical other
+similar issues, also force EFLAGS.{IOPL,NT,VM} to zero.
+
+This is XSA-202.
+
+Signed-off-by: Jan Beulich <jbeulich@suse.com>
+Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
+
+---
+
+--- xen-4.8.0.orig/xen/arch/x86/x86_64/compat/entry.S
++++ xen-4.8.0/xen/arch/x86/x86_64/compat/entry.S
+@@ -109,6 +109,8 @@ compat_process_trap:
+ /* %rbx: struct vcpu, interrupts disabled */
+ ENTRY(compat_restore_all_guest)
+ ASSERT_INTERRUPTS_DISABLED
++ mov $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
++ and UREGS_eflags(%rsp),%r11d
+ .Lcr4_orig:
+ .skip .Lcr4_alt_end - .Lcr4_alt, 0x90
+ .Lcr4_orig_end:
+@@ -144,6 +146,8 @@ ENTRY(compat_restore_all_guest)
+ (.Lcr4_orig_end - .Lcr4_orig), \
+ (.Lcr4_alt_end - .Lcr4_alt)
+ .popsection
++ or $X86_EFLAGS_IF,%r11
++ mov %r11d,UREGS_eflags(%rsp)
+ RESTORE_ALL adj=8 compat=1
+ .Lft0: iretq
+ _ASM_PRE_EXTABLE(.Lft0, handle_exception)
+--- xen-4.8.0.orig/xen/arch/x86/x86_64/entry.S
++++ xen-4.8.0/xen/arch/x86/x86_64/entry.S
+@@ -40,28 +40,29 @@ restore_all_guest:
+ testw $TRAP_syscall,4(%rsp)
+ jz iret_exit_to_guest
+
++ movq 24(%rsp),%r11 # RFLAGS
++ andq $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
++ orq $X86_EFLAGS_IF,%r11
++
+ /* Don't use SYSRET path if the return address is not canonical. */
+ movq 8(%rsp),%rcx
+ sarq $47,%rcx
+ incl %ecx
+ cmpl $1,%ecx
+- ja .Lforce_iret
++ movq 8(%rsp),%rcx # RIP
++ ja iret_exit_to_guest
+
+ cmpw $FLAT_USER_CS32,16(%rsp)# CS
+- movq 8(%rsp),%rcx # RIP
+- movq 24(%rsp),%r11 # RFLAGS
+ movq 32(%rsp),%rsp # RSP
+ je 1f
+ sysretq
+ 1: sysretl
+
+-.Lforce_iret:
+- /* Mimic SYSRET behavior. */
+- movq 8(%rsp),%rcx # RIP
+- movq 24(%rsp),%r11 # RFLAGS
+ ALIGN
+ /* No special register assumptions. */
+ iret_exit_to_guest:
++ andl $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
++ orl $X86_EFLAGS_IF,24(%rsp)
+ addq $8,%rsp
+ .Lft0: iretq
+ _ASM_PRE_EXTABLE(.Lft0, handle_exception)
--- /dev/null
+From: Andrew Cooper <andrew.cooper3@citrix.com>
+Date: Thu, 22 Dec 2016 16:23:37 +0100
+X-Dgit-Generated: 4.8.0-1 c4dd85d79539fefa6e372804b8e0a1bc26562d3f
+Subject: x86/emul: add likely()/unlikely() to test harness
+
+Fix a build problem introduced in c/s 122dd9575c7 "x86emul:
+in_longmode() should not ignore ->read_msr() errors" by providing an
+implementation of likely()/unlikely().
+
+Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
+Reviewed-by: Jan Beulich <jbeulich@suse.com>
+
+Cherrypicked out of:
+
+master commit: 3e84c8da7d2c5442a12789dae7163dca6c0e154f
+master date: 2016-12-02 17:23:01 +0000
+
+---
+
+--- xen-4.8.0.orig/tools/tests/x86_emulator/x86_emulate.c
++++ xen-4.8.0/tools/tests/x86_emulator/x86_emulate.c
+@@ -50,4 +50,7 @@ typedef bool bool_t;
+ #define __init
+ #define __maybe_unused __attribute__((__unused__))
+
++#define likely(x) __builtin_expect(!!(x), true)
++#define unlikely(x) __builtin_expect(!!(x), false)
++
+ #include "x86_emulate/x86_emulate.c"
--- /dev/null
+From: Andrew Cooper <andrew.cooper3@citrix.com>
+Date: Sun, 18 Dec 2016 15:42:59 +0000
+X-Dgit-Generated: 4.8.0-1 ee7c659f733371dfe5d65b58f6847712c166575a
+Subject: x86/emul: Correct the handling of eflags with SYSCALL
+
+A singlestep #DB is determined by the resulting eflags value from the
+execution of SYSCALL, not the original eflags value.
+
+By using the original eflags value, we negate the guest kernels attempt to
+protect itself from a privilege escalation by masking TF.
+
+Have the SYSCALL emulation recalculate tf after the instruction is complete.
+
+This is XSA-204
+
+Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
+Reviewed-by: Jan Beulich <jbeulich@suse.com>
+
+---
+
+--- xen-4.8.0.orig/xen/arch/x86/x86_emulate/x86_emulate.c
++++ xen-4.8.0/xen/arch/x86/x86_emulate/x86_emulate.c
+@@ -4561,6 +4561,23 @@ x86_emulate(
+ (rc = ops->write_segment(x86_seg_ss, &sreg, ctxt)) )
+ goto done;
+
++ /*
++ * SYSCALL (unlike most instructions) evaluates its singlestep action
++ * based on the resulting EFLG_TF, not the starting EFLG_TF.
++ *
++ * As the #DB is raised after the CPL change and before the OS can
++ * switch stack, it is a large risk for privilege escalation.
++ *
++ * 64bit kernels should mask EFLG_TF in MSR_FMASK to avoid any
++ * vulnerability. Running the #DB handler on an IST stack is also a
++ * mitigation.
++ *
++ * 32bit kernels have no ability to mask EFLG_TF at all. Their only
++ * mitigation is to use a task gate for handling #DB (or to not use
++ * enable EFER.SCE to start with).
++ */
++ tf = _regs.eflags & EFLG_TF;
++
+ break;
+ }
+
+@@ -5412,7 +5429,7 @@ x86_emulate(
+
+ *ctxt->regs = _regs;
+
+- /* Inject #DB if single-step tracing was enabled at instruction start. */
++ /* Should a singlestep #DB be raised? */
+ if ( tf && (rc == X86EMUL_OKAY) && ops->inject_hw_exception )
+ rc = ops->inject_hw_exception(EXC_DB, -1, ctxt) ? : X86EMUL_EXCEPTION;
+
--- /dev/null
+From: Jan Beulich <jbeulich@suse.com>
+Date: Wed, 21 Dec 2016 15:02:34 +0000
+X-Dgit-Generated: 4.8.0-1 af9f2748827dc1aa5adec4c83141c95e73a1a7d5
+Subject: x86/HVM: add missing NULL check before using VMFUNC hook
+
+This is XSA-203.
+
+Signed-off-by: Jan Beulich <jbeulich@suse.com>
+Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
+
+---
+
+--- xen-4.8.0.orig/xen/arch/x86/hvm/emulate.c
++++ xen-4.8.0/xen/arch/x86/hvm/emulate.c
+@@ -1694,6 +1694,8 @@ static int hvmemul_vmfunc(
+ {
+ int rc;
+
++ if ( !hvm_funcs.altp2m_vcpu_emulate_vmfunc )
++ return X86EMUL_UNHANDLEABLE;
+ rc = hvm_funcs.altp2m_vcpu_emulate_vmfunc(ctxt->regs);
+ if ( rc != X86EMUL_OKAY )
+ hvmemul_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE,