mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] better long double check
@ 2017-09-17 15:38 Szabolcs Nagy
  0 siblings, 0 replies; only message in thread
From: Szabolcs Nagy @ 2017-09-17 15:38 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 143 bytes --]

s390x gcc default long double (64bit) does not
match the expected one in musl (128bit) but this
was not caught by the current configure check.

[-- Attachment #2: 0001-better-configure-check-for-long-double-support.patch --]
[-- Type: text/x-diff, Size: 1007 bytes --]

From 94666565318b7ed966d77811e5d880f69bdecccf Mon Sep 17 00:00:00 2001
From: Szabolcs Nagy <nsz@port70.net>
Date: Sun, 17 Sep 2017 15:35:55 +0000
Subject: [PATCH] better configure check for long double support

---
 configure | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 02b736ce..501a7219 100755
--- a/configure
+++ b/configure
@@ -706,9 +706,8 @@ esac
 #
 printf "checking whether compiler's long double definition matches float.h... "
 echo '#include <float.h>' > "$tmpc"
-echo '#if LDBL_MANT_DIG == 53' >> "$tmpc"
-echo 'typedef char ldcheck[9-(int)sizeof(long double)];' >> "$tmpc"
-echo '#endif' >> "$tmpc"
+echo '#define C(m,s) (m==LDBL_MANT_DIG && s==sizeof(long double))' >> "$tmpc"
+echo 'typedef char ldcheck[(C(53,8)||C(64,12)||C(64,16)||C(113,16))*2-1];' >> "$tmpc"
 if $CC $CFLAGS_C99FSE \
   -I$srcdir/arch/$ARCH -I$srcdir/arch/generic -I$srcdir/include \
   $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then
-- 
2.14.1


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

only message in thread, other threads:[~2017-09-17 15:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-17 15:38 [PATCH] better long double check Szabolcs Nagy

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).