[19/20] libcpu-rt-c/x86-64: Add strncpy
Commit Message
* sysdeps/x86_64/Makefile (cpu-rt-c-routines): Add strncpy.
* sysdeps/x86_64/multiarch/Makefile
(libcpu-rt-c-sysdep_routines): Add strncpy-c,
strncpy-sse2-unaligned and strncpy-ssse3.
* sysdeps/x86_64/multiarch/strncpy.c: Support libcpu-rt-c.
---
sysdeps/x86_64/Makefile | 2 +-
sysdeps/x86_64/multiarch/Makefile | 4 +++-
sysdeps/x86_64/multiarch/strncpy.c | 4 ++--
3 files changed, 6 insertions(+), 4 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 \
+ strnlen strncmp strncpy \
wmemset
# For the CPU run-time tests.
@@ -91,5 +91,7 @@ libcpu-rt-c-sysdep_routines += memchr-sse2 memchr-avx2 \
strlen-sse2 strlen-avx2 strncat-c \
strncat-sse2-unaligned strncat-ssse3 \
strnlen-sse2 strnlen-avx2 strncmp-sse2 \
- strncmp-ssse3 strncmp-sse4_2 strncmp-avx2
+ strncmp-ssse3 strncmp-sse4_2 strncmp-avx2 \
+ strncpy-c strncpy-sse2-unaligned \
+ strncpy-ssse3
endif
@@ -18,7 +18,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 strncpy __redirect_strncpy
# include <string.h>
# undef strncpy
@@ -28,7 +28,7 @@
libc_ifunc_redirected (__redirect_strncpy, strncpy, IFUNC_SELECTOR ());
-# ifdef SHARED
+# if defined SHARED && !IS_IN (libcpu_rt_c)
__hidden_ver1 (strncpy, __GI_strncpy, __redirect_strncpy)
__attribute__ ((visibility ("hidden")));
# endif