diff options
author | Petri Gynther <pgynther@google.com> | 2015-08-04 20:38:01 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-08-05 15:56:16 -0400 |
commit | f151f53aa4f54a647353e1935e4c6cef7f094dd4 (patch) | |
tree | 2ccdd26199ce3fc1183b7ba636d73c4d8643112a | |
parent | 007d66a0bd43d886eb3e4aceaf1a96b8743ccaff (diff) |
perf tools: Fix build errors with mipsel-linux-uclibc compiler
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 <pgynther@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1438735081-24131-1-git-send-email-pgynther@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/build/feature/test-glibc.c | 11 | ||||
-rw-r--r-- | tools/perf/util/cloexec.h | 2 |
2 files changed, 12 insertions, 1 deletions
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 @@ | |||
1 | #include <stdlib.h> | ||
2 | |||
3 | #if !defined(__UCLIBC__) | ||
1 | #include <gnu/libc-version.h> | 4 | #include <gnu/libc-version.h> |
5 | #else | ||
6 | #define XSTR(s) STR(s) | ||
7 | #define STR(s) #s | ||
8 | #endif | ||
2 | 9 | ||
3 | int main(void) | 10 | int main(void) |
4 | { | 11 | { |
12 | #if !defined(__UCLIBC__) | ||
5 | const char *version = gnu_get_libc_version(); | 13 | const char *version = gnu_get_libc_version(); |
14 | #else | ||
15 | const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__); | ||
16 | #endif | ||
6 | 17 | ||
7 | return (long)version; | 18 | return (long)version; |
8 | } | 19 | } |
diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h index 68888c29b04a..3bee6773ddb0 100644 --- a/tools/perf/util/cloexec.h +++ b/tools/perf/util/cloexec.h | |||
@@ -4,7 +4,7 @@ | |||
4 | unsigned long perf_event_open_cloexec_flag(void); | 4 | unsigned long perf_event_open_cloexec_flag(void); |
5 | 5 | ||
6 | #ifdef __GLIBC_PREREQ | 6 | #ifdef __GLIBC_PREREQ |
7 | #if !__GLIBC_PREREQ(2, 6) | 7 | #if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__) |
8 | extern int sched_getcpu(void) __THROW; | 8 | extern int sched_getcpu(void) __THROW; |
9 | #endif | 9 | #endif |
10 | #endif | 10 | #endif |