* [PATCH 06/13] perf tools: include basename for non-glibc systems
@ 2012-08-28 22:04 Irina Tirdea
0 siblings, 0 replies; only message in thread
From: Irina Tirdea @ 2012-08-28 22:04 UTC (permalink / raw)
To: Steven Rostedt, Arnaldo Carvalho de Melo, Ingo Molnar
Cc: LKML, Namhyung Kim, Peter Zijlstra, Frederic Weisbecker
perf uses the glibc version of basename(), by defining
_GNU_SOURCE, including string.h and not including libgen.h.
The glibc version of basename is better than the POSIX
version since it does not modify its argument.
Android has only one version of basename which is defined in
libgen.h. This version is the same as the glibc version.
Error on Android:
util/annotate.c: In function 'symbol__annotate_printf':
util/annotate.c:503:3: error: implicit declaration of function 'basename'
[-Werror=implicit-function-declaration]
util/annotate.c:503:3: error: nested extern declaration of 'basename'
[-Werror=nested-externs]
util/annotate.c:503:14: error: assignment makes pointer from integer without
a cast [-Werror]
On Android libgen.h should be included to define basename.
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
---
tools/perf/util/symbol.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index fc4b1e6..d3b330c 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -10,6 +10,9 @@
#include <linux/rbtree.h>
#include <stdio.h>
#include <byteswap.h>
+#if defined(__BIONIC__)
+#include <libgen.h>
+#endif
#ifndef NO_LIBELF_SUPPORT
#include <libelf.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-08-28 22:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-28 22:04 [PATCH 06/13] perf tools: include basename for non-glibc systems Irina Tirdea
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).