public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Perf: bfd.h/libbfd detection fails with recent binutils
@ 2012-09-19  7:29 Markus Trippelsdorf
  2012-09-27  5:40 ` [tip:perf/core] perf tools: bfd.h/ libbfd " tip-bot for Markus Trippelsdorf
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Trippelsdorf @ 2012-09-19  7:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mike Frysinger, Ingo Molnar, Arnaldo Carvalho de Melo,
	Paul Mackerras

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

Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>

diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 35655c3..5604664 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -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
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 1fe733a..50a0912 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -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

-- 
Markus

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

end of thread, other threads:[~2012-09-27  5:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-19  7:29 [PATCH] Perf: bfd.h/libbfd detection fails with recent binutils Markus Trippelsdorf
2012-09-27  5:40 ` [tip:perf/core] perf tools: bfd.h/ libbfd " tip-bot for Markus Trippelsdorf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox