Skip to contentSkip to conversation

Perf: bfd.h/libbfd detection fails with recent binutils

PATCH In review Markus Trippelsdorf 1 participant 2 messages Sep 19, 2012 – Sep 27, 2012 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Perf: bfd.h/libbfd detection fails with recent binutils

With recent binutils I get:

perf % make
Makefile:668: No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demanglin

That happens because bfd.h now contains:

#if !defined PACKAGE && !defined PACKAGE_VERSION #error config.h must be included before this header #endif

I've reopened a bug in the hope that this check will be deleted:
http://sourceware.org/bugzilla/show_bug.cgi?id=14243

But in the meantime, the following patch fixes the problem

tools/perf/Makefile +1 -1
index 35655c3..5604664 100644
@@ -644,7 +644,7 @@ else
 		EXTLIBS += -liberty
 		BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
         else
-		FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd
+		FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
 		has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD))
 		ifeq ($(has_bfd),y)
 			EXTLIBS += -lbfd
tools/perf/util/symbol.h +1 -0
index 1fe733a..50a0912 100644
@@ -26,6 +26,7 @@ static inline char *bfd_demangle(void __used *v, const char __used *c,
 	return NULL;
 }
 #else
+#define PACKAGE 'perf'
 #include <bfd.h>
 #endif
 #endif
Signature · 1 line
Markus
#1 lore raw

[tip:perf/core] perf tools: bfd.h/ libbfd detection fails with recent binutils

Commit-ID:  3ce711a6abc27abce1554e1d671a8762b7187690
Gitweb:     http://git.kernel.org/tip/3ce711a6abc27abce1554e1d671a8762b7187690
Author:     Markus Trippelsdorf <[email protected]>
AuthorDate: Wed, 19 Sep 2012 09:29:02 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 24 Sep 2012 12:05:02 -0300

perf tools: bfd.h/libbfd detection fails with recent binutils

With recent binutils I get:

perf % make
Makefile:668: No bfd.h/libbfd found, install binutils-dev[el]/zlib-static to gain symbol demanglin

That happens because bfd.h now contains:

I've reopened a bug in the hope that this check will be deleted:
http://sourceware.org/bugzilla/show_bug.cgi?id=14243

But in the meantime, the following patch fixes the problem

---
 tools/perf/Makefile      |    2 +-
 tools/perf/util/symbol.h |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)
tools/perf/Makefile +1 -1
index 3ae6a59..251dcd7 100644
@@ -715,7 +715,7 @@ else
 		EXTLIBS += -liberty
 		BASIC_CFLAGS += -DHAVE_CPLUS_DEMANGLE
         else
-		FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -lbfd
+		FLAGS_BFD=$(ALL_CFLAGS) $(ALL_LDFLAGS) $(EXTLIBS) -DPACKAGE='perf' -lbfd
 		has_bfd := $(call try-cc,$(SOURCE_BFD),$(FLAGS_BFD))
 		ifeq ($(has_bfd),y)
 			EXTLIBS += -lbfd
tools/perf/util/symbol.h +1 -0
index 4ff45e3..b441b07 100644
@@ -34,6 +34,7 @@ static inline char *bfd_demangle(void __maybe_unused *v,
 	return NULL;
 }
 #else
+#define PACKAGE 'perf'
 #include <bfd.h>
 #endif
 #endif