All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Trippelsdorf <markus@trippelsdorf.de>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@redhat.com, linux-kernel@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] perf, tools: Add library dependencies for static perf link
Date: Sat, 29 Sep 2012 20:52:43 +0200	[thread overview]
Message-ID: <20120929185243.GB250@x4> (raw)
In-Reply-To: <1348942428-29688-1-git-send-email-andi@firstfloor.org>

On 2012.09.29 at 11:13 -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
> 
> When linking perf statically some of the library dependencies are always
> rejected, so libdwarf and libbfd do not work.  The problem is that these
> libraries (at least on my system) require other libraries. But unlike
> a shared link the static link doesn't find those by itself, and they
> have to be explicitely specified.
> 
> In my case I needed -ldl -lz for libbfd and -lslang for -lnewt
> 
> Add those to the probe statements.

Just two little nitpicks.

> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
>  tools/perf/Makefile |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index 35655c3..a79c702 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -491,7 +491,7 @@ endif # NO_DWARF
>  ifdef NO_NEWT
>  	BASIC_CFLAGS += -DNO_NEWT_SUPPORT
>  else
> -	FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt
> +	FLAGS_NEWT=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lnewt -lslang
>  	ifneq ($(call try-cc,$(SOURCE_NEWT),$(FLAGS_NEWT)),y)
>  		msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev);
>  		BASIC_CFLAGS += -DNO_NEWT_SUPPORT
> @@ -644,20 +644,20 @@ else
>  		EXTLIBS += -liberty
>  		BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
>          else
> -		FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd
> +		FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd -ldl
>  		has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD))
>  		ifeq ($(has_bfd),y)
> -			EXTLIBS += -lbfd
> +			EXTLIBS += -lbfd -ldl
>  		else
> -			FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty
> +			FLAGS_BFD_IBERTY=$(FLAGS_BFD) -liberty -ldl

This is superfluous, because FLAGS_BFD has -ldl already by your change
above. This is cascaded downwards.

>  			has_bfd_iberty := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY))
>  			ifeq ($(has_bfd_iberty),y)
> -				EXTLIBS += -lbfd -liberty
> +				EXTLIBS += -lbfd -liberty -ldl
>  			else
> -				FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz
> +				FLAGS_BFD_IBERTY_Z=$(FLAGS_BFD_IBERTY) -lz -ldl

Ditto.

>  				has_bfd_iberty_z := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD_IBERTY_Z))
>  				ifeq ($(has_bfd_iberty_z),y)
> -					EXTLIBS += -lbfd -liberty -lz
> +					EXTLIBS += -lbfd -liberty -lz -ldl
>  				else
>  					FLAGS_CPLUS_DEMANGLE=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -liberty
>  					has_cplus_demangle := $(call try-cc,$(SOURCE_CPLUS_DEMANGLE),$(FLAGS_CPLUS_DEMANGLE))

-- 
Markus

  reply	other threads:[~2012-09-29 18:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-29 18:13 [PATCH] perf, tools: Add library dependencies for static perf link Andi Kleen
2012-09-29 18:52 ` Markus Trippelsdorf [this message]
2012-10-01  1:07   ` Andi Kleen
2012-10-01 19:44     ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120929185243.GB250@x4 \
    --to=markus@trippelsdorf.de \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.