This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch zack/no-inline-string-opts created. glibc-2.24-391-g418b88c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, zack/no-inline-string-opts has been created
        at  418b88c847d56ff47d718cf3989633c6a2cf9e30 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=418b88c847d56ff47d718cf3989633c6a2cf9e30

commit 418b88c847d56ff47d718cf3989633c6a2cf9e30
Author: Zack Weinberg <zackw@panix.com>
Date:   Fri Nov 18 09:02:17 2016 -0500

    Candidate fix for ppc64/s390 build failures.

diff --git a/include/string.h b/include/string.h
index 2a10afa..3b82189 100644
--- a/include/string.h
+++ b/include/string.h
@@ -42,7 +42,9 @@ extern void *__memchr (const void *__s, int __c, size_t __n)
      __attribute_pure__;
 
 extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
-#define __bzero(s, n) __builtin_memset (s, '\0', n)
+#ifndef __NO_STRING_INLINES
+# define __bzero(s, n) __builtin_memset (s, '\0', n)
+#endif
 
 extern int __ffs (int __i) __attribute__ ((const));
 
@@ -77,8 +79,13 @@ extern __typeof (strncasecmp_l) __strncasecmp_l;
 #endif
 
 libc_hidden_proto (__mempcpy)
+#ifndef __NO_STRING_INLINES
+# define __mempcpy(dest, src) __builtin_mempcpy (dest, src)
+#endif
 libc_hidden_proto (__stpcpy)
-#define __stpcpy(dest, src) __builtin_stpcpy (dest, src)
+#ifndef __NO_STRING_INLINES
+# define __stpcpy(dest, src) __builtin_stpcpy (dest, src)
+#endif
 libc_hidden_proto (__stpncpy)
 libc_hidden_proto (__rawmemchr)
 libc_hidden_proto (__strcasecmp)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=df356f56d3d21f6b75c57b1ddcd26cb8b3b3cab9

commit df356f56d3d21f6b75c57b1ddcd26cb8b3b3cab9
Author: Zack Weinberg <zackw@panix.com>
Date:   Fri Nov 18 08:58:47 2016 -0500

    Round 1 of fixes from testing on i486-linux-gnu.

diff --git a/include/features.h b/include/features.h
index 650d4c5..7fcfb9b 100644
--- a/include/features.h
+++ b/include/features.h
@@ -370,6 +370,15 @@
 # define __USE_FORTIFY_LEVEL 0
 #endif
 
+/* `gets' existed in C89, but is impossible to use safely.  It has
+   been removed from ISO C11, ISO C++14, and _GNU_SOURCE.  */
+#if !defined __USE_ISOC11 \
+    || (defined __cplusplus && __cplusplus <= 201103L)
+# define __GLIBC_USE_DEPRECATED_GETS 1
+#else
+# define __GLIBC_USE_DEPRECATED_GETS 0
+#endif
+
 /* Get definitions of __STDC_* predefined macros, if the compiler has
    not preincluded this header automatically.  */
 #include <stdc-predef.h>
diff --git a/include/stdio.h b/include/stdio.h
index 30e737e..89604d3 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -1,11 +1,16 @@
 #ifndef _STDIO_H
-# if defined __need_FILE || defined __need___FILE || defined _ISOMAC
+# if defined __need_FILE || defined __need___FILE
 #  include <libio/stdio.h>
 # else
+/* Force gets to be declared, since we may be compiling gets itself,
+   or tests that use it.  */
+#  include <features.h>
+#  undef __GLIBC_USE_DEPRECATED_GETS
+#  define __GLIBC_USE_DEPRECATED_GETS 1
 #  include <libio/stdio.h>
 
+#  ifndef _ISOMAC
 /* Now define the internal interfaces.  */
-__BEGIN_DECLS
 
 extern int __fcloseall (void);
 extern int __snprintf (char *__restrict __s, size_t __maxlen,
@@ -30,7 +35,6 @@ extern int __vsscanf (const char *__restrict __s,
 		      _G_va_list __arg)
      __attribute__ ((__format__ (__scanf__, 2, 0)));
 
-#  ifndef __cplusplus
 extern int __sprintf_chk (char *, int, size_t, const char *, ...) __THROW;
 extern int __snprintf_chk (char *, size_t, int, size_t, const char *, ...)
      __THROW;
@@ -52,7 +56,6 @@ extern int __obstack_printf_chk (struct obstack *, int, const char *, ...)
      __THROW;
 extern int __obstack_vprintf_chk (struct obstack *, int, const char *,
 				  _G_va_list) __THROW;
-#  endif
 
 extern int __isoc99_fscanf (FILE *__restrict __stream,
 			    const char *__restrict __format, ...) __wur;
@@ -181,28 +184,9 @@ libc_hidden_proto (__vasprintf_chk)
 libc_hidden_proto (__vdprintf_chk)
 libc_hidden_proto (__obstack_vprintf_chk)
 
-/* The <stdio.h> header does not include the declaration for gets
-   anymore when compiling with _GNU_SOURCE.  Provide a copy here.  */
-extern char *gets (char *__s);
-#  if __USE_FORTIFY_LEVEL > 0
-extern char *__gets_chk (char *__str, size_t) __wur;
-extern char *__REDIRECT (__gets_warn, (char *__str), gets)
-     __wur __warnattr ("please use fgets or getline instead, gets can't "
-		       "specify buffer size");
-
-__fortify_function __wur char *
-gets (char *__str)
-{
-  if (__bos (__str) != (size_t) -1)
-    return __gets_chk (__str, __bos (__str));
-  return __gets_warn (__str);
-}
-#  endif
-
 extern FILE * __fmemopen (void *buf, size_t len, const char *mode);
 libc_hidden_proto (__fmemopen)
 
-__END_DECLS
+#  endif
 # endif
-
 #endif
diff --git a/include/string.h b/include/string.h
index b99c90e..2a10afa 100644
--- a/include/string.h
+++ b/include/string.h
@@ -84,6 +84,8 @@ libc_hidden_proto (__rawmemchr)
 libc_hidden_proto (__strcasecmp)
 libc_hidden_proto (__strcasecmp_l)
 libc_hidden_proto (__strncasecmp_l)
+extern __typeof (strncat) __strncat;
+libc_hidden_proto (__strncat)
 libc_hidden_proto (__strdup)
 libc_hidden_proto (__strndup)
 libc_hidden_proto (__strerror_r)
diff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h
index fa3be79..df9662c 100644
--- a/libio/bits/stdio2.h
+++ b/libio/bits/stdio2.h
@@ -222,8 +222,7 @@ __NTH (obstack_vprintf (struct obstack *__restrict __obstack,
 
 #endif
 
-#if !defined __USE_ISOC11 \
-    || (defined __cplusplus && __cplusplus <= 201103L && !defined __USE_GNU)
+#if __GLIBC_USE (DEPRECATED_GETS)
 extern char *__gets_chk (char *__str, size_t) __wur;
 extern char *__REDIRECT (__gets_warn, (char *__str), gets)
      __wur __warnattr ("please use fgets or getline instead, gets can't "
diff --git a/libio/stdio.h b/libio/stdio.h
index e37f901..913379c 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -625,16 +625,14 @@ __BEGIN_NAMESPACE_STD
 extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
      __wur;
 
-#if !defined __USE_ISOC11 \
-    || (defined __cplusplus && __cplusplus <= 201103L)
+#if __GLIBC_USE (DEPRECATED_GETS)
 /* Get a newline-terminated string from stdin, removing the newline.
    DO NOT USE THIS FUNCTION!!  There is no limit on how much it will read.
 
-   The function has been officially removed in ISO C11.  This opportunity
-   is used to also remove it from the GNU feature list.  It is now only
-   available when explicitly using an old ISO C, Unix, or POSIX standard.
-   GCC defines _GNU_SOURCE when building C++ code and the function is still
-   in C++11, so it is also available for C++.
+   The function has been officially removed in ISO C11 and ISO C++14.
+   This opportunity is used to also remove it from the GNU feature
+   list.  It is now only available when explicitly using an old ISO C,
+   Unix, or POSIX standard.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index 4c4834b..dcbf103 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -141,6 +141,9 @@ CFLAGS-scanf15.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
 CFLAGS-scanf17.c = -I../libio -I../stdlib -I../wcsmbs -I../time -I../string \
 		   -I../wctype
 
+# tst-gets.c tests a deprecated function.
+CFLAGS-tst-gets.c += -Wno-deprecated-declarations
+
 CPPFLAGS += $(libio-mtsafe)
 
 $(objpfx)tst-setvbuf1.out: /dev/null $(objpfx)tst-setvbuf1
diff --git a/string/strncat.c b/string/strncat.c
index 8b00a10..f1503d2 100644
--- a/string/strncat.c
+++ b/string/strncat.c
@@ -37,3 +37,5 @@ STRNCAT (char *s1, const char *s2, size_t n)
 
   return s;
 }
+strong_alias (STRNCAT, __strncat)
+libc_hidden_def (__strncat)
diff --git a/sysdeps/i386/string-inlines.c b/sysdeps/i386/string-inlines.c
index 2eaca25..80826da 100644
--- a/sysdeps/i386/string-inlines.c
+++ b/sysdeps/i386/string-inlines.c
@@ -23,190 +23,186 @@
 void *
 __old_memcpy_c (void *d, const void *s, size_t n)
 {
-  return __memcpy (d, s, n);
+  return memcpy (d, s, n);
 }
+strong_alias (__old_memcpy_c, __old_memcpy_g);
+strong_alias (__old_memcpy_c, __old_memcpy_by4);
+strong_alias (__old_memcpy_c, __old_memcpy_by2);
 compat_symbol (libc, __old_memcpy_c, __memcpy_c, GLIBC_2_1_1);
-compat_symbol (libc, __old_memcpy_c, __memcpy_by4, GLIBC_2_1_1);
-compat_symbol (libc, __old_memcpy_c, __memcpy_by2, GLIBC_2_1_1);
+compat_symbol (libc, __old_memcpy_g, __memcpy_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_memcpy_by4, __memcpy_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memcpy_by2, __memcpy_by2, GLIBC_2_1_1);
 
 void *
 __old_memset_cc (void *s, unsigned long int pattern, size_t n)
 {
-  return __memset (s, pattern & 0xff, n);
+  return memset (s, pattern & 0xff, n);
 }
+strong_alias (__old_memset_cc, __old_memset_cg);
+strong_alias (__old_memset_cc, __old_memset_ccn_by2);
+strong_alias (__old_memset_cc, __old_memset_ccn_by4);
 compat_symbol (libc, __old_memset_cc, __memset_cc, GLIBC_2_1_1);
-compat_symbol (libc, __old_memset_cc, __memset_cg, GLIBC_2_1_1);
-
-void *
-__old_memset_ccn (void *s, unsigned int pattern, size_t n)
-{
-  return __memset (s, pattern & 0xff, n);
-}
-compat_symbol (libc, __old_memset_ccn, __memset_ccn, GLIBC_2_1_1);
-compat_symbol (libc, __old_memset_ccn, __memset_ccn_by4, GLIBC_2_1_1);
-compat_symbol (libc, __old_memset_ccn, __memset_ccn_by2, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_cg, __memset_cg, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_ccn_by4, __memset_ccn_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_ccn_by2, __memset_ccn_by2, GLIBC_2_1_1);
 
 void *
 __old_memset_gg (void *s, char c, size_t n)
 {
-  return __memset (s, c, n);
+  return memset (s, c, n);
 }
+strong_alias (__old_memset_gg, __old_memset_gcn_by4);
+strong_alias (__old_memset_gg, __old_memset_gcn_by2);
 compat_symbol (libc, __old_memset_gg, __memset_gg, GLIBC_2_1_1);
-compat_symbol (libc, __old_memset_gg, __memset_gcn_by4, GLIBC_2_1_1);
-compat_symbol (libc, __old_memset_gg, __memset_gcn_by2, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_gcn_by4, __memset_gcn_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_gcn_by2, __memset_gcn_by2, GLIBC_2_1_1);
 
 size_t
 __old_strlen_g (const char *str)
 {
-  return __strlen (str);
+  return strlen (str);
 }
-compat_symbol (__old_strlen_g, __strlen_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strlen_g, __strlen_g, GLIBC_2_1_1);
 
 char *
 __old_strcpy_g (char *dest, const char *src)
 {
-  return __strcpy (dest, src);
+  return strcpy (dest, src);
 }
-compat_symbol (__old_strcpy_g, __strcpy_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strcpy_g, __strcpy_g, GLIBC_2_1_1);
 
 void *
-__old_mempcpy_g (void *dest, const void *src, size_t len)
+__old_mempcpy_byn (void *dest, const void *src, size_t len)
 {
   return __mempcpy (dest, src, len);
 }
-compat_symbol (__old_mempcpy_g, __mempcpy_by4, GLIBC_2_1_1);
-compat_symbol (__old_mempcpy_g, __mempcpy_by2, GLIBC_2_1_1);
-compat_symbol (__old_mempcpy_g, __mempcpy_byn, GLIBC_2_1_1);
+strong_alias (__old_mempcpy_byn, __old_mempcpy_by4);
+strong_alias (__old_mempcpy_byn, __old_mempcpy_by2);
+compat_symbol (libc, __old_mempcpy_byn, __mempcpy_byn, GLIBC_2_1_1);
+compat_symbol (libc, __old_mempcpy_by4, __mempcpy_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_mempcpy_by2, __mempcpy_by2, GLIBC_2_1_1);
 
 char *
 __old_stpcpy_g (char *dest, const char *src)
 {
   return __stpcpy (dest, src);
 }
-compat_symbol (__old_stpcpy_g, __stpcpy_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_stpcpy_g, __stpcpy_g, GLIBC_2_1_1);
 
 char *
-__old_strncpy_srclen (char *dest, const char *src, size_t srclen, size_t n)
+__old_strncpy_byn (char *dest, const char *src, size_t srclen, size_t n)
 {
-  return __strncpy (dest, src, n);
+  return strncpy (dest, src, n);
 }
-compat_symbol (__old_strncpy_srclen, __old_strncpy_by4, GLIBC_2_1_1);
-compat_symbol (__old_strncpy_srclen, __old_strncpy_by2, GLIBC_2_1_1);
-compat_symbol (__old_strncpy_srclen, __old_strncpy_byn, GLIBC_2_1_1);
+strong_alias (__old_strncpy_byn, __old_strncpy_by4);
+strong_alias (__old_strncpy_byn, __old_strncpy_by2);
+compat_symbol (libc, __old_strncpy_byn, __strncpy_byn, GLIBC_2_1_1);
+compat_symbol (libc, __old_strncpy_by4, __strncpy_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_strncpy_by2, __strncpy_by2, GLIBC_2_1_1);
 
 char *
 __old_strncpy_gg (char *dest, const char *src, size_t n)
 {
-  return __strncpy (dest, src, n);
+  return strncpy (dest, src, n);
 }
-compat_symbol (__old_strncpy_gg, __strncpy_gg, GLIBC_2_1_1);
+compat_symbol (libc, __old_strncpy_gg, __strncpy_gg, GLIBC_2_1_1);
 
 /* __strcat_c took a third argument, which we ignore.  */
 char *
 __old_strcat_g (char *dest, const char *src)
 {
-  return __strcat (dest, src);
+  return strcat (dest, src);
 }
-compat_symbol (__old_strcat_g, __strcat_c, GLIBC_2_1_1);
-compat_symbol (__old_strcat_g, __strcat_g, GLIBC_2_1_1);
+strong_alias (__old_strcat_g, __old_strcat_c);
+compat_symbol (libc, __old_strcat_g, __strcat_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strcat_c, __strcat_c, GLIBC_2_1_1);
 
 char *
 __old_strncat_g (char *dest, const char *src, size_t n)
 {
   return __strncat (dest, src, n);
 }
-compat_symbol (__old_strncat_g, __strncat_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strncat_g, __strncat_g, GLIBC_2_1_1);
 
 int
 __old_strcmp_gg (const char *s1, const char *s2)
 {
-  return __strcmp (s1, s2);
+  return strcmp (s1, s2);
 }
-compat_symbol (__old_strcmp_gg, __strcmp_gg, GLIBC_2_1_1);
+compat_symbol (libc, __old_strcmp_gg, __strcmp_gg, GLIBC_2_1_1);
 
 int
 __old_strncmp_g (const char *s1, const char *s2, size_t n)
 {
-  return __strncmp (s1, s2, n);
+  return strncmp (s1, s2, n);
 }
-compat_symbol (__old_strncmp_g, __strncmp_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strncmp_g, __strncmp_g, GLIBC_2_1_1);
 
 char *
 __old_strchr_g (const char *s, int c)
 {
-  return __strchr (s, c);
+  return strchr (s, c);
 }
-compat_symbol (__old_strchr_g, __strchr_g, GLIBC_2_1_1);
-compat_symbol (__old_strchr_g, __strchr_c, GLIBC_2_1_1);
+strong_alias (__old_strchr_g, __old_strchr_c);
+compat_symbol (libc, __old_strchr_g, __strchr_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strchr_c, __strchr_c, GLIBC_2_1_1);
 
 char *
 __old_strchrnul_g (const char *s, int c)
 {
   return __strchrnul (s, c);
 }
-compat_symbol (__old_strchrnul_g, __strchrnul_g, GLIBC_2_1_1);
-compat_symbol (__old_strchrnul_g, __strchrnul_c, GLIBC_2_1_1);
+strong_alias (__old_strchrnul_g, __old_strchrnul_c);
+compat_symbol (libc, __old_strchrnul_g, __strchrnul_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strchrnul_c, __strchrnul_c, GLIBC_2_1_1);
 
 char *
 __old_strrchr_g (const char *s, int c)
 {
-  return __strrchr (s, c);
+  return strrchr (s, c);
 }
-compat_symbol (__old_strrchr_g, __strrchr_g, GLIBC_2_1_1);
-compat_symbol (__old_strrchr_g, __strrchr_c, GLIBC_2_1_1);
+strong_alias (__old_strrchr_g, __old_strrchr_c);
+compat_symbol (libc, __old_strrchr_g, __strrchr_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strrchr_c, __strrchr_c, GLIBC_2_1_1);
 
 /* __strcspn_cg took a third argument, which we ignore.  */
 size_t
 __old_strcspn_g (const char *s, const char *reject)
 {
-  return __strcspn (s, reject);
-}
-compat_symbol (__old_strcspn_g, __strcspn_g, GLIBC_2_1_1);
-compat_symbol (__old_strcspn_g, __strcspn_cg, GLIBC_2_1_1);
-
-/* __strcspn_c1 is roughly strchrnul but the reject argument and
-   return value need fixing up.  */
-size_t
-__old_strcspn_c1 (const char *s, int reject)
-{
-  return __strchrnul (s, (reject >> 8) & 0xff) - s;
+  return strcspn (s, reject);
 }
-compat_symbol (__old_strcspn_c1, __strcspn_c1, GLIBC_2_1_1);
+strong_alias (__old_strcspn_g, __old_strcspn_cg);
+compat_symbol (libc, __old_strcspn_g, __strcspn_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strcspn_cg, __strcspn_cg, GLIBC_2_1_1);
 
 /* __strspn_cg took a third argument, which we ignore.  */
 size_t
 __old_strspn_g (const char *s, const char *accept)
 {
-  return __strspn (s, accept);
+  return strspn (s, accept);
 }
-compat_symbol (__old_strspn_g, __strspn_g, GLIBC_2_1_1);
-compat_symbol (__old_strspn_g, __strspn_cg, GLIBC_2_1_1);
-
-/* __strspn_c1 needs the accept argument restored to its original form.  */
-size_t
-__old_strspn_c1 (const char *s, int accept)
-{
-  char xaccept[2] = { (accept >> 8) & 0xff, 0 };
-  return __strspn (s, xaccept);
-}
-compat_symbol (__old_strspn_c1, __strspn_c1, GLIBC_2_1_1);
+strong_alias (__old_strspn_g, __old_strspn_cg);
+compat_symbol (libc, __old_strspn_g, __strspn_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strspn_cg, __strspn_cg, GLIBC_2_1_1);
 
 /* __strpbrk_cg took a third argument, which we ignore.  */
-size_t
+const char *
 __old_strpbrk_g (const char *s, const char *accept)
 {
-  return __strpbrk (s, accept);
+  return strpbrk (s, accept);
 }
-compat_symbol (__old_strpbrk_g, __strpbrk_g, GLIBC_2_1_1);
-compat_symbol (__old_strpbrk_g, __strpbrk_cg, GLIBC_2_1_1);
+strong_alias (__old_strpbrk_g, __old_strpbrk_cg);
+compat_symbol (libc, __old_strpbrk_g, __strpbrk_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strpbrk_cg, __strpbrk_cg, GLIBC_2_1_1);
 
 /* __strstr_cg took a third argument, which we ignore.  */
-size_t
+const char *
 __old_strstr_g (const char *s, const char *accept)
 {
-  return __strstr (s, accept);
+  return strstr (s, accept);
 }
-compat_symbol (__old_strstr_g, __strstr_g, GLIBC_2_1_1);
-compat_symbol (__old_strstr_g, __strstr_cg, GLIBC_2_1_1);
+strong_alias (__old_strstr_g, __old_strstr_cg);
+compat_symbol (libc, __old_strstr_g, __strstr_g, GLIBC_2_1_1);
+compat_symbol (libc, __old_strstr_cg, __strstr_cg, GLIBC_2_1_1);
 
 #endif
diff --git a/test-skeleton.c b/test-skeleton.c
index fa457be..9c15025 100644
--- a/test-skeleton.c
+++ b/test-skeleton.c
@@ -611,6 +611,7 @@ main (int argc, char *argv[])
 /* The following functionality is only available if <pthread.h> was
    included before this file.  */
 #ifdef _PTHREAD_H
+#include <stdint.h> /* for uintptr_t */
 
 /* Call pthread_sigmask with error checking.  */
 static void

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5bcf45df5ccf01ba379ab10e68fa580ecc97fc76

commit 5bcf45df5ccf01ba379ab10e68fa580ecc97fc76
Author: Zack Weinberg <zackw@panix.com>
Date:   Thu Nov 17 09:26:27 2016 -0500

    For experimental purposes, remove bits/string.h.
    
    	* bits/string.h, string/bits/string.h
    	* sysdeps/aarch64/bits/string.h
    	* sysdeps/m68k/m680x0/m68020/bits/string.h
    	* sysdeps/s390/bits/string.h, sysdeps/sparc/bits/string.h
    	* sysdeps/x86/bits/string.h: Delete file.
    
    	* string/string.h: Don't include bits/string.h.
    	* string/bits/string3.h: No need to undef various symbols that
    	the removed headers might have defined as macros.
    	* string/Makefile (headers): Remove bits/string.h.
    	* string/string-inlines.c: Update commentary.  Remove definitions
    	of various macros that nothing looks at anymore.  Don't directly
    	include bits/string.h.  Set _STRING_INLINE_unaligned here, based on
    	compiler-predefined macros.
    
    	* sysdeps/i386/string-inlines.c: Define compat symbols for
    	everything formerly defined by sysdeps/x86/bits/string.h.
    	Make existing definitions into compat symbols as well.  Remove
    	some no-longer-necessary messing around with macros.
    
    	* sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c:
    	* sysdeps/powerpc/powerpc64/multiarch/mempcpy.c:
    	No need to define _HAVE_STRING_ARCH_mempcpy.

diff --git a/bits/string.h b/bits/string.h
deleted file mode 100644
index 89c627c..0000000
--- a/bits/string.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* This file should provide inline versions of string functions.
-
-   Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
-
-   This file should define __STRING_INLINES if functions are actually defined
-   as inlines.  */
-
-#ifndef _BITS_STRING_H
-#define _BITS_STRING_H	1
-
-/* Define whether to use the unaligned string inline ABI.
-   The string inline functions are an external ABI, thus cannot be changed
-   after the first release of a new target (unlike _STRING_ARCH_unaligned
-   which may be changed from release to release).  Targets must support
-   unaligned accesses in hardware if either define is set to true.  */
-#define _STRING_INLINE_unaligned   0
-
-#endif /* bits/string.h */
diff --git a/string/Makefile b/string/Makefile
index 4bb939d..1e84594 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -24,8 +24,7 @@ include ../Makeconfig
 
 headers	:= string.h strings.h memory.h endian.h bits/endian.h \
 	   argz.h envz.h byteswap.h bits/byteswap.h bits/byteswap-16.h \
-	   bits/string.h bits/string3.h \
-	   bits/const-covariance.h
+	   bits/string3.h bits/const-covariance.h
 
 routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   strverscmp strdup strndup				\
diff --git a/string/bits/string3.h b/string/bits/string3.h
index 8f13b65..ab734af 100644
--- a/string/bits/string3.h
+++ b/string/bits/string3.h
@@ -15,6 +15,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#ifndef _BITS_STRING3_H
+#define _BITS_STRING3_H 1
+
 #ifndef _STRING_H
 # error "Never use <bits/string3.h> directly; include <string.h> instead."
 #endif
@@ -24,28 +27,6 @@ __warndecl (__warn_memset_zero_len,
 	    "memset used with constant zero length parameter; this could be due to transposed parameters");
 #endif
 
-#ifndef __cplusplus
-/* XXX This is temporarily.  We should not redefine any of the symbols
-   and instead integrate the error checking into the original
-   definitions.  */
-# undef memcpy
-# undef memmove
-# undef memset
-# undef strcat
-# undef strcpy
-# undef strncat
-# undef strncpy
-# ifdef __USE_GNU
-#  undef mempcpy
-#  undef stpcpy
-# endif
-# ifdef __USE_MISC
-#  undef bcopy
-#  undef bzero
-# endif
-#endif
-
-
 __fortify_function void *
 __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
 	       size_t __len))
@@ -155,3 +136,5 @@ __NTH (strncat (char *__restrict __dest, const char *__restrict __src,
 {
   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
 }
+
+#endif
diff --git a/string/string-inlines.c b/string/string-inlines.c
index c49525f..0c31810 100644
--- a/string/string-inlines.c
+++ b/string/string-inlines.c
@@ -15,29 +15,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/*  <bits/string.h> declares some extern inline functions.  These
-    functions are declared additionally here if inlining is not
-    possible.  */
-
-#undef __USE_STRING_INLINES
-#define __USE_STRING_INLINES
-#define _FORCE_INLINES
-#define __STRING_INLINE /* empty */
-#define __NO_INLINE__
+/* This file contains compatibility definitions of functions that were
+   formerly defined as "extern inline" in string.h; it's conceivable
+   that old binaries contain references to them.  */
 
+#define __NO_STRING_INLINES
 #include <string.h>
 #undef index
 #undef rindex
 
-#undef __NO_INLINE__
-#include <bits/string.h>
-
 #include "shlib-compat.h"
 
 #if SHLIB_COMPAT (libc, GLIBC_2_1_1, GLIBC_2_24)
-/* The inline functions are not used from GLIBC 2.24 and forward, however
-   they are required to provide the symbols through string-inlines.c
-   (if inlining is not possible for compatibility reasons).  */
+/* These functions were removed from string.h in glibc 2.24.  */
 size_t
 __old_strcspn_c1 (const char *__s, int __reject)
 {
@@ -127,9 +117,13 @@ __old_strpbrk_c3 (const char *__s, int __accept1, int __accept2, int __accept3)
 }
 compat_symbol (libc, __old_strpbrk_c3, __strpbrk_c3, GLIBC_2_1_1);
 
+# if defined __mc68020__ || defined __s390__ || defined __i386__
+#  define _STRING_INLINE_unaligned 1
+# else
+#  define _STRING_INLINE_unaligned 0
 /* These are a few types we need for the optimizations if we cannot
    use unaligned memory accesses.  */
-# define __STRING2_COPY_TYPE(N) \
+#  define __STRING2_COPY_TYPE(N) \
   typedef struct { unsigned char __arr[N]; }				      \
     __attribute__ ((__packed__)) __STRING2_COPY_ARR##N
 __STRING2_COPY_TYPE (2);
@@ -139,8 +133,8 @@ __STRING2_COPY_TYPE (5);
 __STRING2_COPY_TYPE (6);
 __STRING2_COPY_TYPE (7);
 __STRING2_COPY_TYPE (8);
-# undef __STRING2_COPY_TYPE
-
+#  undef __STRING2_COPY_TYPE
+# endif
 
 # if _STRING_INLINE_unaligned
 void *
@@ -475,7 +469,7 @@ compat_symbol (libc, __old_stpcpy_small, __stpcpy_small, GLIBC_2_1_1);
 #endif
 
 #if SHLIB_COMPAT (libc, GLIBC_2_1_1, GLIBC_2_25)
-/* These inline functions are not used from GLIBC 2.25 and forward.  */
+/* These functions were removed from string.h in glibc 2.25.  */
 char *
 __old_strtok_r_1c (char *__s, char __sep, char **__nextp)
 {
diff --git a/string/string.h b/string/string.h
index c476efa..b87fe88 100644
--- a/string/string.h
+++ b/string/string.h
@@ -383,32 +383,7 @@ __CONST_COV_PROTO (basename, __nonnull ((1)),
 # endif
 #endif
 
-
 #if __GNUC_PREREQ (3,4)
-# if defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ \
-     && !defined __NO_INLINE__ && !defined __cplusplus
-/* When using GNU CC we provide some optimized versions of selected
-   functions from this header.  There are two kinds of optimizations:
-
-   - machine-dependent optimizations, most probably using inline
-     assembler code; these might be quite expensive since the code
-     size can increase significantly.
-     These optimizations are not used unless the symbol
-	__USE_STRING_INLINES
-     is defined before including this header.
-
-   - machine-independent optimizations which do not increase the
-     code size significantly and which optimize mainly situations
-     where one or more arguments are compile-time constants.
-     These optimizations are used always when the compiler is
-     taught to optimize.
-
-   One can inhibit all optimizations by defining __NO_STRING_INLINES.  */
-
-/* Get the machine-dependent optimizations (if any).  */
-#  include <bits/string.h>
-# endif
-
 # if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
 /* Functions with security checks.  */
 #  include <bits/string3.h>
diff --git a/sysdeps/aarch64/bits/string.h b/sysdeps/aarch64/bits/string.h
deleted file mode 100644
index 0a508f7..0000000
--- a/sysdeps/aarch64/bits/string.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Optimized, inlined string functions.  AArch64 version.
-   Copyright (C) 2015-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* AArch64 uses the aligned string inline ABI.  */
-#define _STRING_INLINE_unaligned 0
diff --git a/sysdeps/i386/string-inlines.c b/sysdeps/i386/string-inlines.c
index 64d80e8..2eaca25 100644
--- a/sysdeps/i386/string-inlines.c
+++ b/sysdeps/i386/string-inlines.c
@@ -15,33 +15,198 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/* This is to avoid PLT entries for the x86 version.  */
-#define __memcpy_g __memcpy_g_internal
-#define __strchr_g __strchr_g_internal
 #include <string/string-inlines.c>
 
+#if SHLIB_COMPAT (libc, GLIBC_2_1_1, GLIBC_2_25)
+/* Additional compatibility shims for the former
+   sysdeps/x86/bits/string.h.  */
 void *
-(__memcpy_c) (void *d, const void *s, size_t n)
+__old_memcpy_c (void *d, const void *s, size_t n)
 {
-  return memcpy (d, s, n);
+  return __memcpy (d, s, n);
 }
+compat_symbol (libc, __old_memcpy_c, __memcpy_c, GLIBC_2_1_1);
+compat_symbol (libc, __old_memcpy_c, __memcpy_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memcpy_c, __memcpy_by2, GLIBC_2_1_1);
 
 void *
-__memset_cc (void *s, unsigned long int pattern, size_t n)
+__old_memset_cc (void *s, unsigned long int pattern, size_t n)
 {
-  return memset (s, pattern & 0xff, n);
+  return __memset (s, pattern & 0xff, n);
 }
-strong_alias (__memset_cc, __memset_cg)
+compat_symbol (libc, __old_memset_cc, __memset_cc, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_cc, __memset_cg, GLIBC_2_1_1);
 
 void *
-__memset_gg (void *s, char c, size_t n)
+__old_memset_ccn (void *s, unsigned int pattern, size_t n)
 {
-  return memset (s, c, n);
+  return __memset (s, pattern & 0xff, n);
 }
+compat_symbol (libc, __old_memset_ccn, __memset_ccn, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_ccn, __memset_ccn_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_ccn, __memset_ccn_by2, GLIBC_2_1_1);
+
+void *
+__old_memset_gg (void *s, char c, size_t n)
+{
+  return __memset (s, c, n);
+}
+compat_symbol (libc, __old_memset_gg, __memset_gg, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_gg, __memset_gcn_by4, GLIBC_2_1_1);
+compat_symbol (libc, __old_memset_gg, __memset_gcn_by2, GLIBC_2_1_1);
+
+size_t
+__old_strlen_g (const char *str)
+{
+  return __strlen (str);
+}
+compat_symbol (__old_strlen_g, __strlen_g, GLIBC_2_1_1);
+
+char *
+__old_strcpy_g (char *dest, const char *src)
+{
+  return __strcpy (dest, src);
+}
+compat_symbol (__old_strcpy_g, __strcpy_g, GLIBC_2_1_1);
+
+void *
+__old_mempcpy_g (void *dest, const void *src, size_t len)
+{
+  return __mempcpy (dest, src, len);
+}
+compat_symbol (__old_mempcpy_g, __mempcpy_by4, GLIBC_2_1_1);
+compat_symbol (__old_mempcpy_g, __mempcpy_by2, GLIBC_2_1_1);
+compat_symbol (__old_mempcpy_g, __mempcpy_byn, GLIBC_2_1_1);
+
+char *
+__old_stpcpy_g (char *dest, const char *src)
+{
+  return __stpcpy (dest, src);
+}
+compat_symbol (__old_stpcpy_g, __stpcpy_g, GLIBC_2_1_1);
+
+char *
+__old_strncpy_srclen (char *dest, const char *src, size_t srclen, size_t n)
+{
+  return __strncpy (dest, src, n);
+}
+compat_symbol (__old_strncpy_srclen, __old_strncpy_by4, GLIBC_2_1_1);
+compat_symbol (__old_strncpy_srclen, __old_strncpy_by2, GLIBC_2_1_1);
+compat_symbol (__old_strncpy_srclen, __old_strncpy_byn, GLIBC_2_1_1);
+
+char *
+__old_strncpy_gg (char *dest, const char *src, size_t n)
+{
+  return __strncpy (dest, src, n);
+}
+compat_symbol (__old_strncpy_gg, __strncpy_gg, GLIBC_2_1_1);
+
+/* __strcat_c took a third argument, which we ignore.  */
+char *
+__old_strcat_g (char *dest, const char *src)
+{
+  return __strcat (dest, src);
+}
+compat_symbol (__old_strcat_g, __strcat_c, GLIBC_2_1_1);
+compat_symbol (__old_strcat_g, __strcat_g, GLIBC_2_1_1);
+
+char *
+__old_strncat_g (char *dest, const char *src, size_t n)
+{
+  return __strncat (dest, src, n);
+}
+compat_symbol (__old_strncat_g, __strncat_g, GLIBC_2_1_1);
+
+int
+__old_strcmp_gg (const char *s1, const char *s2)
+{
+  return __strcmp (s1, s2);
+}
+compat_symbol (__old_strcmp_gg, __strcmp_gg, GLIBC_2_1_1);
+
+int
+__old_strncmp_g (const char *s1, const char *s2, size_t n)
+{
+  return __strncmp (s1, s2, n);
+}
+compat_symbol (__old_strncmp_g, __strncmp_g, GLIBC_2_1_1);
+
+char *
+__old_strchr_g (const char *s, int c)
+{
+  return __strchr (s, c);
+}
+compat_symbol (__old_strchr_g, __strchr_g, GLIBC_2_1_1);
+compat_symbol (__old_strchr_g, __strchr_c, GLIBC_2_1_1);
+
+char *
+__old_strchrnul_g (const char *s, int c)
+{
+  return __strchrnul (s, c);
+}
+compat_symbol (__old_strchrnul_g, __strchrnul_g, GLIBC_2_1_1);
+compat_symbol (__old_strchrnul_g, __strchrnul_c, GLIBC_2_1_1);
+
+char *
+__old_strrchr_g (const char *s, int c)
+{
+  return __strrchr (s, c);
+}
+compat_symbol (__old_strrchr_g, __strrchr_g, GLIBC_2_1_1);
+compat_symbol (__old_strrchr_g, __strrchr_c, GLIBC_2_1_1);
+
+/* __strcspn_cg took a third argument, which we ignore.  */
+size_t
+__old_strcspn_g (const char *s, const char *reject)
+{
+  return __strcspn (s, reject);
+}
+compat_symbol (__old_strcspn_g, __strcspn_g, GLIBC_2_1_1);
+compat_symbol (__old_strcspn_g, __strcspn_cg, GLIBC_2_1_1);
+
+/* __strcspn_c1 is roughly strchrnul but the reject argument and
+   return value need fixing up.  */
+size_t
+__old_strcspn_c1 (const char *s, int reject)
+{
+  return __strchrnul (s, (reject >> 8) & 0xff) - s;
+}
+compat_symbol (__old_strcspn_c1, __strcspn_c1, GLIBC_2_1_1);
+
+/* __strspn_cg took a third argument, which we ignore.  */
+size_t
+__old_strspn_g (const char *s, const char *accept)
+{
+  return __strspn (s, accept);
+}
+compat_symbol (__old_strspn_g, __strspn_g, GLIBC_2_1_1);
+compat_symbol (__old_strspn_g, __strspn_cg, GLIBC_2_1_1);
+
+/* __strspn_c1 needs the accept argument restored to its original form.  */
+size_t
+__old_strspn_c1 (const char *s, int accept)
+{
+  char xaccept[2] = { (accept >> 8) & 0xff, 0 };
+  return __strspn (s, xaccept);
+}
+compat_symbol (__old_strspn_c1, __strspn_c1, GLIBC_2_1_1);
+
+/* __strpbrk_cg took a third argument, which we ignore.  */
+size_t
+__old_strpbrk_g (const char *s, const char *accept)
+{
+  return __strpbrk (s, accept);
+}
+compat_symbol (__old_strpbrk_g, __strpbrk_g, GLIBC_2_1_1);
+compat_symbol (__old_strpbrk_g, __strpbrk_cg, GLIBC_2_1_1);
+
+/* __strstr_cg took a third argument, which we ignore.  */
+size_t
+__old_strstr_g (const char *s, const char *accept)
+{
+  return __strstr (s, accept);
+}
+compat_symbol (__old_strstr_g, __strstr_g, GLIBC_2_1_1);
+compat_symbol (__old_strstr_g, __strstr_cg, GLIBC_2_1_1);
 
-#ifdef __memcpy_c
-# undef __memcpy_g
-strong_alias (__memcpy_g_internal, __memcpy_g)
-# undef __strchr_g
-strong_alias (__strchr_g_internal, __strchr_g)
 #endif
diff --git a/sysdeps/m68k/m680x0/m68020/bits/string.h b/sysdeps/m68k/m680x0/m68020/bits/string.h
deleted file mode 100644
index 78c9594..0000000
--- a/sysdeps/m68k/m680x0/m68020/bits/string.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Optimized, inlined string functions.  m680x0 version, x >= 2.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* Use the unaligned string inline ABI.  */
-#define _STRING_INLINE_unaligned 1
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
index 3c7c644..f8d47d2 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c
@@ -20,8 +20,6 @@
 # define mempcpy __redirect_mempcpy
 # define __mempcpy __redirect___mempcpy
 # define NO_MEMPCPY_STPCPY_REDIRECT
-/* Omit the mempcpy inline definitions because it would redefine mempcpy.  */
-# define _HAVE_STRING_ARCH_mempcpy 1
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
index 36ec954..3e698e5 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
@@ -20,8 +20,6 @@
 # define mempcpy __redirect_mempcpy
 # define __mempcpy __redirect___mempcpy
 # define NO_MEMPCPY_STPCPY_REDIRECT
-/* Omit the mempcpy inline definitions because it would redefine mempcpy.  */
-# define _HAVE_STRING_ARCH_mempcpy 1
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"
diff --git a/sysdeps/s390/bits/string.h b/sysdeps/s390/bits/string.h
deleted file mode 100644
index 39e0b7f..0000000
--- a/sysdeps/s390/bits/string.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/* Optimized, inlined string functions.  S/390 version.
-   Copyright (C) 2000-2016 Free Software Foundation, Inc.
-   Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* Use the unaligned string inline ABI.  */
-#define _STRING_INLINE_unaligned 1
-
-/* We only provide optimizations if the user selects them and if
-   GNU CC is used.  */
-#if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
-    && defined __GNUC__ && __GNUC__ >= 2
-
-#ifndef __STRING_INLINE
-# ifndef __extern_inline
-#  define __STRING_INLINE inline
-# else
-#  define __STRING_INLINE __extern_inline
-# endif
-#endif
-
-#define _HAVE_STRING_ARCH_strlen 1
-#ifndef _FORCE_INLINES
-#define strlen(str) __strlen_g ((str))
-
-__STRING_INLINE size_t __strlen_g (const char *) __asm__ ("strlen");
-
-__STRING_INLINE size_t
-__strlen_g (const char *__str)
-{
-    char *__ptr, *__tmp;
-
-    __ptr = (char *) 0;
-    __tmp = (char *) __str;
-    __asm__ __volatile__ ("   la    0,0\n"
-			  "0: srst  %0,%1\n"
-			  "   jo    0b\n"
-			  : "+&a" (__ptr), "+&a" (__tmp) :
-			  : "cc", "memory", "0" );
-    return (size_t) (__ptr - __str);
-}
-#endif
-
-/* Copy SRC to DEST.  */
-#define _HAVE_STRING_ARCH_strcpy 1
-#ifndef _FORCE_INLINES
-#define strcpy(dest, src) __strcpy_g ((dest), (src))
-
-__STRING_INLINE char *__strcpy_g (char *, const char *) __asm__ ("strcpy");
-
-__STRING_INLINE char *
-__strcpy_g (char *__dest, const char *__src)
-{
-    char *tmp = __dest;
-
-    __asm__ __volatile__ ("   la    0,0\n"
-			  "0: mvst  %0,%1\n"
-			  "   jo    0b"
-			  : "+&a" (__dest), "+&a" (__src) :
-			  : "cc", "memory", "0" );
-    return tmp;
-}
-#endif
-
-#define _HAVE_STRING_ARCH_strncpy 1
-#ifndef _FORCE_INLINES
-#define strncpy(dest, src, n) __strncpy_g ((dest), (src), (n))
-
-__STRING_INLINE char *__strncpy_g (char *, const char *, size_t)
-     __asm__ ("strncpy");
-
-__STRING_INLINE char *
-__strncpy_g (char *__dest, const char *__src, size_t __n)
-{
-    char *__ret = __dest;
-    char *__ptr;
-    size_t __diff;
-
-    if (__n > 0) {
-      __diff = (size_t) (__dest - __src);
-      __ptr = (char *) __src;
-      __asm__ __volatile__ ("   j     1f\n"
-			    "0: la    %0,1(%0)\n"
-			    "1: icm   0,1,0(%0)\n"
-			    "   stc   0,0(%2,%0)\n"
-			    "   jz    3f\n"
-#if defined(__s390x__)
-			    "   brctg %1,0b\n"
-#else
-			    "   brct  %1,0b\n"
-#endif
-			    "   j     4f\n"
-			    "2: la    %0,1(%0)\n"
-			    "   stc   0,0(%2,%0)\n"
-#if defined(__s390x__)
-			    "3: brctg %1,2b\n"
-#else
-			    "3: brct  %1,2b\n"
-#endif
-			    "4:"
-			    : "+&a" (__ptr), "+&a" (__n) : "a" (__diff)
-			    : "cc", "memory", "0" );
-    }
-    return __ret;
-}
-#endif
-
-/* Append SRC onto DEST.  */
-#define _HAVE_STRING_ARCH_strcat 1
-#ifndef _FORCE_INLINES
-#define strcat(dest, src) __strcat_g ((dest), (src))
-
-__STRING_INLINE char *__strcat_g (char *, const char *) __asm__ ("strcat");
-
-__STRING_INLINE char *
-__strcat_g (char *__dest, const char *__src)
-{
-    char *__ret = __dest;
-    char *__ptr, *__tmp;
-
-    /* Move __ptr to the end of __dest.  */
-    __ptr = (char *) 0;
-    __tmp = __dest;
-    __asm__ __volatile__ ("   la    0,0\n"
-			  "0: srst  %0,%1\n"
-			  "   jo    0b\n"
-			  : "+&a" (__ptr), "+&a" (__tmp) :
-			  : "cc", "0" );
-
-    /* Now do the copy.  */
-    __asm__ __volatile__ ("   la    0,0\n"
-			  "0: mvst  %0,%1\n"
-			  "   jo    0b"
-			  : "+&a" (__ptr), "+&a" (__src) :
-			  : "cc", "memory", "0" );
-    return __ret;
-}
-#endif
-
-/* Append no more than N characters from SRC onto DEST.  */
-#define _HAVE_STRING_ARCH_strncat 1
-#ifndef _FORCE_INLINES
-#define strncat(dest, src, n) __strncat_g ((dest), (src), (n))
-
-__STRING_INLINE char *__strncat_g (char *, const char *, size_t)
-     __asm__ ("strncat");
-
-__STRING_INLINE char *
-__strncat_g (char *__dest, const char *__src, size_t __n)
-{
-    char *__ret = __dest;
-    char *__ptr, *__tmp;
-    size_t __diff;
-
-    if (__n > 0) {
-      /* Move __ptr to the end of __dest.  */
-      __ptr = (char *) 0;
-      __tmp = __dest;
-      __asm__ __volatile__ ("   la    0,0\n"
-			    "0: srst  %0,%1\n"
-			  "   jo    0b\n"
-			    : "+&a" (__ptr), "+&a" (__tmp) :
-			    : "cc", "memory", "0" );
-
-      __diff = (size_t) (__ptr - __src);
-      __tmp = (char *) __src;
-      __asm__ __volatile__ ("   j     1f\n"
-			    "0: la    %0,1(%0)\n"
-			    "1: icm   0,1,0(%0)\n"
-			    "   stc   0,0(%2,%0)\n"
-			    "   jz    2f\n"
-#if defined(__s390x__)
-			    "   brctg %1,0b\n"
-#else
-			    "   brct  %1,0b\n"
-#endif
-			    "   slr   0,0\n"
-			    "   stc   0,1(%2,%0)\n"
-			    "2:"
-			    : "+&a" (__tmp), "+&a" (__n) : "a" (__diff)
-			    : "cc", "memory", "0" );
-
-    }
-    return __ret;
-}
-#endif
-
-/* Search N bytes of S for C.  */
-#define _HAVE_STRING_ARCH_memchr 1
-#ifndef _FORCE_INLINES
-__STRING_INLINE void *
-memchr (const void *__str, int __c, size_t __n)
-{
-    char *__ptr, *__tmp;
-
-    __tmp = (char *) __str;
-    __ptr = (char *) __tmp + __n;
-    __asm__ __volatile__ ("   lhi   0,0xff\n"
-			  "   nr    0,%2\n"
-			  "0: srst  %0,%1\n"
-			  "   jo    0b\n"
-			  "   brc   13,1f\n"
-			  "   la    %0,0\n"
-			  "1:"
-			  : "+&a" (__ptr), "+&a" (__tmp) : "d" (__c)
-			  : "cc", "memory", "0" );
-    return __ptr;
-}
-#endif
-
-/* Compare S1 and S2.  */
-#define _HAVE_STRING_ARCH_strcmp 1
-#ifndef _FORCE_INLINES
-__STRING_INLINE int
-strcmp (const char *__s1, const char *__s2)
-{
-    char *__p1, *__p2;
-    int __ret;
-
-    __p1 = (char *) __s1;
-    __p2 = (char *) __s2;
-    __asm__ __volatile__ ("   slr   0,0\n"
-			  "0: clst  %1,%2\n"
-			  "   jo    0b\n"
-			  "   ipm   %0\n"
-			  "   srl   %0,28"
-			  : "=d" (__ret), "+&a" (__p1), "+&a" (__p2) :
-			  : "cc", "memory", "0" );
-    __ret = (__ret == 0) ? 0 : (__ret == 1) ? -1 : 1;
-    return __ret;
-}
-#endif
-
-#endif	/* Use string inlines && GNU CC.  */
diff --git a/sysdeps/s390/multiarch/mempcpy.c b/sysdeps/s390/multiarch/mempcpy.c
index bee3ee4..1905f73 100644
--- a/sysdeps/s390/multiarch/mempcpy.c
+++ b/sysdeps/s390/multiarch/mempcpy.c
@@ -20,8 +20,6 @@
 #if defined SHARED && IS_IN (libc)
 # define mempcpy __redirect_mempcpy
 # define __mempcpy __redirect___mempcpy
-/* Omit the mempcpy inline definitions because it would redefine mempcpy.  */
-# define _HAVE_STRING_ARCH_mempcpy 1
 # include <string.h>
 # undef mempcpy
 # undef __mempcpy
diff --git a/sysdeps/sparc/bits/string.h b/sysdeps/sparc/bits/string.h
deleted file mode 100644
index 10beca6..0000000
--- a/sysdeps/sparc/bits/string.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Optimized, inlined string functions.  SPARC version.
-   Copyright (C) 2000-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* sparc uses the aligned string inline ABI.  */
-#define _STRING_INLINE_unaligned 0
-
-/* sparc32 and sparc64 strchr(x, '\0') perform better than
-   __rawmemchr(x, '\0').  */
-#define _HAVE_STRING_ARCH_strchr 1
-
-/* Don't inline mempcpy into memcpy as sparc has an optimized mempcpy.  */
-#define _HAVE_STRING_ARCH_mempcpy 1
diff --git a/sysdeps/x86/bits/string.h b/sysdeps/x86/bits/string.h
deleted file mode 100644
index 805d33f..0000000
--- a/sysdeps/x86/bits/string.h
+++ /dev/null
@@ -1,1996 +0,0 @@
-/* Optimized, inlined string functions.  i486/x86-64 version.
-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STRING_H
-# error "Never use <bits/string.h> directly; include <string.h> instead."
-#endif
-
-/* Use the unaligned string inline ABI.  */
-#define _STRING_INLINE_unaligned 1
-
-/* Don't inline mempcpy into memcpy as x86 has an optimized mempcpy.  */
-#define _HAVE_STRING_ARCH_mempcpy 1
-
-/* Enable inline functions only for i486 or better when compiling for
-   ia32.  */
-#if !defined __x86_64__ && (defined __i486__ || defined __pentium__	      \
-			    || defined __pentiumpro__ || defined __pentium4__ \
-			    || defined __nocona__ || defined __atom__ 	      \
-			    || defined __core2__ || defined __corei7__	      \
-			    || defined __sandybridge__ || defined __haswell__ \
-			    || defined __bonnell__ || defined __silvermont__  \
-			    || defined __k6__ || defined __geode__	      \
-			    || defined __k8__ || defined __athlon__	      \
-			    || defined __amdfam10__ || defined __bdver1__     \
-			    || defined __bdver2__ || defined __bdver3__	      \
-			    || defined __bdver4__ || defined __btver1__	      \
-			    || defined __btver2__)
-
-/* We only provide optimizations if the user selects them and if
-   GNU CC is used.  */
-# if !defined __NO_STRING_INLINES && defined __USE_STRING_INLINES \
-    && defined __GNUC__ && __GNUC__ >= 2
-
-# ifndef __STRING_INLINE
-#  ifndef __extern_inline
-#   define __STRING_INLINE inline
-#  else
-#   define __STRING_INLINE __extern_inline
-#  endif
-# endif
-
-/* The macros are used in some of the optimized implementations below.  */
-# define __STRING_SMALL_GET16(src, idx) \
-  ((((const unsigned char *) (src))[idx + 1] << 8)			      \
-   | ((const unsigned char *) (src))[idx])
-# define __STRING_SMALL_GET32(src, idx) \
-  (((((const unsigned char *) (src))[idx + 3] << 8			      \
-     | ((const unsigned char *) (src))[idx + 2]) << 8			      \
-    | ((const unsigned char *) (src))[idx + 1]) << 8			      \
-   | ((const unsigned char *) (src))[idx])
-
-
-/* Copy N bytes of SRC to DEST.  */
-# define _HAVE_STRING_ARCH_memcpy 1
-# define memcpy(dest, src, n) \
-  (__extension__ (__builtin_constant_p (n)				      \
-		  ? __memcpy_c ((dest), (src), (n))			      \
-		  : __memcpy_g ((dest), (src), (n))))
-# define __memcpy_c(dest, src, n) \
-  ((n) == 0								      \
-   ? (dest)								      \
-   : (((n) % 4 == 0)							      \
-      ? __memcpy_by4 (dest, src, n)					      \
-      : (((n) % 2 == 0)							      \
-	 ? __memcpy_by2 (dest, src, n)					      \
-	 : __memcpy_g (dest, src, n))))
-
-__STRING_INLINE void *__memcpy_by4 (void *__dest, const void *__src,
-				    size_t __n);
-
-__STRING_INLINE void *
-__memcpy_by4 (void *__dest, const void *__src, size_t __n)
-{
-  register unsigned long int __d0, __d1;
-  register void *__tmp = __dest;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movl	(%2),%0\n\t"
-     "leal	4(%2),%2\n\t"
-     "movl	%0,(%1)\n\t"
-     "leal	4(%1),%1\n\t"
-     "decl	%3\n\t"
-     "jnz	1b"
-     : "=&r" (__d0), "=&r" (__tmp), "=&r" (__src), "=&r" (__d1)
-     : "1" (__tmp), "2" (__src), "3" (__n / 4)
-     : "memory", "cc");
-  return __dest;
-}
-
-__STRING_INLINE void *__memcpy_by2 (void *__dest, const void *__src,
-				    size_t __n);
-
-__STRING_INLINE void *
-__memcpy_by2 (void *__dest, const void *__src, size_t __n)
-{
-  register unsigned long int __d0, __d1;
-  register void *__tmp = __dest;
-  __asm__ __volatile__
-    ("shrl	$1,%3\n\t"
-     "jz	2f\n"                 /* only a word */
-     "1:\n\t"
-     "movl	(%2),%0\n\t"
-     "leal	4(%2),%2\n\t"
-     "movl	%0,(%1)\n\t"
-     "leal	4(%1),%1\n\t"
-     "decl	%3\n\t"
-     "jnz	1b\n"
-     "2:\n\t"
-     "movw	(%2),%w0\n\t"
-     "movw	%w0,(%1)"
-     : "=&q" (__d0), "=&r" (__tmp), "=&r" (__src), "=&r" (__d1)
-     : "1" (__tmp), "2" (__src), "3" (__n / 2)
-     : "memory", "cc");
-  return __dest;
-}
-
-__STRING_INLINE void *__memcpy_g (void *__dest, const void *__src, size_t __n);
-
-__STRING_INLINE void *
-__memcpy_g (void *__dest, const void *__src, size_t __n)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register void *__tmp = __dest;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "shrl	$1,%%ecx\n\t"
-     "jnc	1f\n\t"
-     "movsb\n"
-     "1:\n\t"
-     "shrl	$1,%%ecx\n\t"
-     "jnc	2f\n\t"
-     "movsw\n"
-     "2:\n\t"
-     "rep; movsl"
-     : "=&c" (__d0), "=&D" (__d1), "=&S" (__d2),
-       "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
-     : "0" (__n), "1" (__tmp), "2" (__src),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__src)
-     : "cc");
-  return __dest;
-}
-
-# define _HAVE_STRING_ARCH_memmove 1
-# ifndef _FORCE_INLINES
-/* Copy N bytes of SRC to DEST, guaranteeing
-   correct behavior for overlapping strings.  */
-#  define memmove(dest, src, n) __memmove_g (dest, src, n)
-
-__STRING_INLINE void *__memmove_g (void *, const void *, size_t)
-     __asm__ ("memmove");
-
-__STRING_INLINE void *
-__memmove_g (void *__dest, const void *__src, size_t __n)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register void *__tmp = __dest;
-  if (__dest < __src)
-    __asm__ __volatile__
-      ("cld\n\t"
-       "rep; movsb"
-       : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2),
-	 "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
-       : "0" (__n), "1" (__src), "2" (__tmp),
-	 "m" ( *(struct { __extension__ char __x[__n]; } *)__src));
-  else
-    __asm__ __volatile__
-      ("decl %1\n\t"
-       "decl %2\n\t"
-       "std\n\t"
-       "rep; movsb\n\t"
-       "cld"
-       : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2),
-	 "=m" ( *(struct { __extension__ char __x[__n]; } *)__dest)
-       : "0" (__n), "1" (__n + (const char *) __src),
-	 "2" (__n + (char *) __tmp),
-	 "m" ( *(struct { __extension__ char __x[__n]; } *)__src));
-  return __dest;
-}
-# endif
-
-/* Compare N bytes of S1 and S2.  */
-# define _HAVE_STRING_ARCH_memcmp 1
-# ifndef _FORCE_INLINES
-#  ifndef __PIC__
-/* gcc has problems to spill registers when using PIC.  */
-__STRING_INLINE int
-memcmp (const void *__s1, const void *__s2, size_t __n)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register int __res;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "testl %3,%3\n\t"
-     "repe; cmpsb\n\t"
-     "je	1f\n\t"
-     "sbbl	%0,%0\n\t"
-     "orl	$1,%0\n"
-     "1:"
-     : "=&a" (__res), "=&S" (__d0), "=&D" (__d1), "=&c" (__d2)
-     : "0" (0), "1" (__s1), "2" (__s2), "3" (__n),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__s1),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__s2)
-     : "cc");
-  return __res;
-}
-#  endif
-# endif
-
-/* Set N bytes of S to C.  */
-# define _HAVE_STRING_ARCH_memset 1
-# define _USE_STRING_ARCH_memset 1
-# define memset(s, c, n) \
-  (__extension__ (__builtin_constant_p (n) && (n) <= 16			      \
-		  ? ((n) == 1						      \
-		     ? __memset_c1 ((s), (c))				      \
-		     : __memset_gc ((s), (c), (n)))			      \
-		  : (__builtin_constant_p (c)				      \
-		     ? (__builtin_constant_p (n)			      \
-			? __memset_ccn ((s), (c), (n))			      \
-			: memset ((s), (c), (n)))			      \
-		     : (__builtin_constant_p (n)			      \
-			? __memset_gcn ((s), (c), (n))			      \
-			: memset ((s), (c), (n))))))
-
-# define __memset_c1(s, c) ({ void *__s = (s);				      \
-			      *((unsigned char *) __s) = (unsigned char) (c); \
-			      __s; })
-
-# define __memset_gc(s, c, n) \
-  ({ void *__s = (s);							      \
-     union {								      \
-       unsigned int __ui;						      \
-       unsigned short int __usi;					      \
-       unsigned char __uc;						      \
-     } *__u = __s;							      \
-     unsigned int __c = ((unsigned int) ((unsigned char) (c))) * 0x01010101;  \
-									      \
-     /* We apply a trick here.  `gcc' would implement the following	      \
-	assignments using immediate operands.  But this uses to much	      \
-	memory (7, instead of 4 bytes).  So we force the value in a	      \
-	registers.  */							      \
-     if ((n) == 3 || (n) >= 5)						      \
-       __asm__ __volatile__ ("" : "=r" (__c) : "0" (__c));		      \
-									      \
-     /* This `switch' statement will be removed at compile-time.  */	      \
-     switch (n)								      \
-       {								      \
-       case 15:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 11:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 7:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 3:								      \
-	 __u->__usi = (unsigned short int) __c;				      \
-	 __u = __extension__ ((void *) __u + 2);			      \
-	 __u->__uc = (unsigned char) __c;				      \
-	 break;								      \
-									      \
-       case 14:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 10:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 6:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 2:								      \
-	 __u->__usi = (unsigned short int) __c;				      \
-	 break;								      \
-									      \
-       case 13:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 9:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 5:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 1:								      \
-	 __u->__uc = (unsigned char) __c;				      \
-	 break;								      \
-									      \
-       case 16:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 12:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 8:								      \
-	 __u->__ui = __c;						      \
-	 __u = __extension__ ((void *) __u + 4);			      \
-       case 4:								      \
-	 __u->__ui = __c;						      \
-       case 0:								      \
-	 break;								      \
-       }								      \
-									      \
-     __s; })
-
-# define __memset_ccn(s, c, n) \
-  (((n) % 4 == 0)							      \
-   ? __memset_ccn_by4 (s, ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
-		       n)						      \
-   : (((n) % 2 == 0)							      \
-      ? __memset_ccn_by2 (s,						      \
-			  ((unsigned int) ((unsigned char) (c))) * 0x01010101,\
-			   n)						      \
-      : memset (s, c, n)))
-
-__STRING_INLINE void *__memset_ccn_by4 (void *__s, unsigned int __c,
-					size_t __n);
-
-__STRING_INLINE void *
-__memset_ccn_by4 (void *__s, unsigned int __c, size_t __n)
-{
-  register void *__tmp = __s;
-  register unsigned long int __d0;
-# ifdef __i686__
-  __asm__ __volatile__
-    ("cld\n\t"
-     "rep; stosl"
-     : "=&a" (__c), "=&D" (__tmp), "=&c" (__d0),
-       "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
-     : "cc");
-# else
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movl	%0,(%1)\n\t"
-     "addl	$4,%1\n\t"
-     "decl	%2\n\t"
-     "jnz	1b\n"
-     : "=&r" (__c), "=&r" (__tmp), "=&r" (__d0),
-       "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
-     : "cc");
-# endif
-  return __s;
-}
-
-__STRING_INLINE void *__memset_ccn_by2 (void *__s, unsigned int __c,
-					size_t __n);
-
-__STRING_INLINE void *
-__memset_ccn_by2 (void *__s, unsigned int __c, size_t __n)
-{
-  register unsigned long int __d0, __d1;
-  register void *__tmp = __s;
-# ifdef __i686__
-  __asm__ __volatile__
-    ("cld\n\t"
-     "rep; stosl\n"
-     "stosw"
-     : "=&a" (__d0), "=&D" (__tmp), "=&c" (__d1),
-       "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
-     : "cc");
-# else
-  __asm__ __volatile__
-    ("1:\tmovl	%0,(%1)\n\t"
-     "leal	4(%1),%1\n\t"
-     "decl	%2\n\t"
-     "jnz	1b\n"
-     "movw	%w0,(%1)"
-     : "=&q" (__d0), "=&r" (__tmp), "=&r" (__d1),
-       "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
-     : "cc");
-#endif
-  return __s;
-}
-
-# define __memset_gcn(s, c, n) \
-  (((n) % 4 == 0)							      \
-   ? __memset_gcn_by4 (s, c, n)						      \
-   : (((n) % 2 == 0)							      \
-      ? __memset_gcn_by2 (s, c, n)					      \
-      : memset (s, c, n)))
-
-__STRING_INLINE void *__memset_gcn_by4 (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_gcn_by4 (void *__s, int __c, size_t __n)
-{
-  register void *__tmp = __s;
-  register unsigned long int __d0;
-  __asm__ __volatile__
-    ("movb	%b0,%h0\n"
-     "pushw	%w0\n\t"
-     "shll	$16,%0\n\t"
-     "popw	%w0\n"
-     "1:\n\t"
-     "movl	%0,(%1)\n\t"
-     "addl	$4,%1\n\t"
-     "decl	%2\n\t"
-     "jnz	1b\n"
-     : "=&q" (__c), "=&r" (__tmp), "=&r" (__d0),
-       "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
-     : "cc");
-  return __s;
-}
-
-__STRING_INLINE void *__memset_gcn_by2 (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_gcn_by2 (void *__s, int __c, size_t __n)
-{
-  register unsigned long int __d0, __d1;
-  register void *__tmp = __s;
-  __asm__ __volatile__
-    ("movb	%b0,%h0\n\t"
-     "pushw	%w0\n\t"
-     "shll	$16,%0\n\t"
-     "popw	%w0\n"
-     "1:\n\t"
-     "movl	%0,(%1)\n\t"
-     "leal	4(%1),%1\n\t"
-     "decl	%2\n\t"
-     "jnz	1b\n"
-     "movw	%w0,(%1)"
-     : "=&q" (__d0), "=&r" (__tmp), "=&r" (__d1),
-       "=m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "0" ((unsigned int) __c), "1" (__tmp), "2" (__n / 4)
-     : "cc");
-  return __s;
-}
-
-
-/* Search N bytes of S for C.  */
-# define _HAVE_STRING_ARCH_memchr 1
-# ifndef _FORCE_INLINES
-__STRING_INLINE void *
-memchr (const void *__s, int __c, size_t __n)
-{
-  register unsigned long int __d0;
-#  ifdef __i686__
-  register unsigned long int __d1;
-#  endif
-  register unsigned char *__res;
-  if (__n == 0)
-    return NULL;
-#  ifdef __i686__
-  __asm__ __volatile__
-    ("cld\n\t"
-     "repne; scasb\n\t"
-     "cmovne %2,%0"
-     : "=D" (__res), "=&c" (__d0), "=&r" (__d1)
-     : "a" (__c), "0" (__s), "1" (__n), "2" (1),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "cc");
-#  else
-  __asm__ __volatile__
-    ("cld\n\t"
-     "repne; scasb\n\t"
-     "je	1f\n\t"
-     "movl	$1,%0\n"
-     "1:"
-     : "=D" (__res), "=&c" (__d0)
-     : "a" (__c), "0" (__s), "1" (__n),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "cc");
-#  endif
-  return __res - 1;
-}
-# endif
-
-# define _HAVE_STRING_ARCH_memrchr 1
-# ifndef _FORCE_INLINES
-__STRING_INLINE void *__memrchr (const void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memrchr (const void *__s, int __c, size_t __n)
-{
-  register unsigned long int __d0;
-#  ifdef __i686__
-  register unsigned long int __d1;
-#  endif
-  register void *__res;
-  if (__n == 0)
-    return NULL;
-#  ifdef __i686__
-  __asm__ __volatile__
-    ("std\n\t"
-     "repne; scasb\n\t"
-     "cmovne %2,%0\n\t"
-     "cld\n\t"
-     "incl %0"
-     : "=D" (__res), "=&c" (__d0), "=&r" (__d1)
-     : "a" (__c), "0" (__s + __n - 1), "1" (__n), "2" (-1),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "cc");
-#  else
-  __asm__ __volatile__
-    ("std\n\t"
-     "repne; scasb\n\t"
-     "je 1f\n\t"
-     "orl $-1,%0\n"
-     "1:\tcld\n\t"
-     "incl %0"
-     : "=D" (__res), "=&c" (__d0)
-     : "a" (__c), "0" (__s + __n - 1), "1" (__n),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__s)
-     : "cc");
-#  endif
-  return __res;
-}
-#  ifdef __USE_GNU
-#   define memrchr(s, c, n) __memrchr ((s), (c), (n))
-#  endif
-# endif
-
-/* Return pointer to C in S.  */
-# define _HAVE_STRING_ARCH_rawmemchr 1
-__STRING_INLINE void *__rawmemchr (const void *__s, int __c);
-
-# ifndef _FORCE_INLINES
-__STRING_INLINE void *
-__rawmemchr (const void *__s, int __c)
-{
-  register unsigned long int __d0;
-  register unsigned char *__res;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "repne; scasb\n\t"
-     : "=D" (__res), "=&c" (__d0)
-     : "a" (__c), "0" (__s), "1" (0xffffffff),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res - 1;
-}
-#  ifdef __USE_GNU
-__STRING_INLINE void *
-rawmemchr (const void *__s, int __c)
-{
-  return __rawmemchr (__s, __c);
-}
-#  endif /* use GNU */
-# endif
-
-
-/* Return the length of S.  */
-# define _HAVE_STRING_ARCH_strlen 1
-# define strlen(str) \
-  (__extension__ (__builtin_constant_p (str)				      \
-		  ? __builtin_strlen (str)				      \
-		  : __strlen_g (str)))
-__STRING_INLINE size_t __strlen_g (const char *__str);
-
-__STRING_INLINE size_t
-__strlen_g (const char *__str)
-{
-  register char __dummy;
-  register const char *__tmp = __str;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movb	(%0),%b1\n\t"
-     "leal	1(%0),%0\n\t"
-     "testb	%b1,%b1\n\t"
-     "jne	1b"
-     : "=r" (__tmp), "=&q" (__dummy)
-     : "0" (__str),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__str)
-     : "cc" );
-  return __tmp - __str - 1;
-}
-
-
-/* Copy SRC to DEST.  */
-# define _HAVE_STRING_ARCH_strcpy 1
-# define strcpy(dest, src) \
-  (__extension__ (__builtin_constant_p (src)				      \
-		  ? (sizeof ((src)[0]) == 1 && strlen (src) + 1 <= 8	      \
-		     ? __strcpy_a_small ((dest), (src), strlen (src) + 1)     \
-		     : (char *) memcpy ((char *) (dest),		      \
-					(const char *) (src),		      \
-					strlen (src) + 1))		      \
-		  : __strcpy_g ((dest), (src))))
-
-# define __strcpy_a_small(dest, src, srclen) \
-  (__extension__ ({ char *__dest = (dest);				      \
-		    union {						      \
-		      unsigned int __ui;				      \
-		      unsigned short int __usi;				      \
-		      unsigned char __uc;				      \
-		      char __c;						      \
-		    } *__u = (void *) __dest;				      \
-		    switch (srclen)					      \
-		      {							      \
-		      case 1:						      \
-			__u->__uc = '\0';				      \
-			break;						      \
-		      case 2:						      \
-			__u->__usi = __STRING_SMALL_GET16 (src, 0);	      \
-			break;						      \
-		      case 3:						      \
-			__u->__usi = __STRING_SMALL_GET16 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 2);		      \
-			__u->__uc = '\0';				      \
-			break;						      \
-		      case 4:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			break;						      \
-		      case 5:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 4);		      \
-			__u->__uc = '\0';				      \
-			break;						      \
-		      case 6:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 4);		      \
-			__u->__usi = __STRING_SMALL_GET16 (src, 4);	      \
-			break;						      \
-		      case 7:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 4);		      \
-			__u->__usi = __STRING_SMALL_GET16 (src, 4);	      \
-			__u = __extension__ ((void *) __u + 2);		      \
-			__u->__uc = '\0';				      \
-			break;						      \
-		      case 8:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 4);		      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 4);	      \
-			break;						      \
-		      }							      \
-		    (char *) __dest; }))
-
-__STRING_INLINE char *__strcpy_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__strcpy_g (char *__dest, const char *__src)
-{
-  register char *__tmp = __dest;
-  register char __dummy;
-  __asm__ __volatile__
-    (
-     "1:\n\t"
-     "movb	(%0),%b2\n\t"
-     "leal	1(%0),%0\n\t"
-     "movb	%b2,(%1)\n\t"
-     "leal	1(%1),%1\n\t"
-     "testb	%b2,%b2\n\t"
-     "jne	1b"
-     : "=&r" (__src), "=&r" (__tmp), "=&q" (__dummy),
-       "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
-     : "0" (__src), "1" (__tmp),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__src)
-     : "cc");
-  return __dest;
-}
-
-
-# ifdef __USE_GNU
-#  define _HAVE_STRING_ARCH_stpcpy 1
-/* Copy SRC to DEST.  */
-#  define __stpcpy(dest, src) \
-  (__extension__ (__builtin_constant_p (src)				      \
-		  ? (strlen (src) + 1 <= 8				      \
-		     ? __stpcpy_a_small ((dest), (src), strlen (src) + 1)     \
-		     : __stpcpy_c ((dest), (src), strlen (src) + 1))	      \
-		  : __stpcpy_g ((dest), (src))))
-#  define __stpcpy_c(dest, src, srclen) \
-  ((srclen) % 4 == 0							      \
-   ? __mempcpy_by4 (dest, src, srclen) - 1				      \
-   : ((srclen) % 2 == 0							      \
-      ? __mempcpy_by2 (dest, src, srclen) - 1				      \
-      : __mempcpy_byn (dest, src, srclen) - 1))
-
-/* In glibc itself we use this symbol for namespace reasons.  */
-#  define stpcpy(dest, src) __stpcpy ((dest), (src))
-
-#  define __stpcpy_a_small(dest, src, srclen) \
-  (__extension__ ({ union {						      \
-		      unsigned int __ui;				      \
-		      unsigned short int __usi;				      \
-		      unsigned char __uc;				      \
-		      char __c;						      \
-		    } *__u = (void *) (dest);				      \
-		    switch (srclen)					      \
-		      {							      \
-		      case 1:						      \
-			__u->__uc = '\0';				      \
-			break;						      \
-		      case 2:						      \
-			__u->__usi = __STRING_SMALL_GET16 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 1);		      \
-			break;						      \
-		      case 3:						      \
-			__u->__usi = __STRING_SMALL_GET16 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 2);		      \
-			__u->__uc = '\0';				      \
-			break;						      \
-		      case 4:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 3);		      \
-			break;						      \
-		      case 5:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 4);		      \
-			__u->__uc = '\0';				      \
-			break;						      \
-		      case 6:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 4);		      \
-			__u->__usi = __STRING_SMALL_GET16 (src, 4);	      \
-			__u = __extension__ ((void *) __u + 1);		      \
-			break;						      \
-		      case 7:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 4);		      \
-			__u->__usi = __STRING_SMALL_GET16 (src, 4);	      \
-			__u = __extension__ ((void *) __u + 2);		      \
-			__u->__uc = '\0';				      \
-			break;						      \
-		      case 8:						      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 0);	      \
-			__u = __extension__ ((void *) __u + 4);		      \
-			__u->__ui = __STRING_SMALL_GET32 (src, 4);	      \
-			__u = __extension__ ((void *) __u + 3);		      \
-			break;						      \
-		      }							      \
-		    (char *) __u; }))
-
-__STRING_INLINE char *__mempcpy_by4 (char *__dest, const char *__src,
-				     size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_by4 (char *__dest, const char *__src, size_t __srclen)
-{
-  register char *__tmp = __dest;
-  register unsigned long int __d0, __d1;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movl	(%2),%0\n\t"
-     "leal	4(%2),%2\n\t"
-     "movl	%0,(%1)\n\t"
-     "leal	4(%1),%1\n\t"
-     "decl	%3\n\t"
-     "jnz	1b"
-     : "=&r" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1)
-     : "1" (__tmp), "2" (__src), "3" (__srclen / 4)
-     : "memory", "cc");
-  return __tmp;
-}
-
-__STRING_INLINE char *__mempcpy_by2 (char *__dest, const char *__src,
-				     size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_by2 (char *__dest, const char *__src, size_t __srclen)
-{
-  register char *__tmp = __dest;
-  register unsigned long int __d0, __d1;
-  __asm__ __volatile__
-    ("shrl	$1,%3\n\t"
-     "jz	2f\n"                 /* only a word */
-     "1:\n\t"
-     "movl	(%2),%0\n\t"
-     "leal	4(%2),%2\n\t"
-     "movl	%0,(%1)\n\t"
-     "leal	4(%1),%1\n\t"
-     "decl	%3\n\t"
-     "jnz	1b\n"
-     "2:\n\t"
-     "movw	(%2),%w0\n\t"
-     "movw	%w0,(%1)"
-     : "=&q" (__d0), "=r" (__tmp), "=&r" (__src), "=&r" (__d1),
-       "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
-     : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
-       "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
-     : "cc");
-  return __tmp + 2;
-}
-
-__STRING_INLINE char *__mempcpy_byn (char *__dest, const char *__src,
-				     size_t __srclen);
-
-__STRING_INLINE char *
-__mempcpy_byn (char *__dest, const char *__src, size_t __srclen)
-{
-  register unsigned long __d0, __d1;
-  register char *__tmp = __dest;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "shrl	$1,%%ecx\n\t"
-     "jnc	1f\n\t"
-     "movsb\n"
-     "1:\n\t"
-     "shrl	$1,%%ecx\n\t"
-     "jnc	2f\n\t"
-     "movsw\n"
-     "2:\n\t"
-     "rep; movsl"
-     : "=D" (__tmp), "=&c" (__d0), "=&S" (__d1),
-       "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
-     : "0" (__tmp), "1" (__srclen), "2" (__src),
-       "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
-     : "cc");
-  return __tmp;
-}
-
-__STRING_INLINE char *__stpcpy_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__stpcpy_g (char *__dest, const char *__src)
-{
-  register char *__tmp = __dest;
-  register char __dummy;
-  __asm__ __volatile__
-    (
-     "1:\n\t"
-     "movb	(%0),%b2\n\t"
-     "leal	1(%0),%0\n\t"
-     "movb	%b2,(%1)\n\t"
-     "leal	1(%1),%1\n\t"
-     "testb	%b2,%b2\n\t"
-     "jne	1b"
-     : "=&r" (__src), "=r" (__tmp), "=&q" (__dummy),
-       "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
-     : "0" (__src), "1" (__tmp),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__src)
-     : "cc");
-  return __tmp - 1;
-}
-# endif
-
-
-/* Copy no more than N characters of SRC to DEST.  */
-# define _HAVE_STRING_ARCH_strncpy 1
-# define strncpy(dest, src, n) \
-  (__extension__ (__builtin_constant_p (src)				      \
-		  ? ((strlen (src) + 1 >= ((size_t) (n))		      \
-		      ? (char *) memcpy ((char *) (dest),		      \
-					 (const char *) (src), n)	      \
-		      : __strncpy_cg ((dest), (src), strlen (src) + 1, n)))   \
-		  : __strncpy_gg ((dest), (src), n)))
-# define __strncpy_cg(dest, src, srclen, n) \
-  (((srclen) % 4 == 0)							      \
-   ? __strncpy_by4 (dest, src, srclen, n)				      \
-   : (((srclen) % 2 == 0)						      \
-      ? __strncpy_by2 (dest, src, srclen, n)				      \
-      : __strncpy_byn (dest, src, srclen, n)))
-
-__STRING_INLINE char *__strncpy_by4 (char *__dest, const char __src[],
-				     size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_by4 (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
-  register char *__tmp = __dest;
-  register int __dummy1, __dummy2;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movl	(%2),%0\n\t"
-     "leal	4(%2),%2\n\t"
-     "movl	%0,(%1)\n\t"
-     "leal	4(%1),%1\n\t"
-     "decl	%3\n\t"
-     "jnz	1b"
-     : "=&r" (__dummy1), "=r" (__tmp), "=&r" (__src), "=&r" (__dummy2),
-       "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
-     : "1" (__tmp), "2" (__src), "3" (__srclen / 4),
-       "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
-     : "cc");
-  (void) memset (__tmp, '\0', __n - __srclen);
-  return __dest;
-}
-
-__STRING_INLINE char *__strncpy_by2 (char *__dest, const char __src[],
-				     size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_by2 (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
-  register char *__tmp = __dest;
-  register int __dummy1, __dummy2;
-  __asm__ __volatile__
-    ("shrl	$1,%3\n\t"
-     "jz	2f\n"                 /* only a word */
-     "1:\n\t"
-     "movl	(%2),%0\n\t"
-     "leal	4(%2),%2\n\t"
-     "movl	%0,(%1)\n\t"
-     "leal	4(%1),%1\n\t"
-     "decl	%3\n\t"
-     "jnz	1b\n"
-     "2:\n\t"
-     "movw	(%2),%w0\n\t"
-     "movw	%w0,(%1)\n\t"
-     : "=&q" (__dummy1), "=r" (__tmp), "=&r" (__src), "=&r" (__dummy2),
-       "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
-     : "1" (__tmp), "2" (__src), "3" (__srclen / 2),
-       "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
-     : "cc");
-  (void) memset (__tmp + 2, '\0', __n - __srclen);
-  return __dest;
-}
-
-__STRING_INLINE char *__strncpy_byn (char *__dest, const char __src[],
-				     size_t __srclen, size_t __n);
-
-__STRING_INLINE char *
-__strncpy_byn (char *__dest, const char __src[], size_t __srclen, size_t __n)
-{
-  register unsigned long int __d0, __d1;
-  register char *__tmp = __dest;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "shrl	$1,%1\n\t"
-     "jnc	1f\n\t"
-     "movsb\n"
-     "1:\n\t"
-     "shrl	$1,%1\n\t"
-     "jnc	2f\n\t"
-     "movsw\n"
-     "2:\n\t"
-     "rep; movsl"
-     : "=D" (__tmp), "=&c" (__d0), "=&S" (__d1),
-       "=m" ( *(struct { __extension__ char __x[__srclen]; } *)__dest)
-     : "1" (__srclen), "0" (__tmp),"2" (__src),
-       "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
-     : "cc");
-  (void) memset (__tmp, '\0', __n - __srclen);
-  return __dest;
-}
-
-__STRING_INLINE char *__strncpy_gg (char *__dest, const char *__src,
-				    size_t __n);
-
-__STRING_INLINE char *
-__strncpy_gg (char *__dest, const char *__src, size_t __n)
-{
-  register char *__tmp = __dest;
-  register char __dummy;
-  if (__n > 0)
-    __asm__ __volatile__
-      ("1:\n\t"
-       "movb	(%0),%2\n\t"
-       "incl	%0\n\t"
-       "movb	%2,(%1)\n\t"
-       "incl	%1\n\t"
-       "decl	%3\n\t"
-       "je	3f\n\t"
-       "testb	%2,%2\n\t"
-       "jne	1b\n\t"
-       "2:\n\t"
-       "movb	%2,(%1)\n\t"
-       "incl	%1\n\t"
-       "decl	%3\n\t"
-       "jne	2b\n\t"
-       "3:"
-       : "=&r" (__src), "=&r" (__tmp), "=&q" (__dummy), "=&r" (__n)
-       : "0" (__src), "1" (__tmp), "3" (__n)
-       : "memory", "cc");
-
-  return __dest;
-}
-
-
-/* Append SRC onto DEST.  */
-# define _HAVE_STRING_ARCH_strcat 1
-# define strcat(dest, src) \
-  (__extension__ (__builtin_constant_p (src)				      \
-		  ? __strcat_c ((dest), (src), strlen (src) + 1)	      \
-		  : __strcat_g ((dest), (src))))
-
-__STRING_INLINE char *__strcat_c (char *__dest, const char __src[],
-				  size_t __srclen);
-
-__STRING_INLINE char *
-__strcat_c (char *__dest, const char __src[], size_t __srclen)
-{
-# ifdef __i686__
-  register unsigned long int __d0;
-  register char *__tmp;
-  __asm__ __volatile__
-    ("repne; scasb"
-     : "=D" (__tmp), "=&c" (__d0),
-       "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
-     : "0" (__dest), "1" (0xffffffff), "a" (0),
-       "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
-     : "cc");
-  --__tmp;
-# else
-  register char *__tmp = __dest;
-  __asm__ __volatile__
-    ("decl	%0\n\t"
-     "1:\n\t"
-     "incl	%0\n\t"
-     "cmpb	$0,(%0)\n\t"
-     "jne	1b\n"
-     : "=r" (__tmp),
-       "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
-     : "0" (__tmp),
-       "m" ( *(struct { __extension__ char __x[__srclen]; } *)__src)
-     : "cc");
-# endif
-  (void) memcpy (__tmp, __src, __srclen);
-  return __dest;
-}
-
-__STRING_INLINE char *__strcat_g (char *__dest, const char *__src);
-
-__STRING_INLINE char *
-__strcat_g (char *__dest, const char *__src)
-{
-  register char *__tmp = __dest;
-  register char __dummy;
-  __asm__ __volatile__
-    ("decl	%1\n\t"
-     "1:\n\t"
-     "incl	%1\n\t"
-     "cmpb	$0,(%1)\n\t"
-     "jne	1b\n"
-     "2:\n\t"
-     "movb	(%2),%b0\n\t"
-     "incl	%2\n\t"
-     "movb	%b0,(%1)\n\t"
-     "incl	%1\n\t"
-     "testb	%b0,%b0\n\t"
-     "jne	2b\n"
-     : "=&q" (__dummy), "=&r" (__tmp), "=&r" (__src),
-       "=m" ( *(struct { char __x[0xfffffff]; } *)__dest)
-     : "1"  (__tmp), "2"  (__src),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__src)
-     : "memory", "cc");
-  return __dest;
-}
-
-
-/* Append no more than N characters from SRC onto DEST.  */
-# define _HAVE_STRING_ARCH_strncat 1
-# define strncat(dest, src, n) \
-  (__extension__ ({ char *__dest = (dest);				      \
-		    __builtin_constant_p (src) && __builtin_constant_p (n)    \
-		    ? (strlen (src) < ((size_t) (n))			      \
-		       ? strcat (__dest, (src))				      \
-		       : (*(char *)__mempcpy (strchr (__dest, '\0'),	      \
-					       (const char *) (src),	      \
-					      (n)) = 0, __dest))	      \
-		    : __strncat_g (__dest, (src), (n)); }))
-
-__STRING_INLINE char *__strncat_g (char *__dest, const char __src[],
-				   size_t __n);
-
-__STRING_INLINE char *
-__strncat_g (char *__dest, const char __src[], size_t __n)
-{
-  register char *__tmp = __dest;
-  register char __dummy;
-# ifdef __i686__
-  __asm__ __volatile__
-    ("repne; scasb\n"
-     "movl %4, %3\n\t"
-     "decl %1\n\t"
-     "1:\n\t"
-     "subl	$1,%3\n\t"
-     "jc	2f\n\t"
-     "movb	(%2),%b0\n\t"
-     "movsb\n\t"
-     "testb	%b0,%b0\n\t"
-     "jne	1b\n\t"
-     "decl	%1\n"
-     "2:\n\t"
-     "movb	$0,(%1)"
-     : "=&a" (__dummy), "=&D" (__tmp), "=&S" (__src), "=&c" (__n)
-     :  "g" (__n), "0" (0), "1" (__tmp), "2" (__src), "3" (0xffffffff)
-     : "memory", "cc");
-# else
-  __asm__ __volatile__
-    ("1:\n\t"
-     "cmpb	$0,1(%1)\n\t"
-     "leal	1(%1),%1\n\t"
-     "jne	1b\n"
-     "2:\n\t"
-     "subl	$1,%3\n\t"
-     "jc	3f\n\t"
-     "movb	(%2),%b0\n\t"
-     "leal	1(%2),%2\n\t"
-     "movb	%b0,(%1)\n\t"
-     "leal	1(%1),%1\n\t"
-     "testb	%b0,%b0\n\t"
-     "jne	2b\n\t"
-     "decl	%1\n"
-     "3:\n\t"
-     "movb	$0,(%1)"
-     : "=&q" (__dummy), "=&r" (__tmp), "=&r" (__src), "=&r" (__n)
-     : "1" ((unsigned long) __tmp - 1), "2" (__src), "3" (__n)
-     : "memory", "cc");
-#endif
-  return __dest;
-}
-
-
-/* Compare S1 and S2.  */
-# define _HAVE_STRING_ARCH_strcmp 1
-# define strcmp(s1, s2) \
-  (__extension__ (__builtin_constant_p (s1) && __builtin_constant_p (s2)      \
-		  && (sizeof ((s1)[0]) != 1 || strlen (s1) >= 4)	      \
-		  && (sizeof ((s2)[0]) != 1 || strlen (s2) >= 4)	      \
-		  ? memcmp ((const char *) (s1), (const char *) (s2),	      \
-			    (strlen (s1) < strlen (s2)			      \
-			     ? strlen (s1) : strlen (s2)) + 1)		      \
-		  : (__builtin_constant_p (s1) && sizeof ((s1)[0]) == 1	      \
-		     && sizeof ((s2)[0]) == 1 && strlen (s1) < 4	      \
-		     ? (__builtin_constant_p (s2) && sizeof ((s2)[0]) == 1    \
-			? __strcmp_cc ((const unsigned char *) (s1),	      \
-				       (const unsigned char *) (s2),	      \
-				       strlen (s1))			      \
-			: __strcmp_cg ((const unsigned char *) (s1),	      \
-				       (const unsigned char *) (s2),	      \
-				       strlen (s1)))			      \
-		     : (__builtin_constant_p (s2) && sizeof ((s1)[0]) == 1    \
-			&& sizeof ((s2)[0]) == 1 && strlen (s2) < 4	      \
-			? (__builtin_constant_p (s1)			      \
-			   ? __strcmp_cc ((const unsigned char *) (s1),	      \
-					  (const unsigned char *) (s2),	      \
-					  strlen (s2))			      \
-			   : __strcmp_gc ((const unsigned char *) (s1),	      \
-					  (const unsigned char *) (s2),	      \
-					  strlen (s2)))			      \
-			: __strcmp_gg ((s1), (s2))))))
-
-# define __strcmp_cc(s1, s2, l) \
-  (__extension__ ({ register int __result = (s1)[0] - (s2)[0];		      \
-		    if (l > 0 && __result == 0)				      \
-		      {							      \
-			__result = (s1)[1] - (s2)[1];			      \
-			if (l > 1 && __result == 0)			      \
-			  {						      \
-			    __result = (s1)[2] - (s2)[2];		      \
-			    if (l > 2 && __result == 0)			      \
-			      __result = (s1)[3] - (s2)[3];		      \
-			  }						      \
-		      }							      \
-		    __result; }))
-
-# define __strcmp_cg(s1, s2, l1) \
-  (__extension__ ({ const unsigned char *__s2 = (s2);			      \
-		    register int __result = (s1)[0] - __s2[0];		      \
-		    if (l1 > 0 && __result == 0)			      \
-		      {							      \
-			__result = (s1)[1] - __s2[1];			      \
-			if (l1 > 1 && __result == 0)			      \
-			  {						      \
-			    __result = (s1)[2] - __s2[2];		      \
-			    if (l1 > 2 && __result == 0)		      \
-			      __result = (s1)[3] - __s2[3];		      \
-			  }						      \
-		      }							      \
-		    __result; }))
-
-# define __strcmp_gc(s1, s2, l2) \
-  (__extension__ ({ const unsigned char *__s1 = (s1);			      \
-		    register int __result = __s1[0] - (s2)[0];		      \
-		    if (l2 > 0 && __result == 0)			      \
-		      {							      \
-			__result = __s1[1] - (s2)[1];			      \
-			if (l2 > 1 && __result == 0)			      \
-			  {						      \
-			    __result = __s1[2] - (s2)[2];		      \
-			    if (l2 > 2 && __result == 0)		      \
-			      __result = __s1[3] - (s2)[3];		      \
-			  }						      \
-		      }							      \
-		    __result; }))
-
-__STRING_INLINE int __strcmp_gg (const char *__s1, const char *__s2);
-
-__STRING_INLINE int
-__strcmp_gg (const char *__s1, const char *__s2)
-{
-  register int __res;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movb	(%1),%b0\n\t"
-     "leal	1(%1),%1\n\t"
-     "cmpb	%b0,(%2)\n\t"
-     "jne	2f\n\t"
-     "leal	1(%2),%2\n\t"
-     "testb	%b0,%b0\n\t"
-     "jne	1b\n\t"
-     "xorl	%0,%0\n\t"
-     "jmp	3f\n"
-     "2:\n\t"
-     "movl	$1,%0\n\t"
-     "jb	3f\n\t"
-     "negl	%0\n"
-     "3:"
-     : "=q" (__res), "=&r" (__s1), "=&r" (__s2)
-     : "1" (__s1), "2" (__s2),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s1),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s2)
-     : "cc");
-  return __res;
-}
-
-
-/* Compare N characters of S1 and S2.  */
-# define _HAVE_STRING_ARCH_strncmp 1
-# define strncmp(s1, s2, n) \
-  (__extension__ (__builtin_constant_p (s1) && strlen (s1) < ((size_t) (n))   \
-		  ? strcmp ((s1), (s2))					      \
-		  : (__builtin_constant_p (s2) && strlen (s2) < ((size_t) (n))\
-		     ? strcmp ((s1), (s2))				      \
-		     : __strncmp_g ((s1), (s2), (n)))))
-
-__STRING_INLINE int __strncmp_g (const char *__s1, const char *__s2,
-				 size_t __n);
-
-__STRING_INLINE int
-__strncmp_g (const char *__s1, const char *__s2, size_t __n)
-{
-  register int __res;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "subl	$1,%3\n\t"
-     "jc	2f\n\t"
-     "movb	(%1),%b0\n\t"
-     "incl	%1\n\t"
-     "cmpb	%b0,(%2)\n\t"
-     "jne	3f\n\t"
-     "incl	%2\n\t"
-     "testb	%b0,%b0\n\t"
-     "jne	1b\n"
-     "2:\n\t"
-     "xorl	%0,%0\n\t"
-     "jmp	4f\n"
-     "3:\n\t"
-     "movl	$1,%0\n\t"
-     "jb	4f\n\t"
-     "negl	%0\n"
-     "4:"
-     : "=q" (__res), "=&r" (__s1), "=&r" (__s2), "=&r" (__n)
-     : "1"  (__s1), "2"  (__s2),  "3" (__n),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__s1),
-       "m" ( *(struct { __extension__ char __x[__n]; } *)__s2)
-     : "cc");
-  return __res;
-}
-
-
-/* Find the first occurrence of C in S.  */
-# define _HAVE_STRING_ARCH_strchr 1
-# define _USE_STRING_ARCH_strchr 1
-# define strchr(s, c) \
-  (__extension__ (__builtin_constant_p (c)				      \
-		  ? ((c) == '\0'					      \
-		     ? (char *) __rawmemchr ((s), (c))			      \
-		     : __strchr_c ((s), ((c) & 0xff) << 8))		      \
-		  : __strchr_g ((s), (c))))
-
-__STRING_INLINE char *__strchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchr_c (const char *__s, int __c)
-{
-  register unsigned long int __d0;
-  register char *__res;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movb	(%0),%%al\n\t"
-     "cmpb	%%ah,%%al\n\t"
-     "je	2f\n\t"
-     "leal	1(%0),%0\n\t"
-     "testb	%%al,%%al\n\t"
-     "jne	1b\n\t"
-     "xorl	%0,%0\n"
-     "2:"
-     : "=r" (__res), "=&a" (__d0)
-     : "0" (__s), "1" (__c),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res;
-}
-
-__STRING_INLINE char *__strchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchr_g (const char *__s, int __c)
-{
-  register unsigned long int __d0;
-  register char *__res;
-  __asm__ __volatile__
-    ("movb	%%al,%%ah\n"
-     "1:\n\t"
-     "movb	(%0),%%al\n\t"
-     "cmpb	%%ah,%%al\n\t"
-     "je	2f\n\t"
-     "leal	1(%0),%0\n\t"
-     "testb	%%al,%%al\n\t"
-     "jne	1b\n\t"
-     "xorl	%0,%0\n"
-     "2:"
-     : "=r" (__res), "=&a" (__d0)
-     : "0" (__s), "1" (__c),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res;
-}
-
-
-/* Find the first occurrence of C in S or the final NUL byte.  */
-# define _HAVE_STRING_ARCH_strchrnul 1
-# define __strchrnul(s, c) \
-  (__extension__ (__builtin_constant_p (c)				      \
-		  ? ((c) == '\0'					      \
-		     ? (char *) __rawmemchr ((s), c)			      \
-		     : __strchrnul_c ((s), ((c) & 0xff) << 8))		      \
-		  : __strchrnul_g ((s), c)))
-
-__STRING_INLINE char *__strchrnul_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchrnul_c (const char *__s, int __c)
-{
-  register unsigned long int __d0;
-  register char *__res;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movb	(%0),%%al\n\t"
-     "cmpb	%%ah,%%al\n\t"
-     "je	2f\n\t"
-     "leal	1(%0),%0\n\t"
-     "testb	%%al,%%al\n\t"
-     "jne	1b\n\t"
-     "decl	%0\n"
-     "2:"
-     : "=r" (__res), "=&a" (__d0)
-     : "0" (__s), "1" (__c),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res;
-}
-
-__STRING_INLINE char *__strchrnul_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strchrnul_g (const char *__s, int __c)
-{
-  register unsigned long int __d0;
-  register char *__res;
-  __asm__ __volatile__
-    ("movb	%%al,%%ah\n"
-     "1:\n\t"
-     "movb	(%0),%%al\n\t"
-     "cmpb	%%ah,%%al\n\t"
-     "je	2f\n\t"
-     "leal	1(%0),%0\n\t"
-     "testb	%%al,%%al\n\t"
-     "jne	1b\n\t"
-     "decl	%0\n"
-     "2:"
-     : "=r" (__res), "=&a" (__d0)
-     : "0" (__s), "1" (__c),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res;
-}
-# ifdef __USE_GNU
-#  define strchrnul(s, c) __strchrnul ((s), (c))
-# endif
-
-
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-/* Find the first occurrence of C in S.  This is the BSD name.  */
-#  define _HAVE_STRING_ARCH_index 1
-#  define index(s, c) \
-  (__extension__ (__builtin_constant_p (c)				      \
-		  ? __strchr_c ((s), ((c) & 0xff) << 8)			      \
-		  : __strchr_g ((s), (c))))
-# endif
-
-
-/* Find the last occurrence of C in S.  */
-# define _HAVE_STRING_ARCH_strrchr 1
-# define strrchr(s, c) \
-  (__extension__ (__builtin_constant_p (c)				      \
-		  ? __strrchr_c ((s), ((c) & 0xff) << 8)		      \
-		  : __strrchr_g ((s), (c))))
-
-# ifdef __i686__
-__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_c (const char *__s, int __c)
-{
-  register unsigned long int __d0, __d1;
-  register char *__res;
-  __asm__ __volatile__
-    ("cld\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "cmpb	%h2,%b2\n\t"
-     "cmove	%1,%0\n\t"
-     "testb	%b2,%b2\n\t"
-     "jne 1b"
-     : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
-     : "0" (1), "1" (__s), "2" (__c),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res - 1;
-}
-
-__STRING_INLINE char *__strrchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_g (const char *__s, int __c)
-{
-  register unsigned long int __d0, __d1;
-  register char *__res;
-  __asm__ __volatile__
-    ("movb	%b2,%h2\n"
-     "cld\n\t"
-     "1:\n\t"
-     "lodsb\n\t"
-     "cmpb	%h2,%b2\n\t"
-     "cmove	%1,%0\n\t"
-     "testb	%b2,%b2\n\t"
-     "jne 1b"
-     : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
-     : "0" (1), "1" (__s), "2" (__c),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res - 1;
-}
-# else
-__STRING_INLINE char *__strrchr_c (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_c (const char *__s, int __c)
-{
-  register unsigned long int __d0, __d1;
-  register char *__res;
-  __asm__ __volatile__
-    ("cld\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "cmpb	%%ah,%%al\n\t"
-     "jne	2f\n\t"
-     "leal	-1(%%esi),%0\n"
-     "2:\n\t"
-     "testb	%%al,%%al\n\t"
-     "jne 1b"
-     : "=d" (__res), "=&S" (__d0), "=&a" (__d1)
-     : "0" (0), "1" (__s), "2" (__c),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res;
-}
-
-__STRING_INLINE char *__strrchr_g (const char *__s, int __c);
-
-__STRING_INLINE char *
-__strrchr_g (const char *__s, int __c)
-{
-  register unsigned long int __d0, __d1;
-  register char *__res;
-  __asm__ __volatile__
-    ("movb	%%al,%%ah\n"
-     "cld\n\t"
-     "1:\n\t"
-     "lodsb\n\t"
-     "cmpb	%%ah,%%al\n\t"
-     "jne	2f\n\t"
-     "leal	-1(%%esi),%0\n"
-     "2:\n\t"
-     "testb	%%al,%%al\n\t"
-     "jne 1b"
-     : "=r" (__res), "=&S" (__d0), "=&a" (__d1)
-     : "0" (0), "1" (__s), "2" (__c),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return __res;
-}
-# endif
-
-
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-/* Find the last occurrence of C in S.  This is the BSD name.  */
-#  define _HAVE_STRING_ARCH_rindex 1
-#  define rindex(s, c) \
-  (__extension__ (__builtin_constant_p (c)				      \
-		  ? __strrchr_c ((s), ((c) & 0xff) << 8)		      \
-		  : __strrchr_g ((s), (c))))
-# endif
-
-
-/* Return the length of the initial segment of S which
-   consists entirely of characters not in REJECT.  */
-# define _HAVE_STRING_ARCH_strcspn 1
-# define strcspn(s, reject) \
-  (__extension__ (__builtin_constant_p (reject) && sizeof ((reject)[0]) == 1  \
-		  ? ((reject)[0] == '\0'				      \
-		     ? strlen (s)					      \
-		     : ((reject)[1] == '\0'				      \
-			? __strcspn_c1 ((s), (((reject)[0] << 8) & 0xff00))   \
-			: __strcspn_cg ((s), (reject), strlen (reject))))     \
-		  : __strcspn_g ((s), (reject))))
-
-__STRING_INLINE size_t __strcspn_c1 (const char *__s, int __reject);
-
-# ifndef _FORCE_INLINES
-__STRING_INLINE size_t
-__strcspn_c1 (const char *__s, int __reject)
-{
-  register unsigned long int __d0;
-  register char *__res;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movb	(%0),%%al\n\t"
-     "leal	1(%0),%0\n\t"
-     "cmpb	%%ah,%%al\n\t"
-     "je	2f\n\t"
-     "testb	%%al,%%al\n\t"
-     "jne	1b\n"
-     "2:"
-     : "=r" (__res), "=&a" (__d0)
-     : "0" (__s), "1" (__reject),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return (__res - 1) - __s;
-}
-# endif
-
-__STRING_INLINE size_t __strcspn_cg (const char *__s, const char __reject[],
-				     size_t __reject_len);
-
-__STRING_INLINE size_t
-__strcspn_cg (const char *__s, const char __reject[], size_t __reject_len)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register const char *__res;
-  __asm__ __volatile__
-    ("cld\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%5,%%edi\n\t"
-     "movl	%6,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "jne	1b\n"
-     "2:"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
-     : "0" (__s), "d" (__reject), "g" (__reject_len)
-     : "memory", "cc");
-  return (__res - 1) - __s;
-}
-
-__STRING_INLINE size_t __strcspn_g (const char *__s, const char *__reject);
-# ifdef __PIC__
-
-__STRING_INLINE size_t
-__strcspn_g (const char *__s, const char *__reject)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register const char *__res;
-  __asm__ __volatile__
-    ("pushl	%%ebx\n\t"
-     "movl	%4,%%edi\n\t"
-     "cld\n\t"
-     "repne; scasb\n\t"
-     "notl	%%ecx\n\t"
-     "leal	-1(%%ecx),%%ebx\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%4,%%edi\n\t"
-     "movl	%%ebx,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "jne	1b\n"
-     "2:\n\t"
-     "popl	%%ebx"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
-     : "r" (__reject), "0" (__s), "1" (0), "2" (0xffffffff)
-     : "memory", "cc");
-  return (__res - 1) - __s;
-}
-# else
-__STRING_INLINE size_t
-__strcspn_g (const char *__s, const char *__reject)
-{
-  register unsigned long int __d0, __d1, __d2, __d3;
-  register const char *__res;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "repne; scasb\n\t"
-     "notl	%%ecx\n\t"
-     "leal	-1(%%ecx),%%edx\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%%ebx,%%edi\n\t"
-     "movl	%%edx,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "jne	1b\n"
-     "2:"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2), "=&d" (__d3)
-     : "0" (__s), "1" (0), "2" (0xffffffff), "3" (__reject), "b" (__reject)
-     /* Clobber memory, otherwise GCC cannot handle this.  */
-     : "memory", "cc");
-  return (__res - 1) - __s;
-}
-# endif
-
-
-/* Return the length of the initial segment of S which
-   consists entirely of characters in ACCEPT.  */
-# define _HAVE_STRING_ARCH_strspn 1
-# define strspn(s, accept) \
-  (__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1  \
-		  ? ((accept)[0] == '\0'				      \
-		     ? ((void) (s), 0)					      \
-		     : ((accept)[1] == '\0'				      \
-			? __strspn_c1 ((s), (((accept)[0] << 8 ) & 0xff00))   \
-			: __strspn_cg ((s), (accept), strlen (accept))))      \
-		  : __strspn_g ((s), (accept))))
-
-# ifndef _FORCE_INLINES
-__STRING_INLINE size_t __strspn_c1 (const char *__s, int __accept);
-
-__STRING_INLINE size_t
-__strspn_c1 (const char *__s, int __accept)
-{
-  register unsigned long int __d0;
-  register char *__res;
-  /* Please note that __accept never can be '\0'.  */
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movb	(%0),%b1\n\t"
-     "leal	1(%0),%0\n\t"
-     "cmpb	%h1,%b1\n\t"
-     "je	1b"
-     : "=r" (__res), "=&q" (__d0)
-     : "0" (__s), "1" (__accept),
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s)
-     : "cc");
-  return (__res - 1) - __s;
-}
-# endif
-
-__STRING_INLINE size_t __strspn_cg (const char *__s, const char __accept[],
-				    size_t __accept_len);
-
-__STRING_INLINE size_t
-__strspn_cg (const char *__s, const char __accept[], size_t __accept_len)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register const char *__res;
-  __asm__ __volatile__
-    ("cld\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%5,%%edi\n\t"
-     "movl	%6,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "je	1b\n"
-     "2:"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
-     : "0" (__s), "g" (__accept), "g" (__accept_len),
-       /* Since we do not know how large the memory we access it, use a
-	  really large amount.  */
-       "m" ( *(struct { char __x[0xfffffff]; } *)__s),
-       "m" ( *(struct { __extension__ char __x[__accept_len]; } *)__accept)
-     : "cc");
-  return (__res - 1) - __s;
-}
-
-__STRING_INLINE size_t __strspn_g (const char *__s, const char *__accept);
-# ifdef __PIC__
-
-__STRING_INLINE size_t
-__strspn_g (const char *__s, const char *__accept)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register const char *__res;
-  __asm__ __volatile__
-    ("pushl	%%ebx\n\t"
-     "cld\n\t"
-     "repne; scasb\n\t"
-     "notl	%%ecx\n\t"
-     "leal	-1(%%ecx),%%ebx\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%%edx,%%edi\n\t"
-     "movl	%%ebx,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "je	1b\n"
-     "2:\n\t"
-     "popl	%%ebx"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
-     : "d" (__accept), "0" (__s), "1" (0), "2" (0xffffffff), "3" (__accept)
-     : "memory", "cc");
-  return (__res - 1) - __s;
-}
-# else
-__STRING_INLINE size_t
-__strspn_g (const char *__s, const char *__accept)
-{
-  register unsigned long int __d0, __d1, __d2, __d3;
-  register const char *__res;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "repne; scasb\n\t"
-     "notl	%%ecx\n\t"
-     "leal	-1(%%ecx),%%edx\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%%ebx,%%edi\n\t"
-     "movl	%%edx,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "je	1b\n"
-     "2:"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2), "=&d" (__d3)
-     : "0" (__s), "1" (0), "2" (0xffffffff), "3" (__accept), "b" (__accept)
-     : "memory", "cc");
-  return (__res - 1) - __s;
-}
-# endif
-
-
-/* Find the first occurrence in S of any character in ACCEPT.  */
-# define _HAVE_STRING_ARCH_strpbrk 1
-# define strpbrk(s, accept) \
-  (__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1  \
-		  ? ((accept)[0] == '\0'				      \
-		     ? ((void) (s), (char *) 0)				      \
-		     : ((accept)[1] == '\0'				      \
-			? strchr ((s), (accept)[0])			      \
-			: __strpbrk_cg ((s), (accept), strlen (accept))))     \
-		  : __strpbrk_g ((s), (accept))))
-
-__STRING_INLINE char *__strpbrk_cg (const char *__s, const char __accept[],
-				    size_t __accept_len);
-
-__STRING_INLINE char *
-__strpbrk_cg (const char *__s, const char __accept[], size_t __accept_len)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register char *__res;
-  __asm__ __volatile__
-    ("cld\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%5,%%edi\n\t"
-     "movl	%6,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "jne	1b\n\t"
-     "decl	%0\n\t"
-     "jmp	3f\n"
-     "2:\n\t"
-     "xorl	%0,%0\n"
-     "3:"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
-     : "0" (__s), "d" (__accept), "g" (__accept_len)
-     : "memory", "cc");
-  return __res;
-}
-
-__STRING_INLINE char *__strpbrk_g (const char *__s, const char *__accept);
-# ifdef __PIC__
-
-__STRING_INLINE char *
-__strpbrk_g (const char *__s, const char *__accept)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register char *__res;
-  __asm__ __volatile__
-    ("pushl	%%ebx\n\t"
-     "movl	%%edx,%%edi\n\t"
-     "cld\n\t"
-     "repne; scasb\n\t"
-     "notl	%%ecx\n\t"
-     "leal	-1(%%ecx),%%ebx\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%%edx,%%edi\n\t"
-     "movl	%%ebx,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "jne	1b\n\t"
-     "decl	%0\n\t"
-     "jmp	3f\n"
-     "2:\n\t"
-     "xorl	%0,%0\n"
-     "3:\n\t"
-     "popl	%%ebx"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&D" (__d2)
-     : "d" (__accept), "0" (__s), "1" (0), "2" (0xffffffff)
-     : "memory", "cc");
-  return __res;
-}
-# else
-__STRING_INLINE char *
-__strpbrk_g (const char *__s, const char *__accept)
-{
-  register unsigned long int __d0, __d1, __d2, __d3;
-  register char *__res;
-  __asm__ __volatile__
-    ("movl	%%ebx,%%edi\n\t"
-     "cld\n\t"
-     "repne; scasb\n\t"
-     "notl	%%ecx\n\t"
-     "leal	-1(%%ecx),%%edx\n"
-     "1:\n\t"
-     "lodsb\n\t"
-     "testb	%%al,%%al\n\t"
-     "je	2f\n\t"
-     "movl	%%ebx,%%edi\n\t"
-     "movl	%%edx,%%ecx\n\t"
-     "repne; scasb\n\t"
-     "jne	1b\n\t"
-     "decl	%0\n\t"
-     "jmp	3f\n"
-     "2:\n\t"
-     "xorl	%0,%0\n"
-     "3:"
-     : "=S" (__res), "=&a" (__d0), "=&c" (__d1), "=&d" (__d2), "=&D" (__d3)
-     : "0" (__s), "1" (0), "2" (0xffffffff), "b" (__accept)
-     : "memory", "cc");
-  return __res;
-}
-# endif
-
-
-/* Find the first occurrence of NEEDLE in HAYSTACK.  */
-# define _HAVE_STRING_ARCH_strstr 1
-# define strstr(haystack, needle) \
-  (__extension__ (__builtin_constant_p (needle) && sizeof ((needle)[0]) == 1  \
-		  ? ((needle)[0] == '\0'				      \
-		     ? (haystack)					      \
-		     : ((needle)[1] == '\0'				      \
-			? strchr ((haystack), (needle)[0])		      \
-			: __strstr_cg ((haystack), (needle),		      \
-				       strlen (needle))))		      \
-		  : __strstr_g ((haystack), (needle))))
-
-/* Please note that this function need not handle NEEDLEs with a
-   length shorter than two.  */
-__STRING_INLINE char *__strstr_cg (const char *__haystack,
-				   const char __needle[],
-				   size_t __needle_len);
-
-__STRING_INLINE char *
-__strstr_cg (const char *__haystack, const char __needle[],
-	     size_t __needle_len)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register char *__res;
-  __asm__ __volatile__
-    ("cld\n" \
-     "1:\n\t"
-     "movl	%6,%%edi\n\t"
-     "movl	%5,%%eax\n\t"
-     "movl	%4,%%ecx\n\t"
-     "repe; cmpsb\n\t"
-     "je	2f\n\t"
-     "cmpb	$0,-1(%%esi)\n\t"
-     "leal	1(%%eax),%5\n\t"
-     "jne	1b\n\t"
-     "xorl	%%eax,%%eax\n"
-     "2:"
-     : "=&a" (__res), "=&S" (__d0), "=&D" (__d1), "=&c" (__d2)
-     : "g" (__needle_len), "1" (__haystack), "d" (__needle)
-     : "memory", "cc");
-  return __res;
-}
-
-__STRING_INLINE char *__strstr_g (const char *__haystack,
-				  const char *__needle);
-# ifdef __PIC__
-
-__STRING_INLINE char *
-__strstr_g (const char *__haystack, const char *__needle)
-{
-  register unsigned long int __d0, __d1, __d2;
-  register char *__res;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "repne; scasb\n\t"
-     "notl	%%ecx\n\t"
-     "pushl	%%ebx\n\t"
-     "decl	%%ecx\n\t"	/* NOTE! This also sets Z if searchstring='' */
-     "movl	%%ecx,%%ebx\n"
-     "1:\n\t"
-     "movl	%%edx,%%edi\n\t"
-     "movl	%%esi,%%eax\n\t"
-     "movl	%%ebx,%%ecx\n\t"
-     "repe; cmpsb\n\t"
-     "je	2f\n\t"		/* also works for empty string, see above */
-     "cmpb	$0,-1(%%esi)\n\t"
-     "leal	1(%%eax),%%esi\n\t"
-     "jne	1b\n\t"
-     "xorl	%%eax,%%eax\n"
-     "2:\n\t"
-     "popl	%%ebx"
-     : "=&a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
-     : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
-       "d" (__needle)
-     : "memory", "cc");
-  return __res;
-}
-# else
-__STRING_INLINE char *
-__strstr_g (const char *__haystack, const char *__needle)
-{
-  register unsigned long int __d0, __d1, __d2, __d3;
-  register char *__res;
-  __asm__ __volatile__
-    ("cld\n\t"
-     "repne; scasb\n\t"
-     "notl	%%ecx\n\t"
-     "decl	%%ecx\n\t"	/* NOTE! This also sets Z if searchstring='' */
-     "movl	%%ecx,%%edx\n"
-     "1:\n\t"
-     "movl	%%ebx,%%edi\n\t"
-     "movl	%%esi,%%eax\n\t"
-     "movl	%%edx,%%ecx\n\t"
-     "repe; cmpsb\n\t"
-     "je	2f\n\t"		/* also works for empty string, see above */
-     "cmpb	$0,-1(%%esi)\n\t"
-     "leal	1(%%eax),%%esi\n\t"
-     "jne	1b\n\t"
-     "xorl	%%eax,%%eax\n"
-     "2:"
-     : "=&a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2), "=&d" (__d3)
-     : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
-       "b" (__needle)
-     : "memory", "cc");
-  return __res;
-}
-# endif
-
-
-/* Bit find functions.  We define only the i686 version since for the other
-   processors gcc generates good code.  */
-# if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
-#  ifdef __i686__
-#   define _HAVE_STRING_ARCH_ffs 1
-#   define ffs(word) (__builtin_constant_p (word)			      \
-		      ? __builtin_ffs (word)				      \
-		      : ({ int __cnt, __tmp;				      \
-			   __asm__ __volatile__				      \
-			     ("bsfl %2,%0\n\t"				      \
-			      "cmovel %1,%0"				      \
-			      : "=&r" (__cnt), "=r" (__tmp)		      \
-			      : "rm" (word), "1" (-1));			      \
-			   __cnt + 1; }))
-
-#   ifndef ffsl
-#    define ffsl(word) ffs(word)
-#   endif
-#  endif /* i686 */
-# endif	/* Misc || X/Open */
-
-# ifndef _FORCE_INLINES
-#  undef __STRING_INLINE
-# endif
-
-# endif	/* use string inlines && GNU CC */
-
-#endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=48bf3919141339a08d65edc02984fb56105552fa

commit 48bf3919141339a08d65edc02984fb56105552fa
Author: Zack Weinberg <zackw@panix.com>
Date:   Wed Nov 16 19:54:53 2016 -0500

    For experimental purposes, remove bits/string2.h.
    
    	* string/bits/string2.h: Delete file.
    	* include/bits/string2.h: Delete file.
    	* string/string.h: Don't include bits/string2.h.
    	Remove inline optimization for mempcpy.
            * string/Makefile (headers): Remove bits/string2.h.
    	* include/string.h: Forward __bzero and __stpcpy to __builtin
    	versions here.
    	* string/string-inlines.c: Define __strtok_r_1c, __strsep_1c,
    	__strsep_2c, and __strsep_3c as compat symbols.
    
    	* elf/dl-cache.c, inet/rcmd.c, inet/rexec.c, intl/dcigettext.c
    	* intl/finddomain.c, locale/loadarchive.c, locale/setlocale.c
    	* posix/spawn_faction_addopen.c, stdlib/putenv.c
    	* sunrpc/svc_simple.c, sysdeps/posix/getaddrinfo.c:
    	Use __strdup instead of strdup.
    	* sysdeps/unix/sysv/linux/internal_statvfs.c:
    	Use __strsep instead of strsep.

diff --git a/elf/dl-cache.c b/elf/dl-cache.c
index cfa335e..4c8afd0 100644
--- a/elf/dl-cache.c
+++ b/elf/dl-cache.c
@@ -302,7 +302,7 @@ _dl_load_cache_lookup (const char *name)
   char *temp;
   temp = alloca (strlen (best) + 1);
   strcpy (temp, best);
-  return strdup (temp);
+  return __strdup (temp);
 }
 
 #ifndef MAP_COPY
diff --git a/include/bits/string2.h b/include/bits/string2.h
deleted file mode 100644
index e4c4c70..0000000
--- a/include/bits/string2.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <string/bits/string2.h>
diff --git a/include/string.h b/include/string.h
index 749e691..b99c90e 100644
--- a/include/string.h
+++ b/include/string.h
@@ -42,6 +42,7 @@ extern void *__memchr (const void *__s, int __c, size_t __n)
      __attribute_pure__;
 
 extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+#define __bzero(s, n) __builtin_memset (s, '\0', n)
 
 extern int __ffs (int __i) __attribute__ ((const));
 
@@ -77,6 +78,7 @@ extern __typeof (strncasecmp_l) __strncasecmp_l;
 
 libc_hidden_proto (__mempcpy)
 libc_hidden_proto (__stpcpy)
+#define __stpcpy(dest, src) __builtin_stpcpy (dest, src)
 libc_hidden_proto (__stpncpy)
 libc_hidden_proto (__rawmemchr)
 libc_hidden_proto (__strcasecmp)
diff --git a/inet/rcmd.c b/inet/rcmd.c
index 8613d96..b7cc7a8 100644
--- a/inet/rcmd.c
+++ b/inet/rcmd.c
@@ -149,7 +149,7 @@ rcmd_af (char **ahost, u_short rport, const char *locuser, const char *remuser,
 
 	if (res->ai_canonname){
 		free (ahostbuf);
-		ahostbuf = strdup (res->ai_canonname);
+		ahostbuf = __strdup (res->ai_canonname);
 		if (ahostbuf == NULL) {
 			__fxprintf(NULL, "%s",
 				   _("rcmd: Cannot allocate memory\n"));
diff --git a/inet/rexec.c b/inet/rexec.c
index 24ac4b1..43fb67b 100644
--- a/inet/rexec.c
+++ b/inet/rexec.c
@@ -73,7 +73,7 @@ rexec_af (char **ahost, int rport, const char *name, const char *pass,
 
 	if (res0->ai_canonname){
 		free (ahostbuf);
-		ahostbuf = strdup (res0->ai_canonname);
+		ahostbuf = __strdup (res0->ai_canonname);
 		if (ahostbuf == NULL) {
 			perror ("rexec: strdup");
 			return (-1);
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index dd0db4e..a3babf9 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -1072,7 +1072,7 @@ _nl_find_msg (struct loaded_l10nfile *domain_file,
 	    domain->conversions = new_conversions;
 
 	    /* Copy the 'encoding' string to permanent storage.  */
-	    encoding = strdup (encoding);
+	    encoding = __strdup (encoding);
 	    if (__builtin_expect (encoding == NULL, 0))
 	      /* Nothing we can do, no more memory.  We cannot use the
 		 translation because it might be encoded incorrectly.  */
diff --git a/intl/finddomain.c b/intl/finddomain.c
index 2c3348a..9ef396a 100644
--- a/intl/finddomain.c
+++ b/intl/finddomain.c
@@ -125,7 +125,7 @@ _nl_find_domain (const char *dirname, char *locale,
   if (alias_value != NULL)
     {
 #if defined _LIBC || defined HAVE_STRDUP
-      locale = strdup (alias_value);
+      locale = __strdup (alias_value);
       if (locale == NULL)
 	return NULL;
 #else
diff --git a/locale/loadarchive.c b/locale/loadarchive.c
index 0ac11af..6c785c9 100644
--- a/locale/loadarchive.c
+++ b/locale/loadarchive.c
@@ -462,7 +462,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
   if (__glibc_unlikely (lia == NULL))
     return NULL;
 
-  lia->name = strdup (*namep);
+  lia->name = __strdup (*namep);
   if (__glibc_unlikely (lia->name == NULL))
     {
       free (lia);
diff --git a/locale/setlocale.c b/locale/setlocale.c
index 69b3141..1c0c7fc 100644
--- a/locale/setlocale.c
+++ b/locale/setlocale.c
@@ -283,7 +283,7 @@ setlocale (int category, const char *locale)
       if (__glibc_unlikely (strchr (locale, ';') != NULL))
 	{
 	  /* This is a composite name.  Make a copy and split it up.  */
-	  locale_copy = strdup (locale);
+	  locale_copy = __strdup (locale);
 	  if (__glibc_unlikely (locale_copy == NULL))
 	    {
 	      __libc_rwlock_unlock (__libc_setlocale_lock);
diff --git a/posix/spawn_faction_addopen.c b/posix/spawn_faction_addopen.c
index 4f37d0b..6f8d349 100644
--- a/posix/spawn_faction_addopen.c
+++ b/posix/spawn_faction_addopen.c
@@ -34,7 +34,7 @@ posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *file_actions,
   if (!__spawn_valid_fd (fd))
     return EBADF;
 
-  char *path_copy = strdup (path);
+  char *path_copy = __strdup (path);
   if (path_copy == NULL)
     return ENOMEM;
 
diff --git a/stdlib/putenv.c b/stdlib/putenv.c
index 71b9ab1..c7a0a44 100644
--- a/stdlib/putenv.c
+++ b/stdlib/putenv.c
@@ -60,7 +60,7 @@ putenv (char *string)
       int use_malloc = !__libc_use_alloca (name_end - string + 1);
       if (__builtin_expect (use_malloc, 0))
 	{
-	  name = strndup (string, name_end - string);
+	  name = __strndup (string, name_end - string);
 	  if (name == NULL)
 	    return -1;
 	}
diff --git a/string/Makefile b/string/Makefile
index c009872..4bb939d 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -24,7 +24,7 @@ include ../Makeconfig
 
 headers	:= string.h strings.h memory.h endian.h bits/endian.h \
 	   argz.h envz.h byteswap.h bits/byteswap.h bits/byteswap-16.h \
-	   bits/string.h bits/string2.h bits/string3.h \
+	   bits/string.h bits/string3.h \
 	   bits/const-covariance.h
 
 routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
diff --git a/string/Versions b/string/Versions
index 475c1fd..0bf3ccb 100644
--- a/string/Versions
+++ b/string/Versions
@@ -57,7 +57,7 @@ libc {
     strcasestr; strverscmp;
   }
   GLIBC_2.1.1 {
-    # extern inline functions used by <bits/string2.h>
+    # extern inline functions formerly used in string.h
     __mempcpy_small; __stpcpy_small; __strcspn_c1; __strcspn_c2; __strcspn_c3;
     __strcpy_small; __strspn_c1; __strspn_c2; __strspn_c3; __strpbrk_c2;
     __strpbrk_c3; __strsep_1c; __strsep_2c; __strsep_3c; __strsep_g;
diff --git a/string/bits/string2.h b/string/bits/string2.h
deleted file mode 100644
index ca1eda9..0000000
--- a/string/bits/string2.h
+++ /dev/null
@@ -1,375 +0,0 @@
-/* Machine-independant string function optimizations.
-   Copyright (C) 1997-2016 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#ifndef _STRING_H
-# error "Never use <bits/string2.h> directly; include <string.h> instead."
-#endif
-
-#ifndef __NO_STRING_INLINES
-
-/* Unlike the definitions in the header <bits/string.h> the
-   definitions contained here are not optimized down to assembler
-   level.  Those optimizations are not always a good idea since this
-   means the code size increases a lot.  Instead the definitions here
-   optimize some functions in a way which do not dramatically
-   increase the code size and which do not use assembler.  The main
-   trick is to use GCC's `__builtin_constant_p' function.
-
-   Every function XXX which has a defined version in
-   <bits/string.h> must be accompanied by a symbol _HAVE_STRING_ARCH_XXX
-   to make sure we don't get redefinitions.
-
-   We must use here macros instead of inline functions since the
-   trick won't work with the latter.  */
-
-#ifndef __STRING_INLINE
-# ifdef __cplusplus
-#  define __STRING_INLINE inline
-# else
-#  define __STRING_INLINE __extern_inline
-# endif
-#endif
-
-/* Dereferencing a pointer arg to run sizeof on it fails for the void
-   pointer case, so we use this instead.
-   Note that __x is evaluated twice. */
-#define __string2_1bptr_p(__x) \
-  ((size_t)(const void *)((__x) + 1) - (size_t)(const void *)(__x) == 1)
-
-/* Set N bytes of S to 0.  */
-#if !defined _HAVE_STRING_ARCH_memset
-# define __bzero(s, n) __builtin_memset (s, '\0', n)
-#endif
-
-
-#ifndef _HAVE_STRING_ARCH_strchr
-extern void *__rawmemchr (const void *__s, int __c);
-#  define strchr(s, c) \
-  (__extension__ (__builtin_constant_p (c) && !__builtin_constant_p (s)	      \
-		  && (c) == '\0'					      \
-		  ? (char *) __rawmemchr (s, c)				      \
-		  : __builtin_strchr (s, c)))
-#endif
-
-
-/* Copy SRC to DEST, returning pointer to final NUL byte.  */
-#ifdef __USE_GNU
-# ifndef _HAVE_STRING_ARCH_stpcpy
-#  define __stpcpy(dest, src) __builtin_stpcpy (dest, src)
-/* In glibc we use this function frequently but for namespace reasons
-   we have to use the name `__stpcpy'.  */
-#  define stpcpy(dest, src) __stpcpy (dest, src)
-# endif
-#endif
-
-
-/* Copy no more than N characters of SRC to DEST.  */
-#ifndef _HAVE_STRING_ARCH_strncpy
-# define strncpy(dest, src, n) __builtin_strncpy (dest, src, n)
-#endif
-
-
-/* Append no more than N characters from SRC onto DEST.  */
-#ifndef _HAVE_STRING_ARCH_strncat
-# ifdef _USE_STRING_ARCH_strchr
-#  define strncat(dest, src, n) \
-  (__extension__ ({ char *__dest = (dest);				      \
-		    __builtin_constant_p (src) && __builtin_constant_p (n)    \
-		    ? (strlen (src) < ((size_t) (n))			      \
-		       ? strcat (__dest, src)				      \
-		       : (*((char *) __mempcpy (strchr (__dest, '\0'),	      \
-						src, n)) = '\0', __dest))     \
-		    : strncat (dest, src, n); }))
-# else
-#  define strncat(dest, src, n) __builtin_strncat (dest, src, n)
-# endif
-#endif
-
-
-/* Compare characters of S1 and S2.  */
-#ifndef _HAVE_STRING_ARCH_strcmp
-# define strcmp(s1, s2) \
-  __extension__								      \
-  ({ size_t __s1_len, __s2_len;						      \
-     (__builtin_constant_p (s1) && __builtin_constant_p (s2)		      \
-      && (__s1_len = strlen (s1), __s2_len = strlen (s2),		      \
-	  (!__string2_1bptr_p (s1) || __s1_len >= 4)			      \
-	  && (!__string2_1bptr_p (s2) || __s2_len >= 4))		      \
-      ? __builtin_strcmp (s1, s2)					      \
-      : (__builtin_constant_p (s1) && __string2_1bptr_p (s1)		      \
-	 && (__s1_len = strlen (s1), __s1_len < 4)			      \
-	 ? (__builtin_constant_p (s2) && __string2_1bptr_p (s2)		      \
-	    ? __builtin_strcmp (s1, s2)					      \
-	    : __strcmp_cg (s1, s2, __s1_len))				      \
-	 : (__builtin_constant_p (s2) && __string2_1bptr_p (s2)		      \
-	    && (__s2_len = strlen (s2), __s2_len < 4)			      \
-	    ? (__builtin_constant_p (s1) && __string2_1bptr_p (s1)	      \
-	       ? __builtin_strcmp (s1, s2)				      \
-	       : -__strcmp_cg (s2, s1, __s2_len))			      \
-            : __builtin_strcmp (s1, s2)))); })
-
-# define __strcmp_cg(s1, s2, l1) \
-  (__extension__ ({ const unsigned char *__s2 =				      \
-		      (const unsigned char *) (const char *) (s2);	      \
-		    int __result =					      \
-		      (((const unsigned char *) (const char *) (s1))[0]	      \
-		       - __s2[0]);					      \
-		    if (l1 > 0 && __result == 0)			      \
-		      {							      \
-			__result = (((const unsigned char *)		      \
-				     (const char *) (s1))[1] - __s2[1]);      \
-			if (l1 > 1 && __result == 0)			      \
-			  {						      \
-			    __result = (((const unsigned char *)	      \
-					 (const char *) (s1))[2] - __s2[2]);  \
-			    if (l1 > 2 && __result == 0)		      \
-			      __result = (((const unsigned char *)	      \
-					  (const char *)  (s1))[3]	      \
-					  - __s2[3]);			      \
-			  }						      \
-		      }							      \
-		    __result; }))
-#endif
-
-
-/* Compare N characters of S1 and S2.  */
-#ifndef _HAVE_STRING_ARCH_strncmp
-# define strncmp(s1, s2, n)						      \
-  (__extension__ (__builtin_constant_p (n)				      \
-		  && ((__builtin_constant_p (s1)			      \
-		       && strlen (s1) < ((size_t) (n)))			      \
-		      || (__builtin_constant_p (s2)			      \
-			  && strlen (s2) < ((size_t) (n))))		      \
-		  ? strcmp (s1, s2) : strncmp (s1, s2, n)))
-#endif
-
-
-/* Return the length of the initial segment of S which
-   consists entirely of characters not in REJECT.  */
-#ifndef _HAVE_STRING_ARCH_strcspn
-# define strcspn(s, reject) __builtin_strcspn (s, reject)
-#endif
-
-
-/* Return the length of the initial segment of S which
-   consists entirely of characters in ACCEPT.  */
-#ifndef _HAVE_STRING_ARCH_strspn
-# define strspn(s, accept) __builtin_strspn (s, accept)
-#endif
-
-
-/* Find the first occurrence in S of any character in ACCEPT.  */
-#ifndef _HAVE_STRING_ARCH_strpbrk
-# define strpbrk(s, accept) __builtin_strpbrk (s, accept)
-#endif
-
-
-#if !defined _HAVE_STRING_ARCH_strtok_r || defined _FORCE_INLINES
-# ifndef _HAVE_STRING_ARCH_strtok_r
-#  define __strtok_r(s, sep, nextp) \
-  (__extension__ (__builtin_constant_p (sep) && __string2_1bptr_p (sep)	      \
-		  && ((const char *) (sep))[0] != '\0'			      \
-		  && ((const char *) (sep))[1] == '\0'			      \
-		  ? __strtok_r_1c (s, ((const char *) (sep))[0], nextp)       \
-		  : __strtok_r (s, sep, nextp)))
-# endif
-
-__STRING_INLINE char *__strtok_r_1c (char *__s, char __sep, char **__nextp);
-__STRING_INLINE char *
-__strtok_r_1c (char *__s, char __sep, char **__nextp)
-{
-  char *__result;
-  if (__s == NULL)
-    __s = *__nextp;
-  while (*__s == __sep)
-    ++__s;
-  __result = NULL;
-  if (*__s != '\0')
-    {
-      __result = __s++;
-      while (*__s != '\0')
-	if (*__s++ == __sep)
-	  {
-	    __s[-1] = '\0';
-	    break;
-	  }
-    }
-  *__nextp = __s;
-  return __result;
-}
-# ifdef __USE_POSIX
-#  define strtok_r(s, sep, nextp) __strtok_r (s, sep, nextp)
-# endif
-#endif
-
-
-#if !defined _HAVE_STRING_ARCH_strsep || defined _FORCE_INLINES
-# ifndef _HAVE_STRING_ARCH_strsep
-
-extern char *__strsep_g (char **__stringp, const char *__delim);
-#  define __strsep(s, reject) \
-  __extension__								      \
-  ({ char __r0, __r1, __r2;						      \
-     (__builtin_constant_p (reject) && __string2_1bptr_p (reject)	      \
-      && (__r0 = ((const char *) (reject))[0],				      \
-	  ((const char *) (reject))[0] != '\0')				      \
-      ? ((__r1 = ((const char *) (reject))[1],				      \
-	 ((const char *) (reject))[1] == '\0')				      \
-	 ? __strsep_1c (s, __r0)					      \
-	 : ((__r2 = ((const char *) (reject))[2], __r2 == '\0')		      \
-	    ? __strsep_2c (s, __r0, __r1)				      \
-	    : (((const char *) (reject))[3] == '\0'			      \
-	       ? __strsep_3c (s, __r0, __r1, __r2)			      \
-	       : __strsep_g (s, reject))))				      \
-      : __strsep_g (s, reject)); })
-# endif
-
-__STRING_INLINE char *__strsep_1c (char **__s, char __reject);
-__STRING_INLINE char *
-__strsep_1c (char **__s, char __reject)
-{
-  char *__retval = *__s;
-  if (__retval != NULL && (*__s = strchr (__retval, __reject)) != NULL)
-    *(*__s)++ = '\0';
-  return __retval;
-}
-
-__STRING_INLINE char *__strsep_2c (char **__s, char __reject1, char __reject2);
-__STRING_INLINE char *
-__strsep_2c (char **__s, char __reject1, char __reject2)
-{
-  char *__retval = *__s;
-  if (__retval != NULL)
-    {
-      char *__cp = __retval;
-      while (1)
-	{
-	  if (*__cp == '\0')
-	    {
-	      __cp = NULL;
-	  break;
-	    }
-	  if (*__cp == __reject1 || *__cp == __reject2)
-	    {
-	      *__cp++ = '\0';
-	      break;
-	    }
-	  ++__cp;
-	}
-      *__s = __cp;
-    }
-  return __retval;
-}
-
-__STRING_INLINE char *__strsep_3c (char **__s, char __reject1, char __reject2,
-				   char __reject3);
-__STRING_INLINE char *
-__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
-{
-  char *__retval = *__s;
-  if (__retval != NULL)
-    {
-      char *__cp = __retval;
-      while (1)
-	{
-	  if (*__cp == '\0')
-	    {
-	      __cp = NULL;
-	  break;
-	    }
-	  if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
-	    {
-	      *__cp++ = '\0';
-	      break;
-	    }
-	  ++__cp;
-	}
-      *__s = __cp;
-    }
-  return __retval;
-}
-# ifdef __USE_MISC
-#  define strsep(s, reject) __strsep (s, reject)
-# endif
-#endif
-
-/* We need the memory allocation functions for inline strdup().
-   Referring to stdlib.h (even minimally) is not allowed
-   in any of the tight standards compliant modes.  */
-#ifdef __USE_MISC
-
-# if !defined _HAVE_STRING_ARCH_strdup || !defined _HAVE_STRING_ARCH_strndup
-#  define __need_malloc_and_calloc
-#  include <stdlib.h>
-# endif
-
-# ifndef _HAVE_STRING_ARCH_strdup
-
-extern char *__strdup (const char *__string) __THROW __attribute_malloc__;
-#  define __strdup(s) \
-  (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
-		  ? (((const char *) (s))[0] == '\0'			      \
-		     ? (char *) calloc ((size_t) 1, (size_t) 1)		      \
-		     : ({ size_t __len = strlen (s) + 1;		      \
-			  char *__retval = (char *) malloc (__len);	      \
-			  if (__retval != NULL)				      \
-			    __retval = (char *) memcpy (__retval, s, __len);  \
-			  __retval; }))					      \
-		  : __strdup (s)))
-
-#  if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
-#   define strdup(s) __strdup (s)
-#  endif
-# endif
-
-# ifndef _HAVE_STRING_ARCH_strndup
-
-extern char *__strndup (const char *__string, size_t __n)
-     __THROW __attribute_malloc__;
-#  define __strndup(s, n) \
-  (__extension__ (__builtin_constant_p (s) && __string2_1bptr_p (s)	      \
-		  ? (((const char *) (s))[0] == '\0'			      \
-		     ? (char *) calloc ((size_t) 1, (size_t) 1)		      \
-		     : ({ size_t __len = strlen (s) + 1;		      \
-			  size_t __n = (n);				      \
-			  char *__retval;				      \
-			  if (__n < __len)				      \
-			    __len = __n + 1;				      \
-			  __retval = (char *) malloc (__len);		      \
-			  if (__retval != NULL)				      \
-			    {						      \
-			      __retval[__len - 1] = '\0';		      \
-			      __retval = (char *) memcpy (__retval, s,	      \
-							  __len - 1);	      \
-			    }						      \
-			  __retval; }))					      \
-		  : __strndup (s, n)))
-
-#  ifdef __USE_XOPEN2K8
-#   define strndup(s, n) __strndup (s, n)
-#  endif
-# endif
-
-#endif /* Use misc. or use GNU.  */
-
-#ifndef _FORCE_INLINES
-# undef __STRING_INLINE
-#endif
-
-#endif /* No string inlines.  */
diff --git a/string/string-inlines.c b/string/string-inlines.c
index 1091468..c49525f 100644
--- a/string/string-inlines.c
+++ b/string/string-inlines.c
@@ -15,9 +15,9 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-/*  <bits/string.h> and <bits/string2.h> declare some extern inline
-    functions.  These functions are declared additionally here if
-    inlining is not possible.  */
+/*  <bits/string.h> declares some extern inline functions.  These
+    functions are declared additionally here if inlining is not
+    possible.  */
 
 #undef __USE_STRING_INLINES
 #define __USE_STRING_INLINES
@@ -31,7 +31,6 @@
 
 #undef __NO_INLINE__
 #include <bits/string.h>
-#include <bits/string2.h>
 
 #include "shlib-compat.h"
 
@@ -474,3 +473,94 @@ __old_stpcpy_small (char *__dest,
 compat_symbol (libc, __old_stpcpy_small, __stpcpy_small, GLIBC_2_1_1);
 
 #endif
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1_1, GLIBC_2_25)
+/* These inline functions are not used from GLIBC 2.25 and forward.  */
+char *
+__old_strtok_r_1c (char *__s, char __sep, char **__nextp)
+{
+  char *__result;
+  if (__s == NULL)
+    __s = *__nextp;
+  while (*__s == __sep)
+    ++__s;
+  __result = NULL;
+  if (*__s != '\0')
+    {
+      __result = __s++;
+      while (*__s != '\0')
+	if (*__s++ == __sep)
+	  {
+	    __s[-1] = '\0';
+	    break;
+	  }
+    }
+  *__nextp = __s;
+  return __result;
+}
+compat_symbol (libc, __old_strtok_r_1c, __strtok_r_1c, GLIBC_2_1_1);
+
+char *
+__old_strsep_1c (char **__s, char __reject)
+{
+  char *__retval = *__s;
+  if (__retval != NULL && (*__s = strchr (__retval, __reject)) != NULL)
+    *(*__s)++ = '\0';
+  return __retval;
+}
+compat_symbol (libc, __old_strsep_1c, __strsep_1c, GLIBC_2_1_1);
+
+char *
+__old_strsep_2c (char **__s, char __reject1, char __reject2)
+{
+  char *__retval = *__s;
+  if (__retval != NULL)
+    {
+      char *__cp = __retval;
+      while (1)
+	{
+	  if (*__cp == '\0')
+	    {
+	      __cp = NULL;
+	  break;
+	    }
+	  if (*__cp == __reject1 || *__cp == __reject2)
+	    {
+	      *__cp++ = '\0';
+	      break;
+	    }
+	  ++__cp;
+	}
+      *__s = __cp;
+    }
+  return __retval;
+}
+compat_symbol (libc, __old_strsep_2c, __strsep_2c, GLIBC_2_1_1);
+
+char *
+__old_strsep_3c (char **__s, char __reject1, char __reject2, char __reject3)
+{
+  char *__retval = *__s;
+  if (__retval != NULL)
+    {
+      char *__cp = __retval;
+      while (1)
+	{
+	  if (*__cp == '\0')
+	    {
+	      __cp = NULL;
+	  break;
+	    }
+	  if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3)
+	    {
+	      *__cp++ = '\0';
+	      break;
+	    }
+	  ++__cp;
+	}
+      *__s = __cp;
+    }
+  return __retval;
+}
+compat_symbol (libc, __old_strsep_3c, __strsep_3c, GLIBC_2_1_1);
+#endif
diff --git a/string/string.h b/string/string.h
index 601025b..c476efa 100644
--- a/string/string.h
+++ b/string/string.h
@@ -407,9 +407,6 @@ __CONST_COV_PROTO (basename, __nonnull ((1)),
 
 /* Get the machine-dependent optimizations (if any).  */
 #  include <bits/string.h>
-
-/* These are generic optimizations which do not add too much inline code.  */
-#  include <bits/string2.h>
 # endif
 
 # if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
@@ -418,23 +415,6 @@ __CONST_COV_PROTO (basename, __nonnull ((1)),
 # endif
 #endif
 
-#if defined __USE_GNU && defined __OPTIMIZE__ \
-    && defined __extern_always_inline && __GNUC_PREREQ (3,2)
-# if !defined _FORCE_INLINES && !defined _HAVE_STRING_ARCH_mempcpy
-
-#define mempcpy(dest, src, n) __mempcpy_inline (dest, src, n)
-#define __mempcpy(dest, src, n) __mempcpy_inline (dest, src, n)
-
-__extern_always_inline void *
-__mempcpy_inline (void *__restrict __dest,
-		  const void *__restrict __src, size_t __n)
-{
-  return (char *) memcpy (__dest, __src, __n) + __n;
-}
-
-# endif
-#endif
-
 __END_DECLS
 
 #endif /* string.h  */
diff --git a/sunrpc/svc_simple.c b/sunrpc/svc_simple.c
index baa177e..acc9b9d 100644
--- a/sunrpc/svc_simple.c
+++ b/sunrpc/svc_simple.c
@@ -87,7 +87,7 @@ __registerrpc (u_long prognum, u_long versnum, u_long procnum,
       transp = svcudp_create (RPC_ANYSOCK);
       if (transp == NULL)
 	{
-	  buf = strdup (_("couldn't create an rpc server\n"));
+	  buf = __strdup (_("couldn't create an rpc server\n"));
 	  goto err_out;
 	}
     }
@@ -103,7 +103,7 @@ __registerrpc (u_long prognum, u_long versnum, u_long procnum,
   pl = (struct proglst_ *) malloc (sizeof (struct proglst_));
   if (pl == NULL)
     {
-      buf = strdup (_("registerrpc: out of memory\n"));
+      buf = __strdup (_("registerrpc: out of memory\n"));
       goto err_out;
     }
   pl->p_progname = progname;
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 740e955..24d6d47 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -536,7 +536,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		      }
 		    else
 		      {
-			namebuf = strndup (name, scope_delim - name);
+			namebuf = __strndup (name, scope_delim - name);
 			if (namebuf == NULL)
 			  {
 			    assert (!malloc_name);
@@ -1139,7 +1139,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		  malloc_canonbuf = false;
 		else
 		  {
-		    canon = strdup (canon);
+		    canon = __strdup (canon);
 		    if (canon == NULL)
 		      {
 			result = -EAI_MEMORY;
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c
index 012f93f..ce649cd 100644
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -168,7 +168,7 @@ __statvfs_getflags (const char *name, int fstype, int fd)
 	      char *cp = mntbuf.mnt_opts;
 	      char *opt;
 
-	      while ((opt = strsep (&cp, ",")) != NULL)
+	      while ((opt = __strsep (&cp, ",")) != NULL)
 		if (strcmp (opt, "ro") == 0)
 		  result |= ST_RDONLY;
 		else if (strcmp (opt, "nosuid") == 0)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3d50f675798932e46782020cd94188f60fd41caa

commit 3d50f675798932e46782020cd94188f60fd41caa
Author: Zack Weinberg <zackw@panix.com>
Date:   Wed Nov 16 18:34:27 2016 -0500

    New mechanism for declaring const-covariant string functions.
    
    Several functions in string.h, strings.h, and wchar.h return a pointer
    into a buffer passed as their first argument.  That pointer logically
    ought to inherit the 'const'-ness of the original buffer.  There's no
    way to express that in C, so all these functions are specified with a
    prototype that, as a side-effect, strips the 'const', potentially
    leading to bugs:
    
        char *strfoo(const char *buf, ...);
    
    In C++, however, you can get it exactly right via function overloads:
    
        char *strfoo(char *buf, ...);
        const char *strfoo(const char *buf, ...);
    
    and the C++ standard (21.7 [c.strings]) requires the library to do
    just that.  We were implementing this requirement via a repetitive and
    error-prone mess of #ifdefs for each and every one of the affected
    functions.
    
    This patch absorbs the entire mess into a pair of macros,
    __CONST_COV_PROTO and __CONST_COV_BUILTIN, which are far less
    error-prone to use, and which make the public header files much nicer
    to read, too.  They needed some black magic to _implement_, but it's
    hiding in a bits header and hopefully nobody need ever change that
    file again.
    
    	* string/bits/const-covariance.h: New file.
            * string/Makefile (headers): Add it.
    	* string/string.h: Use __CONST_COV_PROTO and __CONST_COV_BUILTIN to
    	declare memchr, rawmemchr, memrchr, strchr, strrchr, strchrnul,
    	strpbrk, strstr, strcasestr, memmem, and basename.
    	* string/strings.h: Likewise for index and rindex.
    	* wcsmbs/wchar.h: Likewise for wcschr, wcsrchr, wcschrnul,
    	wcspbrk, wcsstr, wcswcs, and wmemchr.
    
    	* include/bits/const-covariance.h: New wrapper.
            * include/libc-symbols.h: Define _ISOMAC when compiling C++.

diff --git a/include/bits/const-covariance.h b/include/bits/const-covariance.h
new file mode 100644
index 0000000..564d730
--- /dev/null
+++ b/include/bits/const-covariance.h
@@ -0,0 +1 @@
+#include <string/bits/const-covariance.h>
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index 1c91f2e..d3382c5 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -76,6 +76,14 @@
 #define HAVE_ISWCTYPE	1
 #define ENABLE_NLS	1
 
+/* As C++ is only used in tests, and the internal-use declarations
+   found in wrapper headers in include/ are not always C++-safe,
+   instruct those headers not to provide any of those declarations
+   when compiling C++.  */
+#ifdef __cplusplus
+# define _ISOMAC 1
+#endif
+
 /* The symbols in all the user (non-_) macros are C symbols.  */
 
 #ifndef __SYMBOL_PREFIX
diff --git a/string/Makefile b/string/Makefile
index 69d3f80..c009872 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -24,7 +24,8 @@ include ../Makeconfig
 
 headers	:= string.h strings.h memory.h endian.h bits/endian.h \
 	   argz.h envz.h byteswap.h bits/byteswap.h bits/byteswap-16.h \
-	   bits/string.h bits/string2.h bits/string3.h
+	   bits/string.h bits/string2.h bits/string3.h \
+	   bits/const-covariance.h
 
 routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
 		   strverscmp strdup strndup				\
diff --git a/string/bits/const-covariance.h b/string/bits/const-covariance.h
new file mode 100644
index 0000000..6378438
--- /dev/null
+++ b/string/bits/const-covariance.h
@@ -0,0 +1,130 @@
+/* Copyright (C) 2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_CONST_COVARIANCE_H
+#define _BITS_CONST_COVARIANCE_H 1
+
+#if !defined _STRING_H && !defined _STRINGS_H && !defined _WCHAR_H
+# error "Never use <bits/const-covariance.h> directly; include <string.h>, <strings.h>, or <wchar.h> instead."
+#endif
+
+/* This header defines internal-use macros that expand a C prototype
+   declaration like
+
+       extern void *memchr (const void *, int, size_t) attrs;
+
+   to a pair of C++ overloaded function declarations with improved
+   const-correctness:
+
+       extern void *memchr (void *, int, size_t) attrs;
+       extern const void *memchr (const void *, int, size_t) attrs;
+
+   You use them like this:
+
+       __CONST_COV_PROTO (memchr, attrs,
+                          void *, __s, int, __c, size_t, __n);
+
+    where the arguments after 'attrs' are the function's arguments,
+    alternating with argument names.  The first of these will be used
+    as the const-covariant return type.  It should be written without
+    a 'const' qualifier.
+
+    If the compiler has intrinsic knowledge of the function, use
+    __CONST_COV_BUILTIN instead of __CONST_COV_PROTO.  In C++ mode,
+    this will also generate inline functions of the form
+
+        __extern_always_inline [const] void *
+        memchr (void *__s, int __c, size_t __n) attrs
+        {
+          return __builtin_memchr (__s, __c, __n);
+        }
+
+    Due to limitations in the preprocessor, these macros support no
+    more than four arguments to any function.  This is all that
+    string.h/strings.h currently require.
+
+    Because g++ only accepts throw(), __asm("..."), and
+    __attribute__((whatever)) annotations in a specific order, all
+    functions declared with __CONST_COV_PROTO or defined with
+    __CONST_COV_BUILTIN are automatically marked __THROW.  Do not put
+    __THROW in 'attrs'.  */
+
+#define __CC_VA_NARGS(...)  __CC_VA_NARGS_(__VA_ARGS__, __CC_RSEQ)
+#define __CC_VA_NARGS_(...) __CC_VA_NARGS__(__VA_ARGS__)
+#define __CC_VA_NARGS__(_1, _2, _3, _4, _5, _6, _7, _8, N, ...) N
+#define __CC_RSEQ 8, 7, 6, 5, 4, 3, 2, 1
+
+#define __CC_2FOR2(op, a, b)	  op (a, b)
+#define __CC_2FOR4(op, a, b, ...) op (a, b), __CC_2FOR2 (op, __VA_ARGS__)
+#define __CC_2FOR6(op, a, b, ...) op (a, b), __CC_2FOR4 (op, __VA_ARGS__)
+#define __CC_2FOR8(op, a, b, ...) op (a, b), __CC_2FOR6 (op, __VA_ARGS__)
+
+#define __CC_2FOR(op, ...) \
+ __CC_2FOR_ (__CC_VA_NARGS (__VA_ARGS__)) (op, __VA_ARGS__)
+#define __CC_2FOR_(n) __CC_2FOR__ (n)
+#define __CC_2FOR__(n) __CC_2FOR##n
+
+#define __CC_XPROTO(...) (__CC_2FOR (__CC_XPROTO_, __VA_ARGS__))
+#define __CC_XPROTO_(type, name) type name
+
+#define __CC_XCALL(...) (__CC_2FOR (__CC_XCALL_, __VA_ARGS__))
+#define __CC_XCALL_(type, name) name
+
+#if !defined __cplusplus || !__GNUC_PREREQ (4, 4)
+
+# define __CONST_COV_PROTO(name, attrs, rtype, ...)			\
+   extern rtype name __CC_XPROTO(const rtype, __VA_ARGS__) __THROW attrs
+
+# define __CONST_COV_BUILTIN(...) __CONST_COV_PROTO (__VA_ARGS__)
+
+#else
+
+# define __CONST_COV_PROTO_BODY(name, attrs, rtype, ...)		\
+  extern rtype name __CC_XPROTO(rtype, __VA_ARGS__)			\
+    __THROW __asm (#name) attrs;					\
+  extern const rtype name __CC_XPROTO(const rtype, __VA_ARGS__)		\
+    __THROW __asm (#name) attrs;
+
+# define __CONST_COV_PROTO(...)						\
+   extern "C++"								\
+   {									\
+     __CONST_COV_PROTO_BODY(__VA_ARGS__)				\
+   }									\
+   struct __require_semicolon
+
+# ifndef __OPTIMIZE__
+#  define __CONST_COV_BUILTIN(...) __CONST_COV_PROTO (__VA_ARGS__)
+
+# else
+
+#  define __CONST_COV_BUILTIN(name, attrs, rtype, ...)			\
+  extern "C++"								\
+  {									\
+    __CONST_COV_PROTO_BODY (name, attrs, rtype, __VA_ARGS__)		\
+    __extern_always_inline rtype					\
+    name __CC_XPROTO (rtype, __VA_ARGS__) __THROW			\
+    { return __builtin_##name __CC_XCALL (rtype, __VA_ARGS__); }	\
+    __extern_always_inline const rtype					\
+    name __CC_XPROTO (const rtype, __VA_ARGS__) __THROW			\
+    { return __builtin_##name __CC_XCALL (rtype, __VA_ARGS__); }	\
+  }									\
+  struct __require_semicolon
+
+# endif /* __OPTIMIZE__ */
+#endif /* C++ and GCC >=4.4 */
+
+#endif /* const-covariance.h */
diff --git a/string/string.h b/string/string.h
index ca22cd0..601025b 100644
--- a/string/string.h
+++ b/string/string.h
@@ -36,7 +36,7 @@ __BEGIN_DECLS
 #if defined __cplusplus && __GNUC_PREREQ (4, 4)
 # define __CORRECT_ISO_CPP_STRING_H_PROTO
 #endif
-
+#include <bits/const-covariance.h>
 
 __BEGIN_NAMESPACE_STD
 /* Copy N bytes of SRC to DEST.  */
@@ -66,61 +66,31 @@ extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
 extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      __THROW __attribute_pure__ __nonnull ((1, 2));
 
-/* Search N bytes of S for C.  */
-#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++"
-{
-extern void *memchr (void *__s, int __c, size_t __n)
-      __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1));
-extern const void *memchr (const void *__s, int __c, size_t __n)
-      __THROW __asm ("memchr") __attribute_pure__ __nonnull ((1));
-
-# ifdef __OPTIMIZE__
-__extern_always_inline void *
-memchr (void *__s, int __c, size_t __n) __THROW
-{
-  return __builtin_memchr (__s, __c, __n);
-}
-
-__extern_always_inline const void *
-memchr (const void *__s, int __c, size_t __n) __THROW
-{
-  return __builtin_memchr (__s, __c, __n);
-}
-# endif
-}
-#else
-extern void *memchr (const void *__s, int __c, size_t __n)
-      __THROW __attribute_pure__ __nonnull ((1));
-#endif
+/* Search N bytes of S for C.
+   [C]    extern void *memchr (const void *s, int c, size_t n);
+   [C++]  extern void *memchr (void *s, int c, size_t n);
+          extern const void *memchr (const void *s, int c, size_t n);  */
+__CONST_COV_BUILTIN (memchr, __attribute_pure__ __nonnull ((1)),
+                     void *, __s, int, __c, size_t, __n);
 __END_NAMESPACE_STD
 
 #ifdef __USE_GNU
-/* Search in S for C.  This is similar to `memchr' but there is no
-   length limit.  */
-# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++" void *rawmemchr (void *__s, int __c)
-     __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1));
-extern "C++" const void *rawmemchr (const void *__s, int __c)
-     __THROW __asm ("rawmemchr") __attribute_pure__ __nonnull ((1));
-# else
-extern void *rawmemchr (const void *__s, int __c)
-     __THROW __attribute_pure__ __nonnull ((1));
-# endif
-
-/* Search N bytes of S for the final occurrence of C.  */
-# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++" void *memrchr (void *__s, int __c, size_t __n)
-      __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1));
-extern "C++" const void *memrchr (const void *__s, int __c, size_t __n)
-      __THROW __asm ("memrchr") __attribute_pure__ __nonnull ((1));
-# else
-extern void *memrchr (const void *__s, int __c, size_t __n)
-      __THROW __attribute_pure__ __nonnull ((1));
-# endif
+/* Search in S for C.  This is similar to 'memchr' but there is no
+   length limit.
+   [C]    extern void *rawmemchr (const void *s, int c);
+   [C++]  extern void *rawmemchr (void *s, int c);
+          extern const void *rawmemchr (const void *s, int c);  */
+__CONST_COV_PROTO (rawmemchr, __attribute_pure__ __nonnull ((1)),
+                   void *, __s, int, __c);
+
+/* Search N bytes of S for the final occurrence of C.
+   [C]    extern void *memrchr (const void *s, int c, size_t n);
+   [C++]  extern void *memrchr (void *s, int c, size_t n);
+          extern const void *memrchr (const void *s, int c, size_t n);  */
+__CONST_COV_PROTO (memrchr, __attribute_pure__ __nonnull ((1)),
+                   void *, __s, int, __c, size_t, __n);
 #endif
 
-
 __BEGIN_NAMESPACE_STD
 /* Copy SRC to DEST.  */
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
@@ -204,74 +174,30 @@ extern char *strndup (const char *__string, size_t __n)
 #endif
 
 __BEGIN_NAMESPACE_STD
-/* Find the first occurrence of C in S.  */
-#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++"
-{
-extern char *strchr (char *__s, int __c)
-     __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1));
-extern const char *strchr (const char *__s, int __c)
-     __THROW __asm ("strchr") __attribute_pure__ __nonnull ((1));
-
-# ifdef __OPTIMIZE__
-__extern_always_inline char *
-strchr (char *__s, int __c) __THROW
-{
-  return __builtin_strchr (__s, __c);
-}
+/* Find the first occurrence of C in S.
+   [C]    extern char *strchr (const char *s, int c);
+   [C++]  extern char *strchr (char *s, int c);
+          extern const char *strchr (const char *s, int c);  */
+__CONST_COV_BUILTIN (strchr, __attribute_pure__ __nonnull ((1)),
+                   char *, __s, int, __c);
+
+/* Find the last occurrence of C in S.
+   [C]    extern char *strrchr (const char *s, int c);
+   [C++]  extern char *strrchr (char *s, int c);
+          extern const char *strrchr (const char *s, int c);  */
+__CONST_COV_BUILTIN (strrchr, __attribute_pure__ __nonnull ((1)),
+                     char *, __s, int, __c);
 
-__extern_always_inline const char *
-strchr (const char *__s, int __c) __THROW
-{
-  return __builtin_strchr (__s, __c);
-}
-# endif
-}
-#else
-extern char *strchr (const char *__s, int __c)
-     __THROW __attribute_pure__ __nonnull ((1));
-#endif
-/* Find the last occurrence of C in S.  */
-#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++"
-{
-extern char *strrchr (char *__s, int __c)
-     __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1));
-extern const char *strrchr (const char *__s, int __c)
-     __THROW __asm ("strrchr") __attribute_pure__ __nonnull ((1));
-
-# ifdef __OPTIMIZE__
-__extern_always_inline char *
-strrchr (char *__s, int __c) __THROW
-{
-  return __builtin_strrchr (__s, __c);
-}
-
-__extern_always_inline const char *
-strrchr (const char *__s, int __c) __THROW
-{
-  return __builtin_strrchr (__s, __c);
-}
-# endif
-}
-#else
-extern char *strrchr (const char *__s, int __c)
-     __THROW __attribute_pure__ __nonnull ((1));
-#endif
 __END_NAMESPACE_STD
 
 #ifdef __USE_GNU
 /* This function is similar to `strchr'.  But it returns a pointer to
-   the closing NUL byte in case C is not found in S.  */
-# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++" char *strchrnul (char *__s, int __c)
-     __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1));
-extern "C++" const char *strchrnul (const char *__s, int __c)
-     __THROW __asm ("strchrnul") __attribute_pure__ __nonnull ((1));
-# else
-extern char *strchrnul (const char *__s, int __c)
-     __THROW __attribute_pure__ __nonnull ((1));
-# endif
+   the closing NUL byte in case C is not found in S.
+   [C]    extern char *strchrnul (const char *s, int c);
+   [C++]  extern char *strchrnul (char *s, int c);
+          extern const char *strchrnul (const char *s, int c);  */
+__CONST_COV_PROTO (strchrnul, __attribute_pure__ __nonnull ((1)),
+                   char *, __s, int, __c);
 #endif
 
 __BEGIN_NAMESPACE_STD
@@ -279,65 +205,26 @@ __BEGIN_NAMESPACE_STD
    consists entirely of characters not in REJECT.  */
 extern size_t strcspn (const char *__s, const char *__reject)
      __THROW __attribute_pure__ __nonnull ((1, 2));
+
 /* Return the length of the initial segment of S which
    consists entirely of characters in ACCEPT.  */
 extern size_t strspn (const char *__s, const char *__accept)
      __THROW __attribute_pure__ __nonnull ((1, 2));
-/* Find the first occurrence in S of any character in ACCEPT.  */
-#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++"
-{
-extern char *strpbrk (char *__s, const char *__accept)
-     __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2));
-extern const char *strpbrk (const char *__s, const char *__accept)
-     __THROW __asm ("strpbrk") __attribute_pure__ __nonnull ((1, 2));
-
-# ifdef __OPTIMIZE__
-__extern_always_inline char *
-strpbrk (char *__s, const char *__accept) __THROW
-{
-  return __builtin_strpbrk (__s, __accept);
-}
 
-__extern_always_inline const char *
-strpbrk (const char *__s, const char *__accept) __THROW
-{
-  return __builtin_strpbrk (__s, __accept);
-}
-# endif
-}
-#else
-extern char *strpbrk (const char *__s, const char *__accept)
-     __THROW __attribute_pure__ __nonnull ((1, 2));
-#endif
-/* Find the first occurrence of NEEDLE in HAYSTACK.  */
-#ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++"
-{
-extern char *strstr (char *__haystack, const char *__needle)
-     __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2));
-extern const char *strstr (const char *__haystack, const char *__needle)
-     __THROW __asm ("strstr") __attribute_pure__ __nonnull ((1, 2));
-
-# ifdef __OPTIMIZE__
-__extern_always_inline char *
-strstr (char *__haystack, const char *__needle) __THROW
-{
-  return __builtin_strstr (__haystack, __needle);
-}
-
-__extern_always_inline const char *
-strstr (const char *__haystack, const char *__needle) __THROW
-{
-  return __builtin_strstr (__haystack, __needle);
-}
-# endif
-}
-#else
-extern char *strstr (const char *__haystack, const char *__needle)
-     __THROW __attribute_pure__ __nonnull ((1, 2));
-#endif
+/* Find the first occurrence in S of any character in ACCEPT.
+   [C]   extern char *strpbrk (const char *s, const char *accept);
+   [C++] extern char *strpbrk (char *s, const char *accept);
+         extern const char *strpbrk (const char *s, const char *accept); */
+__CONST_COV_BUILTIN (strpbrk, __attribute_pure__ __nonnull ((1, 2)),
+                     char *, __s, const char *, __accept);
 
+/* Find the first occurrence of NEEDLE in HAYSTACK.
+   [C]   extern char *strstr (const char *haystack, const char *needle);
+   [C++] extern char *strstr (char *haystack, const char *needle);
+         extern const char *strstr (const char *haystack, const char *needle);
+ */
+__CONST_COV_BUILTIN (strstr, __attribute_pure__ __nonnull ((1, 2)),
+                     char *, __haystack, const char *, __needle);
 
 /* Divide S into tokens separated by characters in DELIM.  */
 extern char *strtok (char *__restrict __s, const char *__restrict __delim)
@@ -357,26 +244,26 @@ extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
 #endif
 
 #ifdef __USE_GNU
-/* Similar to `strstr' but this function ignores the case of both strings.  */
-# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++" char *strcasestr (char *__haystack, const char *__needle)
-     __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2));
-extern "C++" const char *strcasestr (const char *__haystack,
-				     const char *__needle)
-     __THROW __asm ("strcasestr") __attribute_pure__ __nonnull ((1, 2));
-# else
-extern char *strcasestr (const char *__haystack, const char *__needle)
-     __THROW __attribute_pure__ __nonnull ((1, 2));
-# endif
-#endif
+/* Similar to 'strstr', but ignores the case of both strings.
+   [C]   extern char *strcasestr (const char *haystack, const char *needle);
+   [C++] extern char *strcasestr (char *haystack, const char *needle);
+         extern const char *strcasestr (const char *haystack,
+                                        const char *needle);  */
+__CONST_COV_PROTO (strcasestr, __attribute_pure__ __nonnull ((1, 2)),
+                   char *, __haystack, const char *, __needle);
 
-#ifdef __USE_GNU
 /* Find the first occurrence of NEEDLE in HAYSTACK.
    NEEDLE is NEEDLELEN bytes long;
-   HAYSTACK is HAYSTACKLEN bytes long.  */
-extern void *memmem (const void *__haystack, size_t __haystacklen,
-		     const void *__needle, size_t __needlelen)
-     __THROW __attribute_pure__ __nonnull ((1, 3));
+   HAYSTACK is HAYSTACKLEN bytes long.
+   [C]   extern void *memmem (const void *haystack, size_t haystacklen,
+                              const void *needle, size_t needlelen);
+   [C++] extern void *memmem (void *haystack, size_t haystacklen,
+                              const void *needle, size_t needlelen);
+         extern const void *memmem (const void *haystack, size_t haystacklen,
+                                    const void *needle, size_t needlelen);  */
+__CONST_COV_PROTO (memmem, __attribute_pure__ __nonnull ((1, 3)),
+                   void *, __haystack, size_t, __haystacklen,
+                   const void *, __needle, size_t, __needlelen);
 
 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
    last written byte.  */
@@ -487,15 +374,12 @@ extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1));
 /* Return the file name within directory of FILENAME.  We don't
    declare the function if the `basename' macro is available (defined
    in <libgen.h>) which makes the XPG version of this function
-   available.  */
-#  ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++" char *basename (char *__filename)
-     __THROW __asm ("basename") __nonnull ((1));
-extern "C++" const char *basename (const char *__filename)
-     __THROW __asm ("basename") __nonnull ((1));
-#  else
-extern char *basename (const char *__filename) __THROW __nonnull ((1));
-#  endif
+   available.
+   [C]   char *basename (const char *filename);
+   [C++] char *basename (char *filename);
+         const char *basename (const char *filename);  */
+__CONST_COV_PROTO (basename, __nonnull ((1)),
+                   char *, __filename);
 # endif
 #endif
 
diff --git a/string/strings.h b/string/strings.h
index f78eca5..a72530a 100644
--- a/string/strings.h
+++ b/string/strings.h
@@ -26,6 +26,7 @@
 #if defined __cplusplus && __GNUC_PREREQ (4, 4)
 # define __CORRECT_ISO_CPP_STRINGS_H_PROTO
 #endif
+#include <bits/const-covariance.h>
 
 __BEGIN_DECLS
 
@@ -41,61 +42,19 @@ extern void bcopy (const void *__src, void *__dest, size_t __n)
 /* Set N bytes of S to 0.  */
 extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
 
-/* Find the first occurrence of C in S (same as strchr).  */
-# ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO
-extern "C++"
-{
-extern char *index (char *__s, int __c)
-     __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
-extern const char *index (const char *__s, int __c)
-     __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
-
-#  if defined __OPTIMIZE__
-__extern_always_inline char *
-index (char *__s, int __c) __THROW
-{
-  return __builtin_index (__s, __c);
-}
-
-__extern_always_inline const char *
-index (const char *__s, int __c) __THROW
-{
-  return __builtin_index (__s, __c);
-}
-#  endif
-}
-# else
-extern char *index (const char *__s, int __c)
-     __THROW __attribute_pure__ __nonnull ((1));
-# endif
-
-/* Find the last occurrence of C in S (same as strrchr).  */
-# ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO
-extern "C++"
-{
-extern char *rindex (char *__s, int __c)
-     __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
-extern const char *rindex (const char *__s, int __c)
-     __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
-
-#  if defined __OPTIMIZE__
-__extern_always_inline char *
-rindex (char *__s, int __c) __THROW
-{
-  return __builtin_rindex (__s, __c);
-}
-
-__extern_always_inline const char *
-rindex (const char *__s, int __c) __THROW
-{
-  return __builtin_rindex (__s, __c);
-}
-#  endif
-}
-# else
-extern char *rindex (const char *__s, int __c)
-     __THROW __attribute_pure__ __nonnull ((1));
-# endif
+/* Find the first occurrence of C in S (same as strchr).
+   [C]    extern char *index (const char *s, int c);
+   [C++]  extern char *index (char *s, int c);
+          extern const char *index (const char *s, int c);  */
+__CONST_COV_BUILTIN (index, __attribute_pure__ __nonnull ((1)),
+                     char *, __s, int, __c);
+
+/* Find the last occurrence of C in S (same as strrchr).
+   [C]    extern char *rindex (const char *s, int c);
+   [C++]  extern char *rindex (char *s, int c);
+          extern const char *rindex (const char *s, int c);  */
+__CONST_COV_BUILTIN (rindex, __attribute_pure__ __nonnull ((1)),
+                     char *, __s, int, __c);
 #endif
 
 #if defined __USE_MISC || !defined __USE_XOPEN2K8 || defined __USE_XOPEN2K8XSI
@@ -106,11 +65,11 @@ extern int ffs (int __i) __THROW __attribute_const__;
 
 /* The following two functions are non-standard but necessary for non-32 bit
    platforms.  */
-# ifdef	__USE_GNU
+#ifdef	__USE_GNU
 extern int ffsl (long int __l) __THROW __attribute_const__;
 __extension__ extern int ffsll (long long int __ll)
      __THROW __attribute_const__;
-# endif
+#endif
 
 /* Compare S1 and S2, ignoring case.  */
 extern int strcasecmp (const char *__s1, const char *__s2)
diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
index 9686fcd..9d4d373 100644
--- a/wcsmbs/wchar.h
+++ b/wcsmbs/wchar.h
@@ -70,11 +70,6 @@ typedef __WINT_TYPE__ wint_t;
 __END_NAMESPACE_STD
 #  endif
 # endif
-
-/* Tell the caller that we provide correct C++ prototypes.  */
-# if defined __cplusplus && __GNUC_PREREQ (4, 4)
-#  define __CORRECT_ISO_CPP_WCHAR_H_PROTO
-# endif
 #endif
 
 #if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined
@@ -101,6 +96,12 @@ typedef struct
    defined.  */
 #ifdef _WCHAR_H
 
+/* Tell the caller that we provide correct C++ prototypes.  */
+# if defined __cplusplus && __GNUC_PREREQ (4, 4)
+#  define __CORRECT_ISO_CPP_WCHAR_H_PROTO
+# endif
+# include <bits/const-covariance.h>
+
 # ifndef __mbstate_t_defined
 __BEGIN_NAMESPACE_C99
 /* Public type.  */
@@ -221,33 +222,29 @@ extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__;
 #endif
 
 __BEGIN_NAMESPACE_STD
-/* Find the first occurrence of WC in WCS.  */
-#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
-extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc)
-     __THROW __asm ("wcschr") __attribute_pure__;
-extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc)
-     __THROW __asm ("wcschr") __attribute_pure__;
-#else
-extern wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc)
-     __THROW __attribute_pure__;
-#endif
-/* Find the last occurrence of WC in WCS.  */
-#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
-extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc)
-     __THROW __asm ("wcsrchr") __attribute_pure__;
-extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc)
-     __THROW __asm ("wcsrchr") __attribute_pure__;
-#else
-extern wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc)
-     __THROW __attribute_pure__;
-#endif
+/* Find the first occurrence of WC in WCS.
+   [C]   extern wchar_t *wcschr (const wchar_t *wcs, wchar_t wc);
+   [C++] extern wchar_t *wcschr (wchar_t *wcs, wchar_t wc);
+         extern const wchar_t *wcschr (const wchar_t *wcs, wchar_t wc); */
+__CONST_COV_PROTO (wcschr, __attribute_pure__,
+                   wchar_t *, __wcs, wchar_t, __wc);
+
+/* Find the last occurrence of WC in WCS.
+   [C]   extern wchar_t *wcsrchr (const wchar_t *wcs, wchar_t wc);
+   [C++] extern wchar_t *wcsrchr (wchar_t *wcs, wchar_t wc);
+         extern const wchar_t *wcsrchr (const wchar_t *wcs, wchar_t wc); */
+__CONST_COV_PROTO (wcsrchr, __attribute_pure__,
+                   wchar_t *, __wcs, wchar_t, __wc);
 __END_NAMESPACE_STD
 
 #ifdef __USE_GNU
 /* This function is similar to `wcschr'.  But it returns a pointer to
-   the closing NUL wide character in case C is not found in S.  */
-extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc)
-     __THROW __attribute_pure__;
+   the closing NUL wide character in case C is not found in S.
+   [C]   extern wchar_t *wcschrnul (const wchar_t *wcs, wchar_t wc);
+   [C++] extern wchar_t *wcschrnul (wchar_t *wcs, wchar_t wc);
+         extern const wchar_t *wcschrnul (const wchar_t *wcs, wchar_t wc); */
+__CONST_COV_PROTO (wcschrnul, __attribute_pure__,
+                   wchar_t *, __wcs, wchar_t, __wc);
 #endif
 
 __BEGIN_NAMESPACE_STD
@@ -259,28 +256,23 @@ extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
    consists entirely of wide characters in  ACCEPT.  */
 extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
      __THROW __attribute_pure__;
-/* Find the first occurrence in WCS of any character in ACCEPT.  */
-#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
-extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept)
-     __THROW __asm ("wcspbrk") __attribute_pure__;
-extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs,
-				     const wchar_t *__accept)
-     __THROW __asm ("wcspbrk") __attribute_pure__;
-#else
-extern wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept)
-     __THROW __attribute_pure__;
-#endif
-/* Find the first occurrence of NEEDLE in HAYSTACK.  */
-#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
-extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle)
-     __THROW __asm ("wcsstr") __attribute_pure__;
-extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack,
-				    const wchar_t *__needle)
-     __THROW __asm ("wcsstr") __attribute_pure__;
-#else
-extern wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle)
-     __THROW __attribute_pure__;
-#endif
+/* Find the first occurrence in WCS of any character in ACCEPT.
+   [C]   extern wchar_t *wcspbrk (const wchar_t *wcs, const wchar_t *accept);
+   [C++] extern wchar_t *wcspbrk (wchar_t *wcs, const wchar_t *accept);
+         extern const wchar_t *wcspbrk (const wchar_t *wcs,
+                                        const wchar_t *accept); */
+__CONST_COV_PROTO (wcspbrk, __attribute_pure__,
+                   wchar_t *, __wcs, const wchar_t *, __accept);
+
+/* Find the first occurrence of NEEDLE in HAYSTACK.
+   [C]   extern wchar_t *wcsstr (const wchar_t *haystack,
+                                 const wchar_t *needle);
+   [C++] extern wchar_t *wcsstr (wchar_t *haystack,
+                                 const wchar_t *needle);
+         extern const wchar_t *wcsstr (const wchar_t *haystack,
+                                       const wchar_t *needle); */
+__CONST_COV_PROTO (wcsstr, __attribute_pure__,
+                   wchar_t *, __haystack, const wchar_t *, __needle);
 
 /* Divide WCS into tokens separated by characters in DELIM.  */
 extern wchar_t *wcstok (wchar_t *__restrict __s,
@@ -292,17 +284,15 @@ extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__;
 __END_NAMESPACE_STD
 
 #ifdef __USE_XOPEN
-/* Another name for `wcsstr' from XPG4.  */
-# ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
-extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle)
-     __THROW __asm ("wcswcs") __attribute_pure__;
-extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack,
-				    const wchar_t *__needle)
-     __THROW __asm ("wcswcs") __attribute_pure__;
-# else
-extern wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle)
-     __THROW __attribute_pure__;
-# endif
+/* Another name for `wcsstr' from XPG4.
+   [C]   extern wchar_t *wcswcs (const wchar_t *haystack,
+                                 const wchar_t *needle);
+   [C++] extern wchar_t *wcswcs (wchar_t *haystack,
+                                 const wchar_t *needle);
+         extern const wchar_t *wcswcs (const wchar_t *haystack,
+                                       const wchar_t *needle); */
+__CONST_COV_PROTO (wcswcs, __attribute_pure__,
+                   wchar_t *, __haystack, const wchar_t *, __needle);
 #endif
 
 #ifdef __USE_XOPEN2K8
@@ -311,19 +301,14 @@ extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
      __THROW __attribute_pure__;
 #endif
 
-
 __BEGIN_NAMESPACE_STD
-/* Search N wide characters of S for C.  */
-#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
-extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
-     __THROW __asm ("wmemchr") __attribute_pure__;
-extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c,
-				     size_t __n)
-     __THROW __asm ("wmemchr") __attribute_pure__;
-#else
-extern wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n)
-     __THROW __attribute_pure__;
-#endif
+/* Search N wide characters of S for C.
+   [C]   extern wchar_t *wmemchr (const wchar_t *s, wchar_t wc, size_t n);
+   [C++] extern wchar_t *wmemchr (wchar_t *s, wchar_t wc, size_t n);
+         extern const wchar_t *wmemchr (const wchar_t *s, wchar_t wc,
+                                        size_t n); */
+__CONST_COV_PROTO (wmemchr, __attribute_pure__,
+                   wchar_t *, __s, wchar_t, __c, size_t, __n);
 
 /* Compare N wide characters of S1 and S2.  */
 extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=014aad38ce9d4155ae389b65100c614965305bdb

commit 014aad38ce9d4155ae389b65100c614965305bdb
Author: Zack Weinberg <zackw@panix.com>
Date:   Wed Nov 16 16:20:26 2016 -0500

    Clean up redundancies between string.h and strings.h.
    
    	* string/string.h [__USE_MISC]: Include strings.h.
    	(__bzero, bcmp, bcopy, bzero, index, rindex)
    	(strcasecmp, strncasecmp, strcasecmp_l, strncasecmp_l)
    	(ffs, ffsl, ffsll): Don't declare.
    
    	* string/strings.h: Do not suppress the file if string.h has
    	already been included.
    	(bcmp, bcopy, bzero, strcasecmp, strncasecmp): Add __nonnull
    	annotations.
    	(index, rindex): Define inline forwarders even if
    	__CORRECT_ISO_CPP_STRING_H_PROTO is defined.
    	(ffs): Use __attribute_const__.
    	(ffsl, ffsll): Declare here.
    	(strcasecmp_l, strncasecmp_l): Correct comments; these functions
    	have now been standardized.
    
    	* include/string.h (__bzero): Declare here.

diff --git a/include/string.h b/include/string.h
index e145bfd..749e691 100644
--- a/include/string.h
+++ b/include/string.h
@@ -41,6 +41,8 @@ extern void *__memrchr (const void *__s, int __c, size_t __n)
 extern void *__memchr (const void *__s, int __c, size_t __n)
      __attribute_pure__;
 
+extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
+
 extern int __ffs (int __i) __attribute__ ((const));
 
 extern char *__strerror_r (int __errnum, char *__buf, size_t __buflen);
diff --git a/string/string.h b/string/string.h
index b103e64..ca22cd0 100644
--- a/string/string.h
+++ b/string/string.h
@@ -440,110 +440,8 @@ extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
 extern char *strerror_l (int __errnum, __locale_t __l) __THROW;
 #endif
 
-
-/* We define this function always since `bzero' is sometimes needed when
-   the namespace rules does not allow this.  */
-extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
-
 #ifdef __USE_MISC
-/* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
-extern void bcopy (const void *__src, void *__dest, size_t __n)
-     __THROW __nonnull ((1, 2));
-
-/* Set N bytes of S to 0.  */
-extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
-
-/* Compare N bytes of S1 and S2 (same as memcmp).  */
-extern int bcmp (const void *__s1, const void *__s2, size_t __n)
-     __THROW __attribute_pure__ __nonnull ((1, 2));
-
-/* Find the first occurrence of C in S (same as strchr).  */
-# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++"
-{
-extern char *index (char *__s, int __c)
-     __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
-extern const char *index (const char *__s, int __c)
-     __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
-
-#  if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO
-__extern_always_inline char *
-index (char *__s, int __c) __THROW
-{
-  return __builtin_index (__s, __c);
-}
-
-__extern_always_inline const char *
-index (const char *__s, int __c) __THROW
-{
-  return __builtin_index (__s, __c);
-}
-#  endif
-}
-# else
-extern char *index (const char *__s, int __c)
-     __THROW __attribute_pure__ __nonnull ((1));
-# endif
-
-/* Find the last occurrence of C in S (same as strrchr).  */
-# ifdef __CORRECT_ISO_CPP_STRING_H_PROTO
-extern "C++"
-{
-extern char *rindex (char *__s, int __c)
-     __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
-extern const char *rindex (const char *__s, int __c)
-     __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
-
-#  if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRINGS_H_PROTO
-__extern_always_inline char *
-rindex (char *__s, int __c) __THROW
-{
-  return __builtin_rindex (__s, __c);
-}
-
-__extern_always_inline const char *
-rindex (const char *__s, int __c) __THROW
-{
-  return __builtin_rindex (__s, __c);
-}
-#endif
-}
-# else
-extern char *rindex (const char *__s, int __c)
-     __THROW __attribute_pure__ __nonnull ((1));
-# endif
-
-/* Return the position of the first bit set in I, or 0 if none are set.
-   The least-significant bit is position 1, the most-significant 32.  */
-extern int ffs (int __i) __THROW __attribute__ ((__const__));
-
-/* The following two functions are non-standard but necessary for non-32 bit
-   platforms.  */
-# ifdef	__USE_GNU
-extern int ffsl (long int __l) __THROW __attribute__ ((__const__));
-__extension__ extern int ffsll (long long int __ll)
-     __THROW __attribute__ ((__const__));
-# endif
-
-/* Compare S1 and S2, ignoring case.  */
-extern int strcasecmp (const char *__s1, const char *__s2)
-     __THROW __attribute_pure__ __nonnull ((1, 2));
-
-/* Compare no more than N chars of S1 and S2, ignoring case.  */
-extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
-     __THROW __attribute_pure__ __nonnull ((1, 2));
-#endif /* Use misc.  */
-
-#ifdef	__USE_GNU
-/* Again versions of a few functions which use the given locale instead
-   of the global one.  */
-extern int strcasecmp_l (const char *__s1, const char *__s2,
-			 __locale_t __loc)
-     __THROW __attribute_pure__ __nonnull ((1, 2, 3));
-
-extern int strncasecmp_l (const char *__s1, const char *__s2,
-			  size_t __n, __locale_t __loc)
-     __THROW __attribute_pure__ __nonnull ((1, 2, 4));
+# include <strings.h>
 #endif
 
 #ifdef	__USE_MISC
diff --git a/string/strings.h b/string/strings.h
index e372a33..f78eca5 100644
--- a/string/strings.h
+++ b/string/strings.h
@@ -18,35 +18,31 @@
 #ifndef	_STRINGS_H
 #define	_STRINGS_H	1
 
-/* We don't need and should not read this file if <string.h> was already
-   read. The one exception being that if __USE_MISC isn't defined, then
-   these aren't defined in string.h, so we need to define them here.  */
-#if !defined _STRING_H || !defined __USE_MISC
-
-# include <features.h>
-# define __need_size_t
-# include <stddef.h>
+#include <features.h>
+#define __need_size_t
+#include <stddef.h>
 
 /* Tell the caller that we provide correct C++ prototypes.  */
-# if defined __cplusplus && __GNUC_PREREQ (4, 4)
-#  define __CORRECT_ISO_CPP_STRINGS_H_PROTO
-# endif
+#if defined __cplusplus && __GNUC_PREREQ (4, 4)
+# define __CORRECT_ISO_CPP_STRINGS_H_PROTO
+#endif
 
 __BEGIN_DECLS
 
-# if defined __USE_MISC || !defined __USE_XOPEN2K8
+#if defined __USE_MISC || !defined __USE_XOPEN2K8
 /* Compare N bytes of S1 and S2 (same as memcmp).  */
 extern int bcmp (const void *__s1, const void *__s2, size_t __n)
-     __THROW __attribute_pure__;
+     __THROW __attribute_pure__ __nonnull ((1, 2));
 
 /* Copy N bytes of SRC to DEST (like memmove, but args reversed).  */
-extern void bcopy (const void *__src, void *__dest, size_t __n) __THROW;
+extern void bcopy (const void *__src, void *__dest, size_t __n)
+  __THROW __nonnull ((1, 2));
 
 /* Set N bytes of S to 0.  */
-extern void bzero (void *__s, size_t __n) __THROW;
+extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
 
 /* Find the first occurrence of C in S (same as strchr).  */
-#  ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO
+# ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO
 extern "C++"
 {
 extern char *index (char *__s, int __c)
@@ -54,7 +50,7 @@ extern char *index (char *__s, int __c)
 extern const char *index (const char *__s, int __c)
      __THROW __asm ("index") __attribute_pure__ __nonnull ((1));
 
-#   if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRING_H_PROTO
+#  if defined __OPTIMIZE__
 __extern_always_inline char *
 index (char *__s, int __c) __THROW
 {
@@ -66,15 +62,15 @@ index (const char *__s, int __c) __THROW
 {
   return __builtin_index (__s, __c);
 }
-#   endif
+#  endif
 }
-#  else
+# else
 extern char *index (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
-#  endif
+# endif
 
 /* Find the last occurrence of C in S (same as strrchr).  */
-#  ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO
+# ifdef __CORRECT_ISO_CPP_STRINGS_H_PROTO
 extern "C++"
 {
 extern char *rindex (char *__s, int __c)
@@ -82,7 +78,7 @@ extern char *rindex (char *__s, int __c)
 extern const char *rindex (const char *__s, int __c)
      __THROW __asm ("rindex") __attribute_pure__ __nonnull ((1));
 
-#   if defined __OPTIMIZE__ && !defined __CORRECT_ISO_CPP_STRING_H_PROTO
+#  if defined __OPTIMIZE__
 __extern_always_inline char *
 rindex (char *__s, int __c) __THROW
 {
@@ -94,39 +90,45 @@ rindex (const char *__s, int __c) __THROW
 {
   return __builtin_rindex (__s, __c);
 }
-#   endif
+#  endif
 }
-#  else
+# else
 extern char *rindex (const char *__s, int __c)
      __THROW __attribute_pure__ __nonnull ((1));
-#  endif
 # endif
+#endif
 
 #if defined __USE_MISC || !defined __USE_XOPEN2K8 || defined __USE_XOPEN2K8XSI
 /* Return the position of the first bit set in I, or 0 if none are set.
    The least-significant bit is position 1, the most-significant 32.  */
-extern int ffs (int __i) __THROW __attribute__ ((const));
+extern int ffs (int __i) __THROW __attribute_const__;
 #endif
 
+/* The following two functions are non-standard but necessary for non-32 bit
+   platforms.  */
+# ifdef	__USE_GNU
+extern int ffsl (long int __l) __THROW __attribute_const__;
+__extension__ extern int ffsll (long long int __ll)
+     __THROW __attribute_const__;
+# endif
+
 /* Compare S1 and S2, ignoring case.  */
 extern int strcasecmp (const char *__s1, const char *__s2)
-     __THROW __attribute_pure__;
+     __THROW __attribute_pure__ __nonnull ((1, 2));
 
 /* Compare no more than N chars of S1 and S2, ignoring case.  */
 extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
-     __THROW __attribute_pure__;
+     __THROW __attribute_pure__ __nonnull ((1, 2));
 
 #ifdef	__USE_XOPEN2K8
-/* The following functions are equivalent to the both above but they
-   take the locale they use for the collation as an extra argument.
-   This is not standardsized but something like will come.  */
 # include <xlocale.h>
 
-/* Again versions of a few functions which use the given locale instead
-   of the global one.  */
+/* Compare S1 and S2, ignoring case, using collation rules from LOC.  */
 extern int strcasecmp_l (const char *__s1, const char *__s2, __locale_t __loc)
      __THROW __attribute_pure__ __nonnull ((1, 2, 3));
 
+/* Compare no more than N chars of S1 and S2, ignoring case, using
+   collation rules from LOC.  */
 extern int strncasecmp_l (const char *__s1, const char *__s2,
 			  size_t __n, __locale_t __loc)
      __THROW __attribute_pure__ __nonnull ((1, 2, 4));
@@ -134,6 +136,4 @@ extern int strncasecmp_l (const char *__s1, const char *__s2,
 
 __END_DECLS
 
-#endif	/* string.h  */
-
 #endif	/* strings.h  */

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]