From patchwork Mon Aug 21 15:56:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Neyman X-Patchwork-Id: 22286 Received: (qmail 102270 invoked by alias); 21 Aug 2017 15:57:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 102238 invoked by uid 89); 21 Aug 2017 15:57:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*Ad:D*att.net, libgcc, H*MI:att, H*M:att X-HELO: nm5-vm5.access.bullet.mail.bf1.yahoo.com X-Yahoo-SMTP: 0h0Q7euswBD_g.kcEqbzJWRFfrba801gq1M1 To: libc-alpha@sourceware.org From: Alexey Neyman Subject: [PATCH] powerpc64le build fails with GCC7 Message-ID: <1d46726e-05d0-4b16-4960-c2ab68133fef@att.net> Date: Mon, 21 Aug 2017 08:56:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Hi all, With GCC7, the test for -mfloat128 fails with a message that this option requires -mfloat128-type to be supplied as well. Cannot supply both options unconditionally, though, as GCC6 would choke on unknown option. Patch attached, please review. Build-tested only, with GCC 7.2.0 and 6.4.0. Regards, Alexey. From ea42205587b557c604f165ffdb745d94035fd18d Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Mon, 21 Aug 2017 08:50:02 -0700 Subject: [PATCH] Fix powerpc64le target with GCC7 With GCC7, the test for -mfloat128 fails with a message that this option requires -mfloat128-type to be supplied as well. Cannot supply both options unconditionally, though, as GCC6 would choke on unknown option. * sysdeps/powerpc/powerpc64le/configure.ac: Detect if -mfloat128-type needs to be supplied in addition to -mfloat128 * configure.ac (libc_cv_compiler_powerpc64le_float128_type): New variable. * config.make.in (config-cflags-mfloat128-type): New variable. * sysdeps/powerpc/powerpc64le/configure, configure: Regenerate. Signed-off-by: Alexey Neyman --- ChangeLog | 10 ++++++ config.make.in | 1 + configure | 4 +++ configure.ac | 3 ++ sysdeps/powerpc/powerpc64le/Makefile | 58 +++++++++++++++++--------------- sysdeps/powerpc/powerpc64le/configure | 20 ++++++++++- sysdeps/powerpc/powerpc64le/configure.ac | 8 ++++- 7 files changed, 74 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index bfc20d6881..248ba1b5ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-08-21 Alexey Neyman + + * sysdeps/powerpc/powerpc64le/configure.ac: + Detect if -mfloat128-type needs to be supplied in addition to + -mfloat128 + * configure.ac (libc_cv_compiler_powerpc64le_float128_type): + New variable. + * config.make.in (config-cflags-mfloat128-type): New variable. + * sysdeps/powerpc/powerpc64le/configure, configure: Regenerate. + 2017-08-21 Florian Weimer [BZ #21972] diff --git a/config.make.in b/config.make.in index ea7a42cc19..44fc514d52 100644 --- a/config.make.in +++ b/config.make.in @@ -40,6 +40,7 @@ asflags-cpu = @libc_cv_cc_submachine@ config-extra-cflags = @libc_extra_cflags@ config-extra-cppflags = @libc_extra_cppflags@ config-cflags-nofma = @libc_cv_cc_nofma@ +config-cflags-mfloat128-type = @libc_cv_compiler_powerpc64le_float128_type@ defines = @DEFINES@ sysheaders = @sysheaders@ diff --git a/configure b/configure index 5cb5210107..b98352502d 100755 --- a/configure +++ b/configure @@ -618,6 +618,7 @@ have_libaudit LIBGD libc_cv_cc_loop_to_function libc_cv_cc_submachine +libc_cv_compiler_powerpc64le_float128_type libc_cv_cc_nofma libc_cv_mtls_dialect_gnu2 fno_unit_at_a_time @@ -6331,6 +6332,9 @@ fi $as_echo "$libc_cv_cc_nofma" >&6; } +# Detected in powerpc64le fragment + + if test -n "$submachine"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler option for CPU variant" >&5 $as_echo_n "checking for compiler option for CPU variant... " >&6; } diff --git a/configure.ac b/configure.ac index 2c6308883c..9e4eaa3cfd 100644 --- a/configure.ac +++ b/configure.ac @@ -1677,6 +1677,9 @@ for opt in -ffp-contract=off -mno-fused-madd; do done]) AC_SUBST(libc_cv_cc_nofma) +# Detected in powerpc64le fragment +AC_SUBST(libc_cv_compiler_powerpc64le_float128_type) + if test -n "$submachine"; then AC_CACHE_CHECK([for compiler option for CPU variant], libc_cv_cc_submachine, [dnl diff --git a/sysdeps/powerpc/powerpc64le/Makefile b/sysdeps/powerpc/powerpc64le/Makefile index 77617b670a..389a58aa54 100644 --- a/sysdeps/powerpc/powerpc64le/Makefile +++ b/sysdeps/powerpc/powerpc64le/Makefile @@ -6,35 +6,37 @@ # linked executables, forcing to link the loader after libgcc link. f128-loader-link = $(as-needed) $(elf-objpfx)ld.so $(no-as-needed) +f128-options = -mfloat128 $(config-cflags-mfloat128-type) + ifeq ($(subdir),math) # sqrtf128 requires emulation before POWER9. CPPFLAGS += -I../soft-fp # float128 requires adding a handful of extra flags. -$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += -mfloat128 -$(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += -mfloat128 -$(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += -mfloat128 -$(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFLAGS += -mfloat128 -CFLAGS-libm-test-support-float128.c += -mfloat128 +$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += $(f128-options) +$(foreach suf,$(all-object-suffixes),%f128_r$(suf)): CFLAGS += $(f128-options) +$(foreach suf,$(all-object-suffixes),$(objpfx)test-float128%$(suf)): CFLAGS += $(f128-options) +$(foreach suf,$(all-object-suffixes),$(objpfx)test-ifloat128%$(suf)): CFLAGS += $(f128-options) +CFLAGS-libm-test-support-float128.c += $(f128-options) $(objpfx)test-float128% $(objpfx)test-ifloat128%: \ gnulib-tests += $(f128-loader-link) endif # Append flags to string <-> _Float128 routines. ifneq ($(filter $(subdir),wcsmbs stdlib),) -$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += -mfloat128 -$(foreach suf,$(all-object-suffixes),%f128_l$(suf)): CFLAGS += -mfloat128 -$(foreach suf,$(all-object-suffixes),%f128_nan$(suf)): CFLAGS += -mfloat128 -$(foreach suf,$(all-object-suffixes),%float1282mpn$(suf)): CFLAGS += -mfloat128 -$(foreach suf,$(all-object-suffixes),%mpn2float128$(suf)): CFLAGS += -mfloat128 -CFLAGS-bug-strtod.c += -mfloat128 -CFLAGS-bug-strtod2.c += -mfloat128 -CFLAGS-tst-strtod-round.c += -mfloat128 -CFLAGS-tst-wcstod-round.c += -mfloat128 -CFLAGS-tst-strtod6.c += -mfloat128 -CFLAGS-tst-strfrom.c += -mfloat128 -CFLAGS-tst-strfrom-locale.c += -mfloat128 -CFLAGS-strfrom-skeleton.c += -mfloat128 +$(foreach suf,$(all-object-suffixes),%f128$(suf)): CFLAGS += $(f128-options) +$(foreach suf,$(all-object-suffixes),%f128_l$(suf)): CFLAGS += $(f128-options) +$(foreach suf,$(all-object-suffixes),%f128_nan$(suf)): CFLAGS += $(f128-options) +$(foreach suf,$(all-object-suffixes),%float1282mpn$(suf)): CFLAGS += $(f128-options) +$(foreach suf,$(all-object-suffixes),%mpn2float128$(suf)): CFLAGS += $(f128-options) +CFLAGS-bug-strtod.c += $(f128-options) +CFLAGS-bug-strtod2.c += $(f128-options) +CFLAGS-tst-strtod-round.c += $(f128-options) +CFLAGS-tst-wcstod-round.c += $(f128-options) +CFLAGS-tst-strtod6.c += $(f128-options) +CFLAGS-tst-strfrom.c += $(f128-options) +CFLAGS-tst-strfrom-locale.c += $(f128-options) +CFLAGS-strfrom-skeleton.c += $(f128-options) $(foreach test,bug-strtod bug-strtod2 bug-strtod2 tst-strtod-round \ tst-wcstod-round tst-strtod6 tst-strrom tst-strfrom-locale \ strfrom-skeleton,$(objpfx)$(test)): gnulib-tests += $(f128-loader-link) @@ -44,18 +46,18 @@ strfrom-skeleton,$(objpfx)$(test)): gnulib-tests += $(f128-loader-link) # Makefiles (e.g.: wcsmbs/Makefile) override CFLAGS defined by the Makefiles in # sysdeps. This is avoided with the use sysdep-CFLAGS instead of CFLAGS. sysdep-CFLAGS += $(sysdep-CFLAGS-$(&5 +$as_echo_n "checking whether compiler supports -mfloat128-type... " >&6; } +if ${libc_cv_compiler_powerpc64le_float128_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if { ac_try='${CC-cc} -mfloat128-type -xc /dev/null -S -o /dev/null' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + libc_cv_compiler_powerpc64le_float128_type=-mfloat128-type +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_powerpc64le_float128_type" >&5 +$as_echo "$libc_cv_compiler_powerpc64le_float128_type" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports binary128 floating point type" >&5 $as_echo_n "checking if $CC supports binary128 floating point type... " >&6; } @@ -8,7 +26,7 @@ if ${libc_cv_compiler_powerpc64le_binary128_ok+:} false; then : $as_echo_n "(cached) " >&6 else save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Werror -mfloat128" +CFLAGS="$CFLAGS -Werror -mfloat128 $libc_cv_compiler_powerpc64le_float128_type" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ diff --git a/sysdeps/powerpc/powerpc64le/configure.ac b/sysdeps/powerpc/powerpc64le/configure.ac index 20a49d89e8..27eb8b7aca 100644 --- a/sysdeps/powerpc/powerpc64le/configure.ac +++ b/sysdeps/powerpc/powerpc64le/configure.ac @@ -1,12 +1,18 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # Local configure fragment for sysdeps/powerpc/powerpc64le. +AC_CACHE_CHECK([whether compiler supports -mfloat128-type], + libc_cv_compiler_powerpc64le_float128_type, [dnl +LIBC_TRY_CC_OPTION([-mfloat128-type], + [libc_cv_compiler_powerpc64le_float128_type=-mfloat128-type]) +]) + dnl Require binary128 floating point support on powerpc64le (available in dnl GCC 6.2). AC_CACHE_CHECK([if $CC supports binary128 floating point type], libc_cv_compiler_powerpc64le_binary128_ok, [dnl save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -Werror -mfloat128" +CFLAGS="$CFLAGS -Werror -mfloat128 $libc_cv_compiler_powerpc64le_float128_type" AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ __float128 a, b, c, d, e; int i; -- 2.11.0