]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix build of C mempcpy and stpcpy.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 14 Nov 2014 13:48:39 +0000 (13:48 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 14 Nov 2014 13:48:39 +0000 (13:48 +0000)
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.h>.
* 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
include/string.h
string/mempcpy.c
string/stpcpy.c
sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
sysdeps/powerpc/powerpc64/multiarch/stpcpy.c

index caf1ce99408bc4b2e74a2ef8c6b906db76a928e6..8448f28f23376d2c57676ecf2245eed54f8f281b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2014-11-14  Joseph Myers  <joseph@codesourcery.com>
+
+       * 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.h>.
+       * 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  <joseph@codesourcery.com>
 
        * stdlib/strtol.c (__strtol): Use prototype definition.
index 99cc2d3f593e6bc21d5ac676f423c4eee3d9d6e5..172940b7599c8dbda9b9d736b4472dfd58ee51c7 100644 (file)
@@ -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");
index 9749863eafef0ee89ddd0376669034e5ebf33693..aab1bed9866dcbd445d3848ebbb82593487c2cf5 100644 (file)
@@ -19,6 +19,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#define NO_MEMPCPY_STPCPY_REDIRECT
 #include <string.h>
 
 #undef mempcpy
index fc5ae5534f5cc5d15a04ae625c2b041c55242301..9185acc0341fd077e6e0602d095b05fc2d1069e0 100644 (file)
@@ -19,6 +19,7 @@
 # include <config.h>
 #endif
 
+#define NO_MEMPCPY_STPCPY_REDIRECT
 #include <string.h>
 
 #undef __stpcpy
index 38fbcc33f5f0f921684ecf74b74c3c253915e70d..89f4912fc9e404a209a391bfbd035f993c8dd88e 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #ifndef NOT_IN_libc
+# define NO_MEMPCPY_STPCPY_REDIRECT
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
index 38fbcc33f5f0f921684ecf74b74c3c253915e70d..89f4912fc9e404a209a391bfbd035f993c8dd88e 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #ifndef NOT_IN_libc
+# define NO_MEMPCPY_STPCPY_REDIRECT
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
index c7118d58807ab0373fb3fd7c0440a805b16fe29a..28153b7266305f652bb8b377131249ba88384d06 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 #if defined SHARED && !defined NOT_IN_libc
+# define NO_MEMPCPY_STPCPY_REDIRECT
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"