On Fri, Apr 26, 2019 at 05:46:22PM +0100, Ramsay Jones wrote: > On 26/04/2019 16:20, Randy Dunlap wrote: > [snip] > > > > --- sparse-0.6.0.orig/Makefile > > +++ sparse-0.6.0/Makefile > > @@ -160,7 +160,8 @@ ifeq ($(shell expr "$(LLVM_VERSION)" : ' > > LLVM_PROGS := sparse-llvm > > $(LLVM_PROGS): LD := g++ > > LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags) > > -LLVM_CFLAGS := -I$(shell $(LLVM_CONFIG) --includedir) > > +LLVM_CFLAGS := -I$(shell $(LLVM_CONFIG) --includedir) \ > > + $(shell $(LLVM_CONFIG) --cppflags) > > LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs) > > LLVM_LIBS += $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null) > > LLVM_LIBS += $(shell $(LLVM_CONFIG) --cxxflags | grep -F -q -e '-stdlib=libc++' && echo -lc++) > > Thanks! > > I just tested your patch on cygwin and, as expected, it does > not introduce any regressions. > > However, I should have made it clear that I meant to suggest > that we should _replace_ the definition of LLVM_CFLAGS with > that single call to llvm-config. So, I also tested the > following on cygwin: > > $ git diff > diff --git a/Makefile b/Makefile > index f816a50..7e8c2ab 100644 > --- a/Makefile > +++ b/Makefile > @@ -165,8 +165,7 @@ ifeq ($(shell expr "$(LLVM_VERSION)" : '[3-9]\.'),2) > LLVM_PROGS := sparse-llvm > $(LLVM_PROGS): LD := g++ > LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags) > -LLVM_CFLAGS := -I$(shell $(LLVM_CONFIG) --includedir) \ > - $(shell $(LLVM_CONFIG) --cppflags) > +LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cppflags) > LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs) > LLVM_LIBS += $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null) > LLVM_LIBS += $(shell $(LLVM_CONFIG) --cxxflags | grep -F -q -e '-stdlib=libc++' && echo -lc++) > $ > > ... which also works! The only difference is that '-I/usr/include' > is not passed to gcc twice. > > Looking at commit 65840c61dc ("build: only need includedir from > llvm-config", 2018-12-18), Luc only wanted the 'pre-processor' > flags not all of the '--cflags'. The '--cppflags' argument to > llvm-config is used for just that. ;-) > > If you could confirm that the above works for you also, that > would be great. Thanks! Yes, I agree and applied. Thank both and really sorry for the delay. -- Luc