From patchwork Sun May 12 02:10:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Wang X-Patchwork-Id: 2555061 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 481783FCA5 for ; Sun, 12 May 2013 02:10:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754150Ab3ELCKc (ORCPT ); Sat, 11 May 2013 22:10:32 -0400 Received: from mail-vc0-f170.google.com ([209.85.220.170]:63266 "EHLO mail-vc0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754111Ab3ELCKc (ORCPT ); Sat, 11 May 2013 22:10:32 -0400 Received: by mail-vc0-f170.google.com with SMTP id gf12so4724260vcb.29 for ; Sat, 11 May 2013 19:10:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=RF3YPV/PNiefYaPJAqZkm4BHiSpMl6j9LMTCUq4ny/4=; b=pVK86n1XuVlULQHr/zEQi/XQQhspKLzyY3kYBNv4yREgiMDiS5rdQnwdDynn4FK8fu bM9qKjH84ZNaFXmmdCrEPC1tB/waCyhxvfCWBCgrVNGTislzawykNTjIOUdAzzYaAZYa Hf2xVTPKsLZUmjmI41RYN3cVc5gmnLdufU0P3o17/pdDW5g3V1zTA1FO0CNO4yIuxRXg bNbouOAu1u67SDZvlGYgrH5UW96h428oBlS+Rpbk+KgTVlFT9jcnEY+8BHkCU80FXsSo tMd4+cFBRn0Jg/fdJj1YUVmU+Ixti+DcyZs6Rr8mS39JOB2QxQvF79K/HxG/8Dbe2vzd LFMA== X-Received: by 10.58.54.101 with SMTP id i5mr15052137vep.43.1368324631314; Sat, 11 May 2013 19:10:31 -0700 (PDT) Received: from [192.168.1.104] (c-24-218-63-243.hsd1.ct.comcast.net. [24.218.63.243]) by mx.google.com with ESMTPSA id l6sm8067396vdh.3.2013.05.11.19.10.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 11 May 2013 19:10:30 -0700 (PDT) Message-ID: <518EFA10.6040108@gmail.com> Date: Sat, 11 May 2013 22:10:24 -0400 From: Xi Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130404 Thunderbird/17.0.5 MIME-Version: 1.0 To: Christopher Li CC: linux-sparse@vger.kernel.org, Pekka Enberg Subject: Re: [PATCH] sparse, llvm: fix link errors References: <1368219684-4567-1-git-send-email-xi.wang@gmail.com> <518E8CEE.6060001@chrisli.org> In-Reply-To: <518E8CEE.6060001@chrisli.org> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org On 05/11/2013 02:24 PM, Christopher Li wrote: > 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? This doesn't work for me. The problem is that -ldl (`llvm --ldflags`) must come _after_ -lLLVMSupport (`llvm --libs`). Can we move LDFLAGS? --- 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 --git a/Makefile b/Makefile index 35e3801..3cec8f0 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) @@ -173,7 +173,7 @@ compile_EXTRA_DEPS = compile-i386.o $(foreach p,$(PROGRAMS),$(eval $(p): $($(p)_EXTRA_DEPS) $(LIBS))) $(PROGRAMS): % : %.o - $(QUIET_LINK)$(LD) $(LDFLAGS) -o $@ $^ $($@_EXTRA_OBJS) + $(QUIET_LINK)$(LD) -o $@ $^ $($@_EXTRA_OBJS) $(LDFLAGS) $(LIB_FILE): $(LIB_OBJS) $(QUIET_AR)$(AR) rcs $@ $(LIB_OBJS)