summaryrefslogtreecommitdiff
path: root/meta-linaro-toolchain/recipes-devtools/gcc/gcc-linaro-6.2/0045-libgcc-Add-knob-to-use-ldbl-128-on-ppc.patch
blob: c62b727d6e42098cc6885567dd4a1015a0cbde49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
From 5a47d404ea29e2547269e3ddf38754462d93f903 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 45/46] 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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending

 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 f09b39b..296cf0f 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -43,6 +43,7 @@ enable_vtable_verify = @enable_vtable_verify@
 enable_decimal_float = @enable_decimal_float@
 fixed_point = @fixed_point@
 with_aix_soname = @with_aix_soname@
+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 4f6d4c4..c50dd94 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 e7d6c75..e9a9019
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -614,6 +614,7 @@ build_vendor
 build_cpu
 build
 with_aix_soname
+with_ldbl128
 enable_vtable_verify
 enable_shared
 libgcc_topdir
@@ -663,6 +664,7 @@ with_cross_host
 with_ld
 enable_shared
 enable_vtable_verify
+with_long_double_128
 with_aix_soname
 enable_version_specific_runtime_libs
 with_slibdir
@@ -1319,6 +1321,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
@@ -2201,6 +2204,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 269997f..81dc3ba 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -77,6 +77,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.8.2