From: Omar Sandoval <osandov@osandov.com>
Date: Wed, 24 Sep 2014 14:01:01 -0700
Subject: [PATCH] sparse-llvm: Fix LLVM 3.5 linker errors

llvm-config 3.5 no longer lists the non-LLVM libraries needed for linkage when
passed --libs. The --system-libs flag was added for this purpose. This adds
these libraries while silently doing nothing for older versions of LLVM.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Christopher Li <sparse@chrisli.org>
Origin: commit:d92353b4eacbac54d693edd62fb565f071e3ba86
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

--- a/Makefile
+++ b/Makefile
@@ -87,6 +87,7 @@
 LLVM_LDFLAGS := $(shell llvm-config --ldflags)
 LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
 LLVM_LIBS := $(shell llvm-config --libs)
+LLVM_LIBS += $(shell llvm-config --system-libs 2>/dev/null)
 PROGRAMS += $(LLVM_PROGS)
 INST_PROGRAMS += sparse-llvm sparsec
 sparse-llvm.o: BASIC_CFLAGS += $(LLVM_CFLAGS)
