diff mbox

sparse, llvm: fix link errors

Message ID 1368219684-4567-1-git-send-email-xi.wang@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Xi Wang May 10, 2013, 9:01 p.m. UTC
This patch fixes the following link errors.

    libLLVMSupport.a(Signals.o): In function `llvm::sys::PrintStackTrace(_IO_FILE*)':
    Signals.inc:269: undefined reference to `dladdr'
    Signals.inc:281: undefined reference to `dladdr'

Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 35e3801..4f53903 100644
--- a/Makefile
+++ b/Makefile
@@ -84,14 +84,14 @@  HAVE_LLVM=no
 else
 LLVM_PROGS := sparse-llvm
 $(LLVM_PROGS): LD := g++
-LDFLAGS += $(shell llvm-config --ldflags)
+LLVM_LDFLAGS := $(shell llvm-config --ldflags)
 LLVM_CFLAGS := $(shell llvm-config --cflags | sed -e "s/-DNDEBUG//g")
 LLVM_LIBS := $(shell llvm-config --libs)
 PROGRAMS += $(LLVM_PROGS)
 INST_PROGRAMS += sparse-llvm sparsec
 sparse-llvm_EXTRA_DEPS := sparse-llvm.o
 sparse-llvm.o $(sparse-llvm_EXTRA_DEPS): BASIC_CFLAGS += $(LLVM_CFLAGS)
-sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS)
+sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) $(LLVM_LDFLAGS)
 endif
 endif