Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1465862
| From | Vineet Gupta <Vineet.Gupta1@synopsys.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v2] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ |
| Date | 2016-08-19 04:00 +0200 |
| Message-ID | <s7Hgd-7z4-15@gated-at.bofh.it> (permalink) |
| References | <s7wkQ-Sy-95@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
perf tools build in recent kernels spews splat when cross compiling with uClibc
| CC util/alias.o
| In file included from tools/perf/util/../ui/../util/cache.h:8:0,
| from tools/perf/util/../ui/helpline.h:7,
| from tools/perf/util/debug.h:8,
| from arch/../util/cpumap.h:9,
| from arch/../util/env.h:5,
| from arch/common.h:4,
| from arch/common.c:3:
| tools/include/linux/string.h:12:15: warning: redundant redeclaration of ‘strlcpy’ [-Wredundant-decls]
| extern size_t strlcpy(char *dest, const char *src, size_t size);
^
This is after commit 61a6445e463a31 ("tools lib: Guard the strlcpy() header with
__GLIBC__").
The problem is uClibc also defines __GLIBC__ for exported headers for
applications. So add that specific check to not trip for uClibc.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Petri Gynther <pgynther@google.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
---
tools/include/linux/string.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h
index b96879477311..f436d2420a18 100644
--- a/tools/include/linux/string.h
+++ b/tools/include/linux/string.h
@@ -8,7 +8,11 @@ void *memdup(const void *src, size_t len);
int strtobool(const char *s, bool *res);
-#ifdef __GLIBC__
+/*
+ * glibc based builds needs the extern while uClibc doesn't.
+ * However uClibc headers also define __GLIBC__ hence the hack below
+ */
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
extern size_t strlcpy(char *dest, const char *src, size_t size);
#endif
--
2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-08-17 22:10 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Arnaldo Carvalho de Melo <acme@redhat.com> - 2016-08-18 16:20 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-18 18:30 +0200
[PATCH v2] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-08-19 04:00 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-08-19 04:50 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-19 16:30 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-08-19 20:10 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-19 21:30 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-08-19 22:20 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-19 23:20 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-08-19 23:30 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-19 23:50 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-20 01:10 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Alexey Brodkin <Alexey.Brodkin@synopsys.com> - 2016-08-22 20:10 +0200
Re: [PATCH] tools lib: Reinstate strlcpy() header guard with __UCLIBC__ Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-08-22 20:10 +0200
csiph-web