This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: glibc-2.5 build with -Os broken on PowerPC


On Fri, Nov 03, 2006 at 12:28:39PM +0100, sparky@pld-linux.org wrote:
> On Thu, Nov 02, 2006 at 07:08:49PM +0100, sparky@pld-linux.org wrote:
> 
> > > > glibc 2.5 does not compile on PowerPC with -Os. It fails on:
> > > >  sysdeps/powerpc/fpu/e_sqrt.c
> > > > and
> > > >  sysdeps/powerpc/fpu/e_sqrtf.c
> > > > because of undefined reference to __CPU_HAS_FSQRT.
> 
> Maybe attached patch would be a suitable solution. It simply does not
> include that code if __CPU_HAS_FSQRT is not defined.

That should be better written as
#ifndef __CPU_HAS_FSQRT
# define __CPU_HAS_FSQRT 0
#endif
above the functions rather than cluttering the functions with #ifdefs.

> --- libc/sysdeps/powerpc/fpu/e_sqrt.c~	2006-04-14 08:44:30.000000000 +0300
> +++ libc/sysdeps/powerpc/fpu/e_sqrt.c	2006-11-03 13:24:10.000000000 +0200
> @@ -169,6 +169,8 @@
>  {
>    double z;
>  
> +  /* If __CPU_HAS_FSQRT is not defined means we don't want optimization */
> +#ifdef __CPU_HAS_FSQRT
>    /* If the CPU is 64-bit we can use the optional FP instructions.  */
>    if (__CPU_HAS_FSQRT)
>      {
> @@ -178,6 +180,7 @@
>  				:"=f" (z):"f" (x));
>      }
>    else
> +#endif
>      z = __slow_ieee754_sqrt (x);
>  
>    return z;
> --- libc/sysdeps/powerpc/fpu/e_sqrtf.c~	2006-04-14 08:44:30.000000000 +0300
> +++ libc/sysdeps/powerpc/fpu/e_sqrtf.c	2006-11-03 13:24:57.000000000 +0200
> @@ -146,6 +146,8 @@
>  {
>    double z;
>  
> +  /* If __CPU_HAS_FSQRT is not defined means we don't want optimization */
> +#ifdef __CPU_HAS_FSQRT
>    /* If the CPU is 64-bit we can use the optional FP instructions.  */
>    if (__CPU_HAS_FSQRT)
>      {
> @@ -155,6 +157,7 @@
>  				:"=f" (z):"f" (x));
>      }
>    else
> +#endif
>      z = __slow_ieee754_sqrtf (x);
>  
>    return z;


	Jakub


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