diff options
Diffstat (limited to 'lib/libc/aarch64/string/Makefile.inc')
-rw-r--r-- | lib/libc/aarch64/string/Makefile.inc | 64 |
1 files changed, 52 insertions, 12 deletions
diff --git a/lib/libc/aarch64/string/Makefile.inc b/lib/libc/aarch64/string/Makefile.inc index 5ce355f8b0c1..35523fb954be 100644 --- a/lib/libc/aarch64/string/Makefile.inc +++ b/lib/libc/aarch64/string/Makefile.inc @@ -1,20 +1,60 @@ -# $FreeBSD$ # -# String handling from the Cortex Strings library -# https://git.linaro.org/toolchain/cortex-strings.git +# String handling from the Arm Optimized Routines +# https://github.com/ARM-software/optimized-routines # -.PATH: ${SRCTOP}/contrib/cortex-strings/src/aarch64 +AARCH64_STRING_FUNCS= \ + memcmp \ + memcpy \ + memmove \ + memrchr \ + memset \ + stpcpy \ + strchr \ + strchrnul \ + strcpy \ + strnlen \ + strrchr +# SIMD-enhanced routines not derived from Arm's code MDSRCS+= \ memchr.S \ - memcmp.S \ - memcpy.S \ - memmove.S \ - memset.S \ - strchr.S \ strcmp.S \ - strcpy.S \ - strlen.S \ + strspn.S \ + strcspn.S \ + strpbrk.c \ + strsep.c \ + strcat.c \ + strlcpy.S \ strncmp.S \ - strnlen.S + memccpy.S \ + strncat.c \ + strlcat.c \ + strlen.S \ + timingsafe_bcmp.S \ + timingsafe_memcmp.S \ + bcopy.c \ + bzero.c + +# +# Add the above functions. Generate an asm file that includes the needed +# Arm Optimized Routines file defining the function name to the libc name. +# Some file need multiple macros defined or a weak symbol added we can +# override the generated file in these cases. +# +.for FUNC in ${AARCH64_STRING_FUNCS} +.if !exists(${FUNC}.S) +${FUNC}.S: + printf '/* %sgenerated by libc/aarch64/string/Makefile.inc */\n' @ > ${.TARGET} + printf '#define __%s_aarch64 %s\n' ${FUNC} ${FUNC} >> ${.TARGET} + printf '#include "aarch64/%s.S"\n' ${FUNC} >> ${.TARGET} +CLEANFILES+= ${FUNC}.S +.endif + +MDSRCS+= ${FUNC}.S +CFLAGS.${FUNC}.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string +.endfor + +# memchr.S is a wrapper in the src tree for the implementation from +# arm-optimized-routines +CFLAGS.memchr.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string |