The output of 'llvm-config --system-libs' is not really complete as libc++ may be needed but not reported as such by this command. So, use the output of 'llvm-config --cxxflags' to check this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index beaff7a98..daac0297c 100644 --- a/Makefile +++ b/Makefile @@ -163,6 +163,7 @@ LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags) LLVM_CFLAGS := -I$(shell $(LLVM_CONFIG) --includedir) LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs) LLVM_LIBS += $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null) +LLVM_LIBS += $(shell $(LLVM_CONFIG) --cxxflags | grep -q -e '-stdlib=libc++' && echo -lc++) PROGRAMS += $(LLVM_PROGS) INST_PROGRAMS += sparse-llvm sparsec sparse-llvm-cflags := $(LLVM_CFLAGS) -- 2.20.0