[newlib-cygwin] strlen-armv7.S: Fix preprocessor check
Corinna Vinschen
corinna@sourceware.org
Thu Aug 27 10:55:00 GMT 2015
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e6d9af11f1f21a70a6d947ab452ac4d82caace64
commit e6d9af11f1f21a70a6d947ab452ac4d82caace64
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Thu Aug 27 12:55:22 2015 +0200
strlen-armv7.S: Fix preprocessor check
Hi!
I've got the situation, that the function strlen() occurs twice in libc.a
(building newlib for ARM-V7a and Size-Optimized).
In newlib/libc/machine/arm/strlen.c there are the pre-processor stetements ...
#if defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
(defined (__thumb__) && !defined (__thumb2__))
/*...*/
#else
#if !(defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__))
/*...*/
#endif
and in newlib/libc/machine/arm/strlen-armv7.S the "exclude" begins with
/* 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__)))
But this is not completely contrary to arm/strlen.c (see above)!
To fix the logical statement in arm/strlen-armv7.S there are parentheses needed
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
newlib/ChangeLog | 5 +++++
newlib/libc/machine/arm/strlen-armv7.S | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index afabb04..674ff12 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-27 Markus Eisenmann <meisenmann.lba@fh-salzburg.ac.at>
+
+ * libc/machine/arm/strlen-armv7.S: Fix prepocessor check to avoid
+ double definition of strlen.
+
2015-08-27 Andre Vieira <andre.simoesdiasvieira@arm.com>
* libc/include/sys/_intsup.h: Defined new __INTxx, __FASTxx and
diff --git a/newlib/libc/machine/arm/strlen-armv7.S b/newlib/libc/machine/arm/strlen-armv7.S
index 1aa51c9..cb6ba08 100644
--- a/newlib/libc/machine/arm/strlen-armv7.S
+++ b/newlib/libc/machine/arm/strlen-armv7.S
@@ -37,7 +37,7 @@
/* 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__) && \
+#if (defined(_ISA_ARM_7) || defined(__ARM_ARCH_6T2__)) && \
!(defined (__OPTIMIZE_SIZE__) || defined (PREFER_SIZE_OVER_SPEED) || \
(defined (__thumb__) && !defined (__thumb2__)))
More information about the Newlib-cvs
mailing list