This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Fix x86 strcasecmp_l (bug 13786)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-alpha at sourceware dot org
- Date: Wed, 29 Feb 2012 21:51:28 +0000 (UTC)
- Subject: Fix x86 strcasecmp_l (bug 13786)
I've noticed a test failure of localedata/tst-xlocale1 on x86 lately, and
it also appears in Carlos's 2.15 results at
<http://sourceware.org/glibc/wiki/Release/2.15>.
The cause is the multiarch implementation.
sysdeps/i386/i686/multiarch/strcmp.S can be used for four different
functions, and in all cases except strncmp it ends up including
../strcmp.S to provide the fallback implementation for the older systems.
However, ../strcmp.S has no support for being strcasecmp_l or
strncasecmp_l; the effect is that those functions, on x86 systems without
SSSE3, act as strcmp, causing the test failure.
This patch fixes the problem (localedata tests passed on i686, full tests
running). OK subject to the full tests completing successfully?
I've filed bug 13786 for this issue as per the recently discussed
principle of filing bugs for problems you fix.
2012-02-29 Joseph Myers <joseph@codesourcery.com>
[BZ #13786]
* sysdeps/i386/i686/multiarch/strcmp.S [USE_AS_STRCASECMP_L]: Do
not include ../strcmp.S.
[USE_AS_STRNCASECMP_L]: Likewise.
* sysdeps/i386/i686/multiarch/strcasecmp_l-c.c
(__strcasecmp_l_ia32): Define as alias to __strcasecmp_l_nonascii.
* sysdeps/i386/i686/multiarch/strncase_l-c.c
(__strncasecmp_l_ia32): Define as alias to
__strncasecmp_l_nonascii.
diff --git a/sysdeps/i386/i686/multiarch/strcasecmp_l-c.c b/sysdeps/i386/i686/multiarch/strcasecmp_l-c.c
index d10e872..d4fcd2b 100644
--- a/sysdeps/i386/i686/multiarch/strcasecmp_l-c.c
+++ b/sysdeps/i386/i686/multiarch/strcasecmp_l-c.c
@@ -6,6 +6,8 @@ extern __typeof (strcasecmp_l) __strcasecmp_l_nonascii;
#define USE_IN_EXTENDED_LOCALE_MODEL 1
#include <string/strcasecmp.c>
+strong_alias (__strcasecmp_l_nonascii, __strcasecmp_l_ia32)
+
/* The needs of strcasecmp in libc are minimal, no need to go through
the IFUNC. */
strong_alias (__strcasecmp_l_nonascii, __GI___strcasecmp_l)
diff --git a/sysdeps/i386/i686/multiarch/strcmp.S b/sysdeps/i386/i686/multiarch/strcmp.S
index 5410d17..b3b9eb8 100644
--- a/sysdeps/i386/i686/multiarch/strcmp.S
+++ b/sysdeps/i386/i686/multiarch/strcmp.S
@@ -111,6 +111,7 @@ END(STRCMP)
# endif
#endif
-#ifndef USE_AS_STRNCMP
+#if !defined USE_AS_STRNCMP && !defined USE_AS_STRCASECMP_L \
+ && !defined USE_AS_STRNCASECMP_L
# include "../strcmp.S"
#endif
diff --git a/sysdeps/i386/i686/multiarch/strncase_l-c.c b/sysdeps/i386/i686/multiarch/strncase_l-c.c
index 0c68b8d..7e601af 100644
--- a/sysdeps/i386/i686/multiarch/strncase_l-c.c
+++ b/sysdeps/i386/i686/multiarch/strncase_l-c.c
@@ -6,6 +6,8 @@ extern __typeof (strncasecmp_l) __strncasecmp_l_nonascii;
#define USE_IN_EXTENDED_LOCALE_MODEL 1
#include <string/strncase.c>
+strong_alias (__strncasecmp_l_nonascii, __strncasecmp_l_ia32)
+
/* The needs of strcasecmp in libc are minimal, no need to go through
the IFUNC. */
strong_alias (__strncasecmp_l_nonascii, __GI___strncasecmp_l)
--
Joseph S. Myers
joseph@codesourcery.com