This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: glibc-2.5 build with -Os broken on PowerPC
- From: sparky at pld-linux dot org
- To: libc-alpha at sourceware dot org
- Date: Thu, 2 Nov 2006 19:08:49 +0100
- Subject: Re: glibc-2.5 build with -Os broken on PowerPC
- References: <20061102172443.GB10028@pld-linux.org> <OFAA5C57AA.F3278A92-ON8625721A.0060A253-8625721A.00614919@us.ibm.com>
On Thu, Nov 02, 2006 at 11:42:37AM -0600, Steve Munroe wrote:
>
>
> sparky@pld-linux.org wrote on 11/02/2006 11:24:43 AM:
>
> > Hello.
> >
> > 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.
> >
> > This is because __CPU_HAS_FSQRT is defined in mathinline.h, which is not
> > included if glibc is built with -Os optimization (and shouldn't be).
> >
> > My fix/hack was to force mathinline.h inclusion in e_sqrt(f).c files:
> > http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/glibc-ppc-include-
> > mathinline.patch?rev=1.1
> > but I've been told it isn't a good idea.
> >
> > Probably __CPU_HAS_FSQRT definitions should be moved somewere else, but
> > I see no good place for it.
> >
>
> Builds for me with -O2 (libc default) so which gcc version are you using
> and which day did you pull glibc? And what configure options?
With -O2 builds for me too, but, as I said the __CPU_HAS_FSQRT
definition is in bits/mathinline.h. It is included from math.h:
/* Get machine-dependent inline versions (if there are any). */
#ifdef __USE_EXTERN_INLINES
# include <bits/mathinline.h>
#endif
And __USE_EXTERN_INLINES is defined in features.h as:
/* Decide whether we can define 'extern inline' functions in headers.
* */
#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
# define __USE_EXTERN_INLINES 1
#endif
So, if __OPTIMIZE_SIZE__ is enabled (defined by compiler when building
with -Os) mathinline.h file is not included.
I'm trying to compile glibc 2.5 from
ftp://sources.redhat.com/pub/glibc/releases/
and my gcc is some 4.1.2 snapshot
--
____ 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