[20/20] libcpu-rt-c/x86-64: Add strrchr
Commit Message
* sysdeps/x86_64/Makefile (cpu-rt-c-routines): Add strrchr.
* sysdeps/x86_64/multiarch/Makefile
(libcpu-rt-c-sysdep_routines): strrchr-sse2 and strrchr-avx2.
* sysdeps/x86_64/multiarch/strrchr-avx2.S: Support libcpu-rt-c.
* sysdeps/x86_64/multiarch/strrchr-sse2.S: Likewise.
* sysdeps/x86_64/multiarch/strrchr.c: Likewise.
---
sysdeps/x86_64/Makefile | 2 +-
sysdeps/x86_64/multiarch/Makefile | 2 +-
sysdeps/x86_64/multiarch/strrchr-avx2.S | 2 +-
sysdeps/x86_64/multiarch/strrchr-sse2.S | 2 +-
sysdeps/x86_64/multiarch/strrchr.c | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
@@ -149,7 +149,7 @@ endif
ifeq ($(subdir),cpu-rt-c)
cpu-rt-c-routines += memchr memcmp memcpy memmove mempcpy memrchr \
memset strcat strchr strcmp strcpy strlen strncat \
- strnlen strncmp strncpy \
+ strnlen strncmp strncpy strrchr \
wmemset
# For the CPU run-time tests.
@@ -93,5 +93,5 @@ libcpu-rt-c-sysdep_routines += memchr-sse2 memchr-avx2 \
strnlen-sse2 strnlen-avx2 strncmp-sse2 \
strncmp-ssse3 strncmp-sse4_2 strncmp-avx2 \
strncpy-c strncpy-sse2-unaligned \
- strncpy-ssse3
+ strncpy-ssse3 strrchr-sse2 strrchr-avx2
endif
@@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
+#if IS_IN (libc) || IS_IN (libcpu_rt_c)
# include <sysdep.h>
@@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
+#if IS_IN (libc) || IS_IN (libcpu_rt_c)
# define strrchr __strrchr_sse2
# undef weak_alias
@@ -17,7 +17,7 @@
<http://www.gnu.org/licenses/>. */
/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
+#if IS_IN (libc) || IS_IN (libcpu_rt_c)
# define strrchr __redirect_strrchr
# include <string.h>
# undef strrchr
@@ -27,7 +27,7 @@
libc_ifunc_redirected (__redirect_strrchr, strrchr, IFUNC_SELECTOR ());
weak_alias (strrchr, rindex);
-# ifdef SHARED
+# if defined SHARED && !IS_IN (libcpu_rt_c)
__hidden_ver1 (strrchr, __GI_strrchr, __redirect_strrchr)
__attribute__((visibility ("hidden")));
# endif