glibc-2.5 build with -Os broken on PowerPC

sparky@pld-linux.org sparky@pld-linux.org
Fri Nov 3 11:28:00 GMT 2006


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.

-- 
 ____  Sparky{PI] -- Przemyslaw _  ___  _  _  ........... LANG...Pl..Ca..Es..En
/____) ___  ___  _ _ || Iskra  |  | _ \| |  | : WWW........ppcrcd.pld-linux.org
\____\| -_)'___| ||^'||//\\// <   |  _/| |  | : JID......sparky<at>jabberes.org
(____/||   (_-_|_||  ||\\ ||   |_ |_|  |_| _| : Mail....sparky<at>pld-linux.org
-------------- next part --------------
--- 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;


More information about the Libc-alpha mailing list