blob: f5769bc8e9121e8422fe09245b9106ecf1327b16 [file] [log] [blame]
Brad Bishopc68388fc2019-08-26 01:33:31 -04001From baab61ae3938ee2fa9ec03a20793508516a46dae Mon Sep 17 00:00:00 2001
Brad Bishopc342db32019-05-15 21:57:59 -04002From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Apr 2016 20:03:28 +0000
Brad Bishopc68388fc2019-08-26 01:33:31 -04004Subject: [PATCH 30/36] libgcc: Add knob to use ldbl-128 on ppc
Brad Bishopc342db32019-05-15 21:57:59 -04005
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
13Upstream-Status: Pending
14
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 libgcc/Makefile.in | 1 +
18 libgcc/config/rs6000/t-linux | 5 ++++-
19 libgcc/configure | 18 ++++++++++++++++++
20 libgcc/configure.ac | 12 ++++++++++++
21 4 files changed, 35 insertions(+), 1 deletion(-)
22 mode change 100644 => 100755 libgcc/configure
23
24diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
25index ea390a5bbea..114c7876304 100644
26--- a/libgcc/Makefile.in
27+++ b/libgcc/Makefile.in
28@@ -50,6 +50,7 @@ unwind_header = @unwind_header@
29 md_unwind_header = @md_unwind_header@
30 sfp_machine_header = @sfp_machine_header@
31 thread_header = @thread_header@
32+with_ldbl128 = @with_ldbl128@
33
34 host_noncanonical = @host_noncanonical@
35 real_host_noncanonical = @real_host_noncanonical@
36diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux
37index 4f6d4c4a4d2..c50dd94a2da 100644
38--- a/libgcc/config/rs6000/t-linux
39+++ b/libgcc/config/rs6000/t-linux
40@@ -1,3 +1,6 @@
41 SHLIB_MAPFILES += $(srcdir)/config/rs6000/libgcc-glibc.ver
42
43-HOST_LIBGCC2_CFLAGS += -mlong-double-128 -mno-minimal-toc
44+ifeq ($(with_ldbl128),yes)
45+HOST_LIBGCC2_CFLAGS += -mlong-double-128
46+endif
47+HOST_LIBGCC2_CFLAGS += -mno-minimal-toc
48diff --git a/libgcc/configure b/libgcc/configure
49old mode 100644
50new mode 100755
51index 36dbbc1f699..b5dd5c34e2a
52--- a/libgcc/configure
53+++ b/libgcc/configure
54@@ -651,6 +651,7 @@ build_vendor
55 build_cpu
56 build
57 with_aix_soname
58+with_ldbl128
59 enable_vtable_verify
60 enable_gcov
61 enable_shared
62@@ -702,6 +703,7 @@ with_ld
63 enable_shared
64 enable_gcov
65 enable_vtable_verify
66+with_long_double_128
67 with_aix_soname
68 enable_version_specific_runtime_libs
69 with_slibdir
70@@ -1363,6 +1365,7 @@ Optional Packages:
71 --with-target-subdir=SUBDIR Configuring in a subdirectory for target
72 --with-cross-host=HOST Configuring with a cross compiler
73 --with-ld arrange to use the specified ld (full pathname)
74+ --with-long-double-128 use 128-bit long double by default
75 --with-aix-soname=aix|svr4|both
76 shared library versioning (aka "SONAME") variant to
77 provide on AIX
78@@ -2268,6 +2271,21 @@ fi
79
80
81
82+# Check whether --with-long-double-128 was given.
83+if test "${with_long_double_128+set}" = set; then :
84+ withval=$with_long_double_128; with_ldbl128="$with_long_double_128"
85+else
86+ case "${host}" in
87+ power*-*-musl*)
88+ with_ldbl128="no";;
89+ *) with_ldbl128="yes";;
90+ esac
91+
92+fi
93+
94+
95+
96+
97 # Check whether --with-aix-soname was given.
98 if test "${with_aix_soname+set}" = set; then :
99 withval=$with_aix_soname; case "${host}:${enable_shared}" in
100diff --git a/libgcc/configure.ac b/libgcc/configure.ac
101index 8e96cafdf8b..9247856bf24 100644
102--- a/libgcc/configure.ac
103+++ b/libgcc/configure.ac
104@@ -82,6 +82,18 @@ AC_ARG_ENABLE(vtable-verify,
105 [enable_vtable_verify=no])
106 AC_SUBST(enable_vtable_verify)
107
108+AC_ARG_WITH(long-double-128,
109+[AS_HELP_STRING([--with-long-double-128],
110+ [use 128-bit long double by default])],
111+ with_ldbl128="$with_long_double_128",
112+[case "${host}" in
113+ power*-*-musl*)
114+ with_ldbl128="no";;
115+ *) with_ldbl128="yes";;
116+ esac
117+])
118+AC_SUBST(with_ldbl128)
119+
120 AC_ARG_WITH(aix-soname,
121 [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
122 [shared library versioning (aka "SONAME") variant to provide on AIX])],
123--
Brad Bishopc68388fc2019-08-26 01:33:31 -04001242.22.1
Brad Bishopc342db32019-05-15 21:57:59 -0400125