blob: f5769bc8e9121e8422fe09245b9106ecf1327b16 [file] [log] [blame]
From baab61ae3938ee2fa9ec03a20793508516a46dae Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Apr 2016 20:03:28 +0000
Subject: [PATCH 30/36] libgcc: Add knob to use ldbl-128 on ppc
musl does not support ldbl 128 so we can not assume
that linux as a whole supports ldbl-128 bits, instead
act upon configure option passed to gcc and assume no
on musl and yes otherwise if no option is passed since
default behaviour is to assume ldbl128 it does not
change the defaults
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
libgcc/Makefile.in | 1 +
libgcc/config/rs6000/t-linux | 5 ++++-
libgcc/configure | 18 ++++++++++++++++++
libgcc/configure.ac | 12 ++++++++++++
4 files changed, 35 insertions(+), 1 deletion(-)
mode change 100644 => 100755 libgcc/configure
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index ea390a5bbea..114c7876304 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -50,6 +50,7 @@ unwind_header = @unwind_header@
md_unwind_header = @md_unwind_header@
sfp_machine_header = @sfp_machine_header@
thread_header = @thread_header@
+with_ldbl128 = @with_ldbl128@
host_noncanonical = @host_noncanonical@
real_host_noncanonical = @real_host_noncanonical@
diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
index 4f6d4c4a4d2..c50dd94a2da 100644
--- a/libgcc/config/rs6000/t-linux
+++ b/libgcc/config/rs6000/t-linux
@@ -1,3 +1,6 @@
SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
-HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
+ifeq ($(with_ldbl128),yes)
+HOST_LIBGCC2_CFLAGS += -mlong-double-128
+endif
+HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
diff --git a/libgcc/configure b/libgcc/configure
old mode 100644
new mode 100755
index 36dbbc1f699..b5dd5c34e2a
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -651,6 +651,7 @@ build_vendor
build_cpu
build
with_aix_soname
+with_ldbl128
enable_vtable_verify
enable_gcov
enable_shared
@@ -702,6 +703,7 @@ with_ld
enable_shared
enable_gcov
enable_vtable_verify
+with_long_double_128
with_aix_soname
enable_version_specific_runtime_libs
with_slibdir
@@ -1363,6 +1365,7 @@ Optional Packages:
--with-target-subdir=SUBDIR Configuring in a subdirectory for target
--with-cross-host=HOST Configuring with a cross compiler
--with-ld arrange to use the specified ld (full pathname)
+ --with-long-double-128 use 128-bit long double by default
--with-aix-soname=aix|svr4|both
shared library versioning (aka "SONAME") variant to
provide on AIX
@@ -2268,6 +2271,21 @@ fi
+# Check whether --with-long-double-128 was given.
+if test "${with_long_double_128+set}" = set; then :
+ withval=$with_long_double_128; with_ldbl128="$with_long_double_128"
+else
+ case "${host}" in
+ power*-*-musl*)
+ with_ldbl128="no";;
+ *) with_ldbl128="yes";;
+ esac
+
+fi
+
+
+
+
# Check whether --with-aix-soname was given.
if test "${with_aix_soname+set}" = set; then :
withval=$with_aix_soname; case "${host}:${enable_shared}" in
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 8e96cafdf8b..9247856bf24 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -82,6 +82,18 @@ AC_ARG_ENABLE(vtable-verify,
[enable_vtable_verify=no])
AC_SUBST(enable_vtable_verify)
+AC_ARG_WITH(long-double-128,
+[AS_HELP_STRING([--with-long-double-128],
+ [use 128-bit long double by default])],
+ with_ldbl128="$with_long_double_128",
+[case "${host}" in
+ power*-*-musl*)
+ with_ldbl128="no";;
+ *) with_ldbl128="yes";;
+ esac
+])
+AC_SUBST(with_ldbl128)
+
AC_ARG_WITH(aix-soname,
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX])],
--
2.22.1