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]

Don't force -msoft-float for powerpc --without-fp


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.

diff --git a/sysdeps/powerpc/powerpc32/Makefile b/sysdeps/powerpc/powerpc32/Makefile
index 64f7900..3fdb4b4 100644
--- a/sysdeps/powerpc/powerpc32/Makefile
+++ b/sysdeps/powerpc/powerpc32/Makefile
@@ -1,10 +1,5 @@
 # Powerpc32 specific build options.
 
-ifeq ($(with-fp),no)
-+cflags += -msoft-float
-sysdep-LDFLAGS += -msoft-float
-endif
-
 ifeq ($(subdir),gmon)
 sysdep_routines += ppc-mcount compat-ppc-mcount
 static-only-routines += ppc-mcount

-- 
Joseph S. Myers
joseph@codesourcery.com


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