public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix glibc build on ppc64
@ 2006-01-30 16:53 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2006-01-30 16:53 UTC (permalink / raw)
  To: Roland McGrath; +Cc: David Edelsohn, Glibc hackers

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-30 16:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-30 16:53 [PATCH] Fix glibc build on ppc64 Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).