[PATCH] Fix glibc build on ppc64

Jakub Jelinek jakub@redhat.com
Mon Jan 30 16:53:00 GMT 2006


Hi!

The addition of
  if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128)                      \
    {                                                                   \
      rs6000_long_double_type_size = 64;                                \
      if (rs6000_explicit_options.long_double)                          \
        warning (0, "soft-float and long-double-128 are incompatible"); \
    }                                                                   \
(well, not the warning, but the rs6000_long_double_type_size = 64;
part) broke glibc build.
A few files are built with -msoft-float to ensure that they don't
touch floating point registers.  They normally don't do any floating
point arithmetics.
find . -name Makefile | xargs grep msoft-float
./sysdeps/powerpc/powerpc64/Makefile:# Compiling with -msoft-float ensures that fp regs are not used
./sysdeps/powerpc/powerpc64/Makefile:CFLAGS-mcount.c += -msoft-float
./sysdeps/powerpc/powerpc64/elf/Makefile:CFLAGS-dl-runtime.os := -msoft-float
./sysdeps/powerpc/powerpc64/elf/Makefile:CFLAGS-dl-lookup.os := -msoft-float
./sysdeps/powerpc/powerpc64/elf/Makefile:CFLAGS-dl-misc.os := -msoft-float
./sysdeps/powerpc/powerpc64/elf/Makefile:CFLAGS-rtld-mempcpy.os := -msoft-float
./sysdeps/powerpc/powerpc64/elf/Makefile:CFLAGS-rtld-memmove.os := -msoft-float
./sysdeps/powerpc/powerpc64/elf/Makefile:CFLAGS-rtld-memchr.os := -msoft-float
./sysdeps/powerpc/powerpc64/elf/Makefile:CFLAGS-rtld-strnlen.os := -msoft-float
./sysdeps/powerpc/powerpc32/Makefile:+cflags += -msoft-float
./sysdeps/powerpc/powerpc32/Makefile:sysdep-LDFLAGS += -msoft-float
The powerpc32 hunks are just for
ifeq ($(with-fp),no)
+cflags += -msoft-float
sysdep-LDFLAGS += -msoft-float
endif
so in that case it is desirable to have -mlong-double-64 (though, we for
--without-fp don't enable -mlong-double-128 in the Makefiles/configury).
The following patch moves us back to building land, we'll get a warning
and as we are lucky, even when the files are compiled with the implied
-mlong-double-64 in the end, it works.  But there could be potentially
problems if ever in the future say ldsodefs.h uses long double in
some structure and its layout changes because of that.
Perhaps GCC could do instead:
  if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128)                      \
    {                                                                   \
      if (rs6000_explicit_options.long_double)                          \
        warning (0, "soft-float and long-double-128 are incompatible"); \
      else								\
	rs6000_long_double_type_size = 64;                              \
    }                                                                   \
i.e. if -mlong-double{64,128} isn't used explicitely, -msoft-float
silently defaults to -mlong-double-128, otherwise there is a warning
but it is up to the user to know what he is doing (i.e. either
not actually use floating point emulation functions, or supply the needed
emulation functions).

2006-01-30  Jakub Jelinek  <jakub@redhat.com>

	* include/bits/stdlib-ldbl.h: New file.
	* include/bits/wchar-ldbl.h: New file.

--- libc/include/bits/wchar-ldbl.h.jj	2006-01-30 12:26:46.000000000 +0100
+++ libc/include/bits/wchar-ldbl.h	2006-01-30 12:27:05.000000000 +0100
@@ -0,0 +1 @@
+#include <wcsmbs/bits/wchar-ldbl.h>
--- libc/include/bits/stdlib-ldbl.h.jj	2006-01-30 12:26:46.000000000 +0100
+++ libc/include/bits/stdlib-ldbl.h	2006-01-30 12:26:39.000000000 +0100
@@ -0,0 +1 @@
+#include <stdlib/bits/stdlib-ldbl.h>

	Jakub



More information about the Libc-hacker mailing list