mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Switch to Arm Optimized Routines for mem* & str*
These are the updated version of the older Cortex Strings Library we previously used. The Arm Optimized Routines also support CPU features that are currently in development on FreeBSD, e.g. Branch Target Identification (BTI). Rather than add BTI support to the old code it's easier to just use the maintained version. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32774
This commit is contained in:
parent
f6842865d3
commit
2e8ff4d1d5
|
@ -1,20 +1,41 @@
|
|||
# $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= \
|
||||
memchr \
|
||||
memcmp \
|
||||
memcpy \
|
||||
memmove \
|
||||
memrchr \
|
||||
memset \
|
||||
stpcpy \
|
||||
strchr \
|
||||
strchrnul \
|
||||
strcmp \
|
||||
strcpy \
|
||||
strlen \
|
||||
strncmp \
|
||||
strnlen \
|
||||
strrchr
|
||||
|
||||
MDSRCS+= \
|
||||
memchr.S \
|
||||
memcmp.S \
|
||||
memcpy.S \
|
||||
memmove.S \
|
||||
memset.S \
|
||||
strchr.S \
|
||||
strcmp.S \
|
||||
strcpy.S \
|
||||
strlen.S \
|
||||
strncmp.S \
|
||||
strnlen.S
|
||||
#
|
||||
# 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
|
||||
|
|
6
lib/libc/aarch64/string/memcpy.S
Normal file
6
lib/libc/aarch64/string/memcpy.S
Normal file
|
@ -0,0 +1,6 @@
|
|||
#define __memcpy_aarch64 memcpy
|
||||
#define __memmove_aarch64 memmove
|
||||
#include "aarch64/memcpy.S"
|
||||
|
||||
.weak index
|
||||
.equ index, strchr
|
5
lib/libc/aarch64/string/memmove.S
Normal file
5
lib/libc/aarch64/string/memmove.S
Normal file
|
@ -0,0 +1,5 @@
|
|||
/*
|
||||
* memmove is implemented in memcpy.S. Having this file simplifies the build
|
||||
* as it stops MISRCS from picking up the C implementation and rtld expects
|
||||
* to copy the memmove object file into its object directory.
|
||||
*/
|
5
lib/libc/aarch64/string/strchr.S
Normal file
5
lib/libc/aarch64/string/strchr.S
Normal file
|
@ -0,0 +1,5 @@
|
|||
#define __strchr_aarch64 strchr
|
||||
#include "aarch64/strchr.S"
|
||||
|
||||
.weak index
|
||||
.equ index, strchr
|
5
lib/libc/aarch64/string/strrchr.S
Normal file
5
lib/libc/aarch64/string/strrchr.S
Normal file
|
@ -0,0 +1,5 @@
|
|||
#define __strrchr_aarch64 strrchr
|
||||
#include "aarch64/strrchr.S"
|
||||
|
||||
.weak rindex
|
||||
.equ rindex, strrchr
|
Loading…
Reference in a new issue