public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Paul E. Murphy <murphyp@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] powerpc64le: blacklist broken GCC compilers (e.g GCC 7.5.0) Date: Thu, 30 Apr 2020 16:21:13 +0000 (GMT) [thread overview] Message-ID: <20200430162113.5FE31396E039@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5c7ccc29830fb59d39d67222caca5b4bd6ca2e0f commit 5c7ccc29830fb59d39d67222caca5b4bd6ca2e0f Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com> Date: Tue Mar 17 08:38:54 2020 -0500 powerpc64le: blacklist broken GCC compilers (e.g GCC 7.5.0) GCC 7.5.0 (PR94200) will refuse to compile if both -mabi=% and -mlong-double-128 are passed on the command line. Surprisingly, it will work happily if the latter is not. For the sake of maintaining status quo, test for and blacklist such compilers. Tested with a GCC 8.3.1 and GCC 7.5.0 compiler for ppc64le. Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> Diff: --- INSTALL | 8 +++++--- manual/install.texi | 10 ++++++++-- sysdeps/ieee754/ldbl-128ibm-compat/Makefile | 12 ------------ sysdeps/powerpc/powerpc64/le/configure | 27 +++++++++++++++++++++++++++ sysdeps/powerpc/powerpc64/le/configure.ac | 15 +++++++++++++++ 5 files changed, 55 insertions(+), 17 deletions(-) diff --git a/INSTALL b/INSTALL index 4bf4bd0908..b7676d1c9f 100644 --- a/INSTALL +++ b/INSTALL @@ -469,9 +469,11 @@ build the GNU C Library: For PowerPC 64-bits little-endian (powerpc64le), a GCC version with support for '-mno-gnu-attribute', '-mabi=ieeelongdouble', and - '-mabi=ibmlondouble' is required. These additional features are - required for building the GNU C Library with support for IEEE long - double. + '-mabi=ibmlondouble' is required. Likewise, the compiler must also + support passing '-mlong-double-128' with the preceding options. As + of release, this implies GCC 7.4 and newer (excepting GCC 7.5.0, + see GCC PR94200). These additional features are required for + building the GNU C Library with support for IEEE long double. For multi-arch support it is recommended to use a GCC which has been built with support for GNU indirect functions. This ensures diff --git a/manual/install.texi b/manual/install.texi index e801abd8be..f6d9d92317 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -509,8 +509,14 @@ release time, GCC 9.2.1 is the newest compiler verified to work to build For PowerPC 64-bits little-endian (powerpc64le), a GCC version with support for @option{-mno-gnu-attribute}, @option{-mabi=ieeelongdouble}, and -@option{-mabi=ibmlondouble} is required. These additional features are -required for building the GNU C Library with support for IEEE long double. +@option{-mabi=ibmlondouble} is required. Likewise, the compiler must also +support passing @option{-mlong-double-128} with the preceding options. As +of release, this implies GCC 7.4 and newer (excepting GCC 7.5.0, see GCC +PR94200). These additional features are required for building the GNU C +Library with support for IEEE long double. + +@c powerpc64le performs an autoconf test to verify the compiler compiles with +@c commands like "$CC -c foo.c -mabi=ibmlongdouble -mlong-double-128". For multi-arch support it is recommended to use a GCC which has been built with support for GNU indirect functions. This ensures that correct debugging diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile index 0ac52a53bc..7b42746c34 100644 --- a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile +++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile @@ -249,13 +249,6 @@ ldbl-extra-routines += err \ CFLAGS-ieee128-qefgcvt.c += -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute CFLAGS-ieee128-qefgcvt_r.c += -mabi=ieeelongdouble -Wno-psabi -mno-gnu-attribute -# Remove -mlong-double-128 because it does not work correctly with -# -mabi=ibmlongdoule in some GCC versions, e.g. GCC 7. -$(foreach o,$(all-object-suffixes),$(objpfx)ieee128-qefgcvt$(o)): \ - sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS)) -$(foreach o,$(all-object-suffixes),$(objpfx)ieee128-qefgcvt_r$(o)): \ - sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS)) - tests-internal += tst-ibm128-warn tst-ieee128-warn tests-internal += tst-ibm128-error tst-ieee128-error tests-internal += tst-ibm128-efgcvt tst-ieee128-efgcvt @@ -348,11 +341,6 @@ ldbl-ibm128-files := $(objpfx)test-%-ibm128^ \ $(foreach r,$(ldbl-extra-routines),$(objpfx)$(r)-internal^) obj-suf-foreach = $(foreach suf,$(all-object-suffixes),$(subst ^,$(suf),$(1))) -# Remove -mlong-double-128 because it does not work correctly with -# -mabi=ibmlongdoule in some GCC versions, e.g. GCC 7. -$(call obj-suf-foreach,$(ldbl-ibm128-files)): \ - sysdep-CFLAGS := $(filter-out -mlong-double-128, $(sysdep-CFLAGS)) - # Explicitly add -mabi=ibm-long-double to required files. $(call obj-suf-foreach,$(ldbl-ibm128-files)): \ sysdep-CFLAGS += -mabi=ibmlongdouble diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure index bd7b8e77d0..98a4889945 100644 --- a/sysdeps/powerpc/powerpc64/le/configure +++ b/sysdeps/powerpc/powerpc64/le/configure @@ -90,6 +90,33 @@ if test "$libc_cv_compiler_powerpc64le_ice" != "yes"; then : critic_missing="$critic_missing __builtin_signbit is broken. GCC 7.4 or newer is required to resolve (PR83862)." fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC compiles with -mabi=ieeelongdouble and -mlong-double-128" >&5 +$as_echo_n "checking if $CC compiles with -mabi=ieeelongdouble and -mlong-double-128... " >&6; } +if ${libc_cv_compiler_powerpc64le_ldbl128_mabi+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -mabi=ieeelongdouble -mlong-double-128" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +long double x; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_cv_compiler_powerpc64le_ldbl128_mabi=yes +else + libc_cv_compiler_powerpc64le_ldbl128_mabi=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$save_CFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_powerpc64le_ldbl128_mabi" >&5 +$as_echo "$libc_cv_compiler_powerpc64le_ldbl128_mabi" >&6; } +if test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"; then : + critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlongdouble simultaneously." +fi + for ac_prog in $OBJCOPY do # Extract the first word of "$ac_prog", so it can be a program name with args. diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac index 405933e710..769c06709e 100644 --- a/sysdeps/powerpc/powerpc64/le/configure.ac +++ b/sysdeps/powerpc/powerpc64/le/configure.ac @@ -51,6 +51,21 @@ CFLAGS="$save_CFLAGS"]) AS_IF([test "$libc_cv_compiler_powerpc64le_ice" != "yes"], [critic_missing="$critic_missing __builtin_signbit is broken. GCC 7.4 or newer is required to resolve (PR83862)."]) +dnl Some old compiler versions give out error messages when combining +dnl -mabi=% and -mlong-double-128. i.e GCC 7.5.0 (PR94200) +AC_CACHE_CHECK([if $CC compiles with -mabi=ieeelongdouble and -mlong-double-128], + libc_cv_compiler_powerpc64le_ldbl128_mabi, [dnl +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -mabi=ieeelongdouble -mlong-double-128" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +long double x; +]])], + [libc_cv_compiler_powerpc64le_ldbl128_mabi=yes], + [libc_cv_compiler_powerpc64le_ldbl128_mabi=no]) +CFLAGS="$save_CFLAGS"]) +AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"], + [critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlongdouble simultaneously."]) + dnl objcopy (binutils) 2.26 or newer required to support the --update-section dnl feature for fixing up .gnu.attribute section with IEEE ldbl. AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version,
reply other threads:[~2020-04-30 16:21 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200430162113.5FE31396E039@sourceware.org \ --to=murphyp@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).