diff options
author | ed <ed@FreeBSD.org> | 2012-01-03 07:14:01 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-01-03 07:14:01 +0000 |
commit | 6014007e0092971acca93d674c9cc07855981aef (patch) | |
tree | 8ab3a468a2bb64fe48da5a2fa68950bee0300453 /lib/libstand | |
parent | 29cd68a581450e8d265ffcd2f82de6bcd65778c6 (diff) | |
download | FreeBSD-src-6014007e0092971acca93d674c9cc07855981aef.zip FreeBSD-src-6014007e0092971acca93d674c9cc07855981aef.tar.gz |
Merge index() and strchr() together.
As I looked through the C library, I noticed the FreeBSD MIPS port has a
hand-written version of index(). This is nice, if it weren't for the
fact that most applications call strchr() instead.
Also, on the other architectures index() and strchr() are identical,
meaning we have two identical pieces of code in the C library and
statically linked applications.
Solve this by naming the actual file strchr.[cS] and let it use
__strong_reference()/STRONG_ALIAS() to provide the index() routine. Do
the same for rindex()/strrchr().
This seems to make the C libraries and static binaries slightly smaller,
but this reduction in size seems negligible.
Diffstat (limited to 'lib/libstand')
-rw-r--r-- | lib/libstand/Makefile | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile index 05f0995..567c886 100644 --- a/lib/libstand/Makefile +++ b/lib/libstand/Makefile @@ -54,10 +54,10 @@ SRCS+= ntoh.c .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "powerpc" || \ ${MACHINE_CPUARCH} == "sparc64" || ${MACHINE_CPUARCH} == "amd64" || \ ${MACHINE_CPUARCH} == "arm" -SRCS+= bcmp.c bcopy.c bzero.c ffs.c index.c memccpy.c memchr.c memcmp.c \ - memcpy.c memmove.c memset.c qdivrem.c rindex.c strcat.c strchr.c \ - strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c strncpy.c \ - strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c +SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \ + memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \ + strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \ + strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c .endif .if ${MACHINE_CPUARCH} == "arm" .PATH: ${.CURDIR}/../libc/arm/gen @@ -65,10 +65,9 @@ SRCS+= divsi3.S .endif .if ${MACHINE_CPUARCH} == "ia64" .PATH: ${.CURDIR}/../libc/ia64/string -SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \ - memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \ - strcmp.c strcpy.c strcspn.c strlen.c \ - strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ +SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \ + memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \ + strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \ strspn.c strstr.c strtok.c swab.c .PATH: ${.CURDIR}/../libc/ia64/gen |