[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen: Don't use -nostdinc flags with CLANG
>>> On 11.02.14 at 00:29, Julien Grall <julien.grall@xxxxxxxxxx> wrote: > 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 <angled> 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. But does this also do the right thing? I.e. I doubt you're immune then against picking up headers you don't want to include in a hypervisor build, or properly failing if - for whatever reason, e.g. during development after having made a mistake - a header can't be found in the paths we want the compiler to look for them, but can be found in a "standard" include directory. IOW I think it first needs to be understood/explained why and by how much clang behavior differs here. Jan > Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx> > --- > 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 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@xxxxxxxxxxxxx > http://lists.xen.org/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |