+2015-11-13 Marcus Shawcroft <marcus.shawcroft@arm.com>
+
+ * libc/machine/arm/Makefile.am: Adding strlen.S.
+ * libc/machine/arm/Makefile.in: Regenerate.
+ * libc/machine/arm/strlen.S: New.
+ * libc/machine/arm/strlen-stub.c: Rewrite #if condition.
+ * libc/machine/arm/strlen-armv7.S: Remove surrounding #if.
+
2015-11-13 Marcus Shawcroft <marcus.shawcroft@arm.com>
* libc/machine/arm/Makefile.am: Rename strlen.c to strlen-stub.c
noinst_LIBRARIES = lib.a
lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c \
- strlen-armv7.S aeabi_memcpy.c aeabi_memcpy-armv7a.S \
+ aeabi_memcpy.c aeabi_memcpy-armv7a.S \
aeabi_memmove.c aeabi_memmove-soft.S \
aeabi_memset.c aeabi_memset-soft.S aeabi_memclr.c
lib_a_SOURCES += memchr-stub.c
lib_a_SOURCES += memcpy-stub.c
lib_a_SOURCES += memcpy.S
lib_a_SOURCES += strlen-stub.c
+lib_a_SOURCES += strlen.S
lib_a_CCASFLAGS=$(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
lib_a_LIBADD =
am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-access.$(OBJEXT) \
lib_a-strcmp.$(OBJEXT) lib_a-strcpy.$(OBJEXT) \
- lib_a-strlen-armv7.$(OBJEXT) lib_a-aeabi_memcpy.$(OBJEXT) \
+ lib_a-aeabi_memcpy.$(OBJEXT) \
lib_a-aeabi_memcpy-armv7a.$(OBJEXT) \
lib_a-aeabi_memmove.$(OBJEXT) \
lib_a-aeabi_memmove-soft.$(OBJEXT) \
lib_a-aeabi_memset.$(OBJEXT) lib_a-aeabi_memset-soft.$(OBJEXT) \
lib_a-aeabi_memclr.$(OBJEXT) lib_a-memchr-stub.$(OBJEXT) \
lib_a-memchr.$(OBJEXT) lib_a-memcpy-stub.$(OBJEXT) \
- lib_a-memcpy.$(OBJEXT) lib_a-strlen-stub.$(OBJEXT)
+ lib_a-memcpy.$(OBJEXT) lib_a-strlen-stub.$(OBJEXT) \
+ lib_a-strlen.$(OBJEXT)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp =
INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
AM_CCASFLAGS = $(INCLUDES)
noinst_LIBRARIES = lib.a
-lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c strlen-armv7.S \
- aeabi_memcpy.c aeabi_memcpy-armv7a.S aeabi_memmove.c \
- aeabi_memmove-soft.S aeabi_memset.c aeabi_memset-soft.S \
- aeabi_memclr.c memchr-stub.c memchr.S memcpy-stub.c memcpy.S \
- strlen-stub.c
+lib_a_SOURCES = setjmp.S access.c strcmp.S strcpy.c aeabi_memcpy.c \
+ aeabi_memcpy-armv7a.S aeabi_memmove.c aeabi_memmove-soft.S \
+ aeabi_memset.c aeabi_memset-soft.S aeabi_memclr.c \
+ memchr-stub.c memchr.S memcpy-stub.c memcpy.S strlen-stub.c \
+ strlen.S
lib_a_CCASFLAGS = $(AM_CCASFLAGS)
lib_a_CFLAGS = $(AM_CFLAGS)
ACLOCAL_AMFLAGS = -I ../../.. -I ../../../..
lib_a-strcmp.obj: strcmp.S
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strcmp.obj `if test -f 'strcmp.S'; then $(CYGPATH_W) 'strcmp.S'; else $(CYGPATH_W) '$(srcdir)/strcmp.S'; fi`
-lib_a-strlen-armv7.o: strlen-armv7.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strlen-armv7.o `test -f 'strlen-armv7.S' || echo '$(srcdir)/'`strlen-armv7.S
-
-lib_a-strlen-armv7.obj: strlen-armv7.S
- $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strlen-armv7.obj `if test -f 'strlen-armv7.S'; then $(CYGPATH_W) 'strlen-armv7.S'; else $(CYGPATH_W) '$(srcdir)/strlen-armv7.S'; fi`
-
lib_a-aeabi_memcpy-armv7a.o: aeabi_memcpy-armv7a.S
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-aeabi_memcpy-armv7a.o `test -f 'aeabi_memcpy-armv7a.S' || echo '$(srcdir)/'`aeabi_memcpy-armv7a.S
lib_a-memcpy.obj: memcpy.S
$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-memcpy.obj `if test -f 'memcpy.S'; then $(CYGPATH_W) 'memcpy.S'; else $(CYGPATH_W) '$(srcdir)/memcpy.S'; fi`
+lib_a-strlen.o: strlen.S
+ $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strlen.o `test -f 'strlen.S' || echo '$(srcdir)/'`strlen.S
+
+lib_a-strlen.obj: strlen.S
+ $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CCASFLAGS) $(CCASFLAGS) -c -o lib_a-strlen.obj `if test -f 'strlen.S'; then $(CYGPATH_W) 'strlen.S'; else $(CYGPATH_W) '$(srcdir)/strlen.S'; fi`
+
.c.o:
$(COMPILE) -c $<
lib_a-memcpy-stub.obj: memcpy-stub.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcpy-stub.obj `if test -f 'memcpy-stub.c'; then $(CYGPATH_W) 'memcpy-stub.c'; else $(CYGPATH_W) '$(srcdir)/memcpy-stub.c'; fi`
-lib_a-strlen.o: strlen.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlen.o `test -f 'strlen.c' || echo '$(srcdir)/'`strlen.c
+lib_a-strlen-stub.o: strlen-stub.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlen-stub.o `test -f 'strlen-stub.c' || echo '$(srcdir)/'`strlen-stub.c
-lib_a-strlen.obj: strlen.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlen.obj `if test -f 'strlen.c'; then $(CYGPATH_W) 'strlen.c'; else $(CYGPATH_W) '$(srcdir)/strlen.c'; fi`
+lib_a-strlen-stub.obj: strlen-stub.c
+ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-strlen-stub.obj `if test -f 'strlen-stub.c'; then $(CYGPATH_W) 'strlen-stub.c'; else $(CYGPATH_W) '$(srcdir)/strlen-stub.c'; fi`
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
#include "arm_asm.h"
-/* NOTE: This ifdef MUST match the ones in arm/strlen.c
- We fallback to the one in arm/strlen.c for size optimised or
- for older architectures. */
-#if (defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__)) && \
- !(defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
- (defined (__thumb__) && !defined (__thumb2__)))
-
.macro def_fn f p2align=0
.text
.p2align \p2align
mov const_0, #0
b .Lstart_realigned
.size strlen, . - strlen
-
-#endif
#if defined __thumb__ && ! defined __thumb2__
#include "../../string/strlen.c"
-#elif defined _ISA_ARM_7 || defined __ARM_ARCH_6T2__
- /* Implemented in strlen-armv7.S. */
+#elif (__ARM_ARCH >= 7 && defined __ARM_ARCH_ISA_ARM) || defined __ARM_ARCH_6T2__
+ /* Implemented in strlen.S. */
#else
size_t __attribute__((naked))
--- /dev/null
+/* Copyright (c) 2015 ARM Ltd.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the Linaro nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+
+#include "acle-compat.h"
+
+#if defined __OPTIMIZE_SIZE__ || defined PREFER_SIZE_OVER_SPEED
+#if defined __thumb__ && !defined __thumb2__
+ /* Implemented in strlen-stub.c. */
+
+#else
+ /* Implemented in strlen-stub.c. */
+
+#endif
+
+#else /* defined __OPTIMIZE_SIZE__ || defined PREFER_SIZE_OVER_SPEED */
+#if defined __thumb__ && ! defined __thumb2__
+ /* Implemented in strlen-stub.c. */
+
+#elif (__ARM_ARCH >= 7 && defined __ARM_ARCH_ISA_ARM) || defined __ARM_ARCH_6T2__
+#include "strlen-armv7.S"
+
+#else
+ /* Implemented in strlen-stub.c. */
+#endif
+#endif