From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH] xen: Don't use -nostdinc flags with CLANG Date: Mon, 10 Feb 2014 23:29:34 +0000 Message-ID: <1392074974-1488-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WD0IF-0006pF-DT for xen-devel@lists.xenproject.org; Mon, 10 Feb 2014 23:29:39 +0000 Received: by mail-we0-f176.google.com with SMTP id q58so4841705wes.35 for ; Mon, 10 Feb 2014 15:29:37 -0800 (PST) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian.Jackson@eu.citrix.com, keir@xen.org, tim@xen.org, ian.campbell@citrix.com, Julien Grall List-Id: xen-devel@lists.xenproject.org Commit 06a9c7e "xen: move -nostdinc into common Rules.mk." breaks compilation with clang: In file included from sched_sedf.c:8: In file included from /home/julieng/works/xen/xen/include/xen/lib.h:5: /home/julieng/works/xen/xen/include/xen/stdarg.h:20:12: error: 'stdarg.h' file not found with include; use "quotes" instead ^~~~~~~~~~ "stdarg.h" In file included from sched_sedf.c:8: /home/julieng/works/xen/xen/include/xen/lib.h:101:63: error: unknown type name 'va_list' extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) ^ /home/julieng/works/xen/xen/include/xen/lib.h:105:64: error: unknown type name 'va_list' extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) I have the same errors on different version of clang: - clang 3.0 on debian wheezy - clang 3.3 on Fedora 20 - clang 3.5 build from trunk Removing -nostdinc fix the build on clang. Signed-off-by: Julien Grall --- xen/Rules.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index df1428f..ed9b8d0 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -46,7 +46,8 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h # Solaris puts stdarg.h &c in the system include directory. ifneq ($(XEN_OS),SunOS) -CFLAGS += -nostdinc -iwithprefix include +CFLAGS-y += -iwithprefix include +CFLAGS-$(gcc) += -nostdinc endif CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE -- 1.8.5.3