From f151f53aa4f54a647353e1935e4c6cef7f094dd4 Mon Sep 17 00:00:00 2001 From: Petri Gynther Date: Tue, 4 Aug 2015 17:38:01 -0700 Subject: perf tools: Fix build errors with mipsel-linux-uclibc compiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf ... config/Makefile:256: *** No gnu/libc-version.h found, please install glibc-dev[el]. Stop. make[1]: *** [all] Error 2 make: *** [perf] Error 2 ... In file included from builtin-sched.c:13:0: util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’ [-Werror=redundant-decls] extern int sched_getcpu(void) __THROW; mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12: note: previous declaration of ‘sched_getcpu’ was here extern int sched_getcpu (void) __THROW; uclibc info: sysroot/usr/include/bits/uClibc_config.h __UCLIBC_MAJOR__ 0 __UCLIBC_MINOR__ 9 __UCLIBC_SUBLEVEL__ 33 sysroot/usr/include/features.h __UCLIBC__ 1 __GLIBC__ 2 __GLIBC_MINOR__ 2 Signed-off-by: Petri Gynther Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1438735081-24131-1-git-send-email-pgynther@google.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/build/feature/test-glibc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/build/feature') diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c index b0820345cd98..9367f7586676 100644 --- a/tools/build/feature/test-glibc.c +++ b/tools/build/feature/test-glibc.c @@ -1,8 +1,19 @@ +#include + +#if !defined(__UCLIBC__) #include +#else +#define XSTR(s) STR(s) +#define STR(s) #s +#endif int main(void) { +#if !defined(__UCLIBC__) const char *version = gnu_get_libc_version(); +#else + const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__); +#endif return (long)version; } -- cgit v1.2.3