From c1b0aadcdfd1b4b56588856cdc3197f4f145677d Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 14 Nov 2014 13:48:39 +0000 Subject: [PATCH] Fix build of C mempcpy and stpcpy. This patch fixes the build of C mempcpy and stpcpy by disabling the redirection to __mempcpy and __stpcpy asm names if NO_MEMPCPY_STPCPY_REDIRECT is defined, and defining that macro in the relevant source files. Tested for powerpc32 that the build is fixed. * include/string.h [NO_MEMPCPY_STPCPY_REDIRECT] (mempcpy): Do not redeclare with asm name. [NO_MEMPCPY_STPCPY_REDIRECT] (stpcpy): Likewise. * string/mempcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Define before including . * string/stpcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Likewise. * sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c [!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise. * sysdeps/powerpc/powerpc64/multiarch/mempcpy.c [!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise. * sysdeps/powerpc/powerpc64/multiarch/stpcpy.c [SHARED && !NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise. --- ChangeLog | 15 +++++++++++++++ include/string.h | 3 ++- string/mempcpy.c | 1 + string/stpcpy.c | 1 + sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c | 1 + sysdeps/powerpc/powerpc64/multiarch/mempcpy.c | 1 + sysdeps/powerpc/powerpc64/multiarch/stpcpy.c | 1 + 7 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index caf1ce9940..8448f28f23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2014-11-14 Joseph Myers + + * include/string.h [NO_MEMPCPY_STPCPY_REDIRECT] (mempcpy): Do not + redeclare with asm name. + [NO_MEMPCPY_STPCPY_REDIRECT] (stpcpy): Likewise. + * string/mempcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Define before + including . + * string/stpcpy.c (NO_MEMPCPY_STPCPY_REDIRECT): Likewise. + * sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c + [!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise. + * sysdeps/powerpc/powerpc64/multiarch/mempcpy.c + [!NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise. + * sysdeps/powerpc/powerpc64/multiarch/stpcpy.c + [SHARED && !NOT_IN_libc] (NO_MEMPCPY_STPCPY_REDIRECT): Likewise. + 2014-11-13 Joseph Myers * stdlib/strtol.c (__strtol): Use prototype definition. diff --git a/include/string.h b/include/string.h index 99cc2d3f59..172940b759 100644 --- a/include/string.h +++ b/include/string.h @@ -115,7 +115,8 @@ libc_hidden_builtin_proto (strspn) libc_hidden_builtin_proto (strstr) libc_hidden_builtin_proto (ffs) -#if defined NOT_IN_libc || !defined SHARED +#if (defined NOT_IN_libc || !defined SHARED) \ + && !defined NO_MEMPCPY_STPCPY_REDIRECT /* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call __mempcpy and __stpcpy if not inlined. */ extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy"); diff --git a/string/mempcpy.c b/string/mempcpy.c index 9749863eaf..aab1bed986 100644 --- a/string/mempcpy.c +++ b/string/mempcpy.c @@ -19,6 +19,7 @@ License along with the GNU C Library; if not, see . */ +#define NO_MEMPCPY_STPCPY_REDIRECT #include #undef mempcpy diff --git a/string/stpcpy.c b/string/stpcpy.c index fc5ae5534f..9185acc034 100644 --- a/string/stpcpy.c +++ b/string/stpcpy.c @@ -19,6 +19,7 @@ # include #endif +#define NO_MEMPCPY_STPCPY_REDIRECT #include #undef __stpcpy diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c index 38fbcc33f5..89f4912fc9 100644 --- a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c +++ b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c @@ -17,6 +17,7 @@ . */ #ifndef NOT_IN_libc +# define NO_MEMPCPY_STPCPY_REDIRECT # include # include # include "init-arch.h" diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c index 38fbcc33f5..89f4912fc9 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c +++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c @@ -17,6 +17,7 @@ . */ #ifndef NOT_IN_libc +# define NO_MEMPCPY_STPCPY_REDIRECT # include # include # include "init-arch.h" diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c index c7118d5880..28153b7266 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c +++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c @@ -17,6 +17,7 @@ . */ #if defined SHARED && !defined NOT_IN_libc +# define NO_MEMPCPY_STPCPY_REDIRECT # include # include # include "init-arch.h" -- 2.11.4.GIT