diff mbox

sparse, llvm: fix link errors

Message ID 518E8CEE.6060001@chrisli.org (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Christopher Li May 11, 2013, 6:24 p.m. UTC
On 05/10/2013 02:01 PM, Xi Wang wrote:
> 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'


> -sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS)
> +sparse-llvm_EXTRA_OBJS := $(LLVM_LIBS) $(LLVM_LDFLAGS)

The EXTRA_OBJS is only mean for real objects.
the LDFLAGS should be not belong to here.

I can't duplicate the link error myself.
It seems that you only want the LLVM_LDFLAGS apply to
sparse-llvm only.

Can you try this patch?

Thanks


Chris


--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 35e3801..549e669 100644
--- a/Makefile
+++ b/Makefile
@@ -84,7 +84,7 @@  HAVE_LLVM=no
 else
 LLVM_PROGS := sparse-llvm
 $(LLVM_PROGS): LD := g++
-LDFLAGS += $(shell llvm-config --ldflags)
+$(LLVM_PROGS): 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)