From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH] xen: Deal with stdarg.h and -nostdinc Date: Thu, 26 May 2011 16:54:03 +0200 Message-ID: <4DDE698B.1060302@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000908030809040506050409" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --------------000908030809040506050409 Content-Type: text/plain; charset="ISO-8859-15"; format=flowed Content-Transfer-Encoding: 7bit For compiling the xen kernel we use -nostdinc which means we don't want to rely on any external headers. That also counts vor stdarg.h. Use the external header when we compile the tools. Adapt libelf-loader.c which is compiled in the kernel and with the tools. Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --------------000908030809040506050409 Content-Type: text/plain; name="xen_stdarg.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_stdarg.diff" Content-Description: xen_stdarg.diff diff -r 24b01e02ea17 xen/common/libelf/libelf-loader.c --- a/xen/common/libelf/libelf-loader.c Thu May 26 11:34:49 2011 +0200 +++ b/xen/common/libelf/libelf-loader.c Thu May 26 16:45:38 2011 +0200 @@ -16,7 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include "../../include/xen/stdarg.h" #include "libelf-private.h" diff -r 24b01e02ea17 xen/include/xen/stdarg.h --- a/xen/include/xen/stdarg.h Thu May 26 11:34:49 2011 +0200 +++ b/xen/include/xen/stdarg.h Thu May 26 16:45:38 2011 +0200 @@ -1,5 +1,13 @@ -#if defined(__OpenBSD__) -# include "/usr/include/stdarg.h" +#ifndef _XEN_STDARG_H_ +#define _XEN_STDARG_H_ + +#if defined(__XEN__) +typedef __builtin_va_list va_list; +#define va_start(ap, last) __builtin_stdarg_start((ap), (last)) +#define va_end(ap) __builtin_va_end(ap) +#define va_arg __builtin_va_arg #else # include #endif + +#endif /* _XEN_STDARG_H_ */ --------------000908030809040506050409 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000908030809040506050409--