public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: David Edelsohn <dje@watson.ibm.com>,
	Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix glibc build on ppc64
Date: Mon, 30 Jan 2006 16:53:00 -0000	[thread overview]
Message-ID: <20060130165250.GQ4625@sunsite.mff.cuni.cz> (raw)

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

                 reply	other threads:[~2006-01-30 16:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060130165250.GQ4625@sunsite.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=dje@watson.ibm.com \
    --cc=libc-hacker@sources.redhat.com \
    --cc=roland@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).