All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: Fix library detection when building without libelf
@ 2013-10-24  2:51 Patrick Palka
  2013-10-24 20:13 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Palka @ 2013-10-24  2:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
	Arnaldo Carvalho de Melo, Jiri Olsa

When I attempt to build perf on a system with slang but without libelf,
'make' would wrongly complain that the slang library could not be found.

It turns out that this was happening because we are not filtering -lelf
from EXTLIBS early enough.  As a result, the library test for slang
(ditto for gtk, libaudit, etc) erroneously passes -lelf to try-cc, which
of course fails on a system without libelf.

This patch makes the filtering of -lelf from EXTLIBS occur right after
testing for libelf support, so that the subsequent library tests will
not erroneously pass -lelf to try-cc when building without libelf
support.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Patrick Palka <patrick@parcs.ath.cx>
---
 tools/perf/Makefile        | 2 --
 tools/perf/config/Makefile | 4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 64c043b..94635c8 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -443,8 +443,6 @@ ifneq ($(OUTPUT),)
 endif
 
 ifdef NO_LIBELF
-EXTLIBS := $(filter-out -lelf,$(EXTLIBS))
-
 # Remove ELF/DWARF dependent codes
 LIB_OBJS := $(filter-out $(OUTPUT)util/symbol-elf.o,$(LIB_OBJS))
 LIB_OBJS := $(filter-out $(OUTPUT)util/dwarf-aux.o,$(LIB_OBJS))
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 5f6f9b3..1748767 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -174,6 +174,10 @@ else
 endif # SOURCE_LIBELF
 endif # NO_LIBELF
 
+ifdef NO_LIBELF
+EXTLIBS := $(filter-out -lelf,$(EXTLIBS))
+endif
+
 ifndef NO_LIBELF
 CFLAGS += -DLIBELF_SUPPORT
 FLAGS_LIBELF=$(CFLAGS) $(LDFLAGS) $(EXTLIBS)
-- 
1.8.4.rc3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf: Fix library detection when building without libelf
  2013-10-24  2:51 [PATCH] perf: Fix library detection when building without libelf Patrick Palka
@ 2013-10-24 20:13 ` Arnaldo Carvalho de Melo
  2013-10-24 20:36   ` Patrick Palka
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-10-24 20:13 UTC (permalink / raw)
  To: Patrick Palka
  Cc: linux-kernel, Peter Zijlstra, Paul Mackerras, Ingo Molnar, Jiri Olsa

Em Wed, Oct 23, 2013 at 10:51:09PM -0400, Patrick Palka escreveu:
> When I attempt to build perf on a system with slang but without libelf,
> 'make' would wrongly complain that the slang library could not be found.
> 
> It turns out that this was happening because we are not filtering -lelf
> from EXTLIBS early enough.  As a result, the library test for slang
> (ditto for gtk, libaudit, etc) erroneously passes -lelf to try-cc, which
> of course fails on a system without libelf.
> 
> This patch makes the filtering of -lelf from EXTLIBS occur right after
> testing for libelf support, so that the subsequent library tests will
> not erroneously pass -lelf to try-cc when building without libelf
> support.

Can you please check with the perf/core branch in my tree or Ingo's?

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/core

or Ingo's:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core

The feature detection was reworked and perhaps it is fixed there.

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf: Fix library detection when building without libelf
  2013-10-24 20:13 ` Arnaldo Carvalho de Melo
@ 2013-10-24 20:36   ` Patrick Palka
  2013-10-24 20:46     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Patrick Palka @ 2013-10-24 20:36 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Peter Zijlstra, Paul Mackerras, Ingo Molnar, Jiri Olsa

On Thu, Oct 24, 2013 at 4:13 PM, Arnaldo Carvalho de Melo
<acme@ghostprotocols.net> wrote:
> Em Wed, Oct 23, 2013 at 10:51:09PM -0400, Patrick Palka escreveu:
>> When I attempt to build perf on a system with slang but without libelf,
>> 'make' would wrongly complain that the slang library could not be found.
>>
>> It turns out that this was happening because we are not filtering -lelf
>> from EXTLIBS early enough.  As a result, the library test for slang
>> (ditto for gtk, libaudit, etc) erroneously passes -lelf to try-cc, which
>> of course fails on a system without libelf.
>>
>> This patch makes the filtering of -lelf from EXTLIBS occur right after
>> testing for libelf support, so that the subsequent library tests will
>> not erroneously pass -lelf to try-cc when building without libelf
>> support.
>
> Can you please check with the perf/core branch in my tree or Ingo's?
>
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git perf/core
>
> or Ingo's:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core
>
> The feature detection was reworked and perhaps it is fixed there.
>
> - Arnaldo

I can't reproduce the detection failure in your branch, and a quick inspection
shows that the new feature-detection code is not subject to the kind of bug
that my patch fixed. So consider my patch obsolete.

Thanks,
Patrick

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf: Fix library detection when building without libelf
  2013-10-24 20:36   ` Patrick Palka
@ 2013-10-24 20:46     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-10-24 20:46 UTC (permalink / raw)
  To: Patrick Palka
  Cc: linux-kernel, Peter Zijlstra, Paul Mackerras, Ingo Molnar, Jiri Olsa

Em Thu, Oct 24, 2013 at 04:36:47PM -0400, Patrick Palka escreveu:
> On Thu, Oct 24, 2013 at 4:13 PM, Arnaldo Carvalho de Melo
> > The feature detection was reworked and perhaps it is fixed there.
 
> I can't reproduce the detection failure in your branch, and a quick inspection
> shows that the new feature-detection code is not subject to the kind of bug
> that my patch fixed. So consider my patch obsolete.

Thanks for checking!

- Arnaldo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-24 20:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-24  2:51 [PATCH] perf: Fix library detection when building without libelf Patrick Palka
2013-10-24 20:13 ` Arnaldo Carvalho de Melo
2013-10-24 20:36   ` Patrick Palka
2013-10-24 20:46     ` Arnaldo Carvalho de Melo

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.