diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index fc4b1e630fd9cc941e0367eea2fa829ec85e0b12..d3b330cbc3e09efd86d7ad64f42ef4556dc5624d 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>