File kexec-tools-xen-static.diff of Package kexec-tools

From: Bernhard Walle <>
Subject: [PATCH] Link xenctrl statically

This patch just links the xenctrl library statically. That allows
to use Xen support without a runtime dependency to the Xen package.

Signed-off-by: Bernhard Walle <>

Index: kexec-tools-2.0.2/
--- kexec-tools-2.0.2.orig/
+++ kexec-tools-2.0.2/
@@ -155,7 +155,8 @@ fi
 dnl find Xen control stack libraries
 if test "$with_xen" = yes ; then
-		AC_CHECK_LIB(xenctrl, xc_version, ,
+		AC_CHECK_LIB(xenctrl, xc_version,
+		[[LIBS="$LIBS -Wl,-Bstatic -lxenctrl -Wl,-Bdynamic"]],
 		AC_MSG_NOTICE([Xen support disabled])))