This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Don't force -msoft-float for powerpc --without-fp
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org, "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- Date: Tue, 17 Sep 2013 17:07:14 -0400
- Subject: Re: Don't force -msoft-float for powerpc --without-fp
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1309172043130 dot 15396 at digraph dot polyomino dot org dot uk>
On 09/17/2013 04:44 PM, Joseph S. Myers wrote:
> sysdeps/powerpc/powerpc32/Makefile adds a -msoft-float compiler option
> if glibc is configured --without-fp. This breaks use of --without-fp
> for the e500 port, since while that uses the soft-float ABI, at the
> compiler level it's hard-float, just not the classic hard-float that
> glibc counts as --with-fp.
>
> This patch eliminates the special-case code, in line with the
> principle that the compiler needs to be correctly configured to
> generate code for the desired ABI (CC can be
> e.g. "powerpc-linux-gnu-gcc -msoft-float" if desired) and glibc
> shouldn't be overriding that. Really the similar -mhard-float
> additions in ports/sysdeps/powerpc/powerpc32/Makefile should be
> removed as well (I think they are a workaround for e.g. -mcpu=476
> meaning soft-float, but there are at least two alternative approaches
> for that issue: set up sysdeps directories such as 476fp so that the
> corresponding --with-cpu options can be used without implying
> -msoft-float, and using CC="powerpc-linux-gnu-gcc -mhard-float" so the
> explicit option takes precedence over the -mcpu from --with-cpu), but
> that's not needed for the present e500 port work. Also, if these
> optimized string functions end up in libc and selected at runtime
> using IFUNC machinery instead of at compile time, --with-cpu will
> become irrelevant for them.
>
> By now I think there is general support for always making the compiler
> configuration determine sysdeps selection and --with-cpu only serving
> to modify the CC setting (and reducing the significance of the triplet
> for which glibc is configured), as discussed in
> <https://sourceware.org/ml/libc-alpha/2013-04/msg00357.html>. As
> noted in <https://sourceware.org/ml/libc-alpha/2013-04/msg00393.html>,
> that would also subsume --with-fp settings. Given that it's quite
> easy to forget to pass the right options (on architectures where
> --without-fp is valid and distinct from --with-fp), moving to
> autodetection of floating-point configuration seems appropriate to me.
>
> 2013-09-17 Joseph Myers <joseph@codesourcery.com>
>
> * sysdeps/powerpc/powerpc32/Makefile [$(with-fp) = no] (+cflags):
> Do not append -msoft-float.
> [$(with-fp) = no] (sysdep-LDFLAGS): Likewise.
Looks good to me.
I am in agreement that this selection should happen based on the
compiler configuration ($CC).
c.