Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From faf35e26740461fe1a1da5433d5a0169a663e3b5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 29 Apr 2016 20:03:28 +0000 |
| 4 | Subject: [PATCH 34/39] libgcc: Add knob to use ldbl-128 on ppc |
| 5 | |
| 6 | musl does not support ldbl 128 so we can not assume |
| 7 | that linux as a whole supports ldbl-128 bits, instead |
| 8 | act upon configure option passed to gcc and assume no |
| 9 | on musl and yes otherwise if no option is passed since |
| 10 | default behaviour is to assume ldbl128 it does not |
| 11 | change the defaults |
| 12 | |
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 14 | --- |
| 15 | Upstream-Status: Pending |
| 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 | |
| 24 | diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in |
| 25 | index dd8cee99fd3..b5f478af382 100644 |
| 26 | --- a/libgcc/Makefile.in |
| 27 | +++ b/libgcc/Makefile.in |
| 28 | @@ -48,6 +48,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@ |
| 36 | diff --git a/libgcc/config/rs6000/t-linux b/libgcc/config/rs6000/t-linux |
| 37 | index 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 |
| 48 | diff --git a/libgcc/configure b/libgcc/configure |
| 49 | old mode 100644 |
| 50 | new mode 100755 |
| 51 | index b2f3f870844..ed806587c17 |
| 52 | --- a/libgcc/configure |
| 53 | +++ b/libgcc/configure |
| 54 | @@ -619,6 +619,7 @@ build_vendor |
| 55 | build_cpu |
| 56 | build |
| 57 | with_aix_soname |
| 58 | +with_ldbl128 |
| 59 | enable_vtable_verify |
| 60 | enable_shared |
| 61 | libgcc_topdir |
| 62 | @@ -668,6 +669,7 @@ with_cross_host |
| 63 | with_ld |
| 64 | enable_shared |
| 65 | enable_vtable_verify |
| 66 | +with_long_double_128 |
| 67 | with_aix_soname |
| 68 | enable_version_specific_runtime_libs |
| 69 | with_slibdir |
| 70 | @@ -1329,6 +1331,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 | @@ -2213,6 +2216,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 |
| 100 | diff --git a/libgcc/configure.ac b/libgcc/configure.ac |
| 101 | index b59aa746afc..42220a263c5 100644 |
| 102 | --- a/libgcc/configure.ac |
| 103 | +++ b/libgcc/configure.ac |
| 104 | @@ -78,6 +78,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 | -- |
| 124 | 2.17.0 |
| 125 | |