blob: e39af9b1aad560e99b211a832ea284e263514e9d [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 847aec764540636ec654fd7a012e271afa8d4e0f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Apr 2016 20:03:28 +0000
4Subject: [PATCH 44/47] libgcc: Add knob to use ldbl-128 on ppc
5
6musl does not support ldbl 128 so we can not assume
7that linux as a whole supports ldbl-128 bits, instead
8act upon configure option passed to gcc and assume no
9on musl and yes otherwise if no option is passed since
10default behaviour is to assume ldbl128 it does not
11change the defaults
12
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Upstream-Status: Pending
15---
16 libgcc/Makefile.in | 1 +
17 libgcc/config/rs6000/t-linux | 5 ++++-
18 libgcc/configure | 18 ++++++++++++++++++
19 libgcc/configure.ac | 12 ++++++++++++
20 4 files changed, 35 insertions(+), 1 deletion(-)
21 mode change 100644 => 100755 libgcc/configure
22
23diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
24index a1a392de88d..2fe6889a342 100644
25--- a/libgcc/Makefile.in
26+++ b/libgcc/Makefile.in
27@@ -48,6 +48,7 @@ unwind_header = @unwind_header@
28 md_unwind_header = @md_unwind_header@
29 sfp_machine_header = @sfp_machine_header@
30 thread_header = @thread_header@
31+with_ldbl128 = @with_ldbl128@
32
33 host_noncanonical = @host_noncanonical@
34 real_host_noncanonical = @real_host_noncanonical@
35diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
36index 4f6d4c4a4d2..c50dd94a2da 100644
37--- a/libgcc/config/rs6000/t-linux
38+++ b/libgcc/config/rs6000/t-linux
39@@ -1,3 +1,6 @@
40 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
41
42-HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
43+ifeq ($(with_ldbl128),yes)
44+HOST_LIBGCC2_CFLAGS += -mlong-double-128
45+endif
46+HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
47diff --git a/libgcc/configure b/libgcc/configure
48old mode 100644
49new mode 100755
50index 45c459788c3..e2d19b144b8
51--- a/libgcc/configure
52+++ b/libgcc/configure
53@@ -618,6 +618,7 @@ build_vendor
54 build_cpu
55 build
56 with_aix_soname
57+with_ldbl128
58 enable_vtable_verify
59 enable_shared
60 libgcc_topdir
61@@ -667,6 +668,7 @@ with_cross_host
62 with_ld
63 enable_shared
64 enable_vtable_verify
65+with_long_double_128
66 with_aix_soname
67 enable_version_specific_runtime_libs
68 with_slibdir
69@@ -1324,6 +1326,7 @@ Optional Packages:
70 --with-target-subdir=SUBDIR Configuring in a subdirectory for target
71 --with-cross-host=HOST Configuring with a cross compiler
72 --with-ld arrange to use the specified ld (full pathname)
73+ --with-long-double-128 use 128-bit long double by default
74 --with-aix-soname=aix|svr4|both
75 shared library versioning (aka "SONAME") variant to
76 provide on AIX
77@@ -2208,6 +2211,21 @@ fi
78
79
80
81+# Check whether --with-long-double-128 was given.
82+if test "${with_long_double_128+set}" = set; then :
83+ withval=$with_long_double_128; with_ldbl128="$with_long_double_128"
84+else
85+ case "${host}" in
86+ power*-*-musl*)
87+ with_ldbl128="no";;
88+ *) with_ldbl128="yes";;
89+ esac
90+
91+fi
92+
93+
94+
95+
96 # Check whether --with-aix-soname was given.
97 if test "${with_aix_soname+set}" = set; then :
98 withval=$with_aix_soname; case "${host}:${enable_shared}" in
99diff --git a/libgcc/configure.ac b/libgcc/configure.ac
100index af151473709..dada52416da 100644
101--- a/libgcc/configure.ac
102+++ b/libgcc/configure.ac
103@@ -77,6 +77,18 @@ AC_ARG_ENABLE(vtable-verify,
104 [enable_vtable_verify=no])
105 AC_SUBST(enable_vtable_verify)
106
107+AC_ARG_WITH(long-double-128,
108+[AS_HELP_STRING([--with-long-double-128],
109+ [use 128-bit long double by default])],
110+ with_ldbl128="$with_long_double_128",
111+[case "${host}" in
112+ power*-*-musl*)
113+ with_ldbl128="no";;
114+ *) with_ldbl128="yes";;
115+ esac
116+])
117+AC_SUBST(with_ldbl128)
118+
119 AC_ARG_WITH(aix-soname,
120 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
121 [shared library versioning (aka "SONAME") variant to provide on AIX])],
122--
1232.12.2
124