This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Pre-processor mismatch between [libc/machine/arm] strlen.c and strlen-armv7.s - may lead in duplicate definition


Somebody from arm can comment on this, please?


Thanks,
Corinna

On Aug  7 08:15, Markus Eisenmann wrote:
> 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 (in the first part):
> 
> ----------------------------------------------
> --- newlib/libc/machine/arm/strlen-armv7.S
> +++ 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__)))
> 
> ----------------------------------------------
> 
> Best regards from Salzburg,
> Markus

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: pgpQ75Opu0JN9.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]