From patchwork Fri Jun 23 12:33:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel F T Gomes X-Patchwork-Id: 21230 Received: (qmail 92645 invoked by alias); 23 Jun 2017 12:34:35 -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 90792 invoked by uid 89); 23 Jun 2017 12:34:32 -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, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: "Gabriel F. T. Gomes" To: libc-alpha@sourceware.org Subject: [PATCH v3 6/7] powerpc64le: Check for compiler features for float128 Date: Fri, 23 Jun 2017 09:33:25 -0300 In-Reply-To: <1498221206-26864-1-git-send-email-gftg@linux.vnet.ibm.com> References: <1498221206-26864-1-git-send-email-gftg@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17062312-1523-0000-0000-000002ADF952 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17062312-1524-0000-0000-00002A4623FC Message-Id: <1498221206-26864-7-git-send-email-gftg@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-23_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1706230212 Changes since v2: - Check for compiler features instead of compiler version. - Mention the powerpc64le-specific requirement in the manual. No changes since v1. -- 8< -- On powerpc64le, support for float128 will be enabled, which requires some compiler features to be present. This patch adds a configure test to check for such features, which are provided for powerpc64le since GCC 6.2. Tested for powerpc64 and powerpc64le. 2017-06-12 Gabriel F. T. Gomes Tulio Magno Quites Machado Filho * manual/install.texi (Recommended Tools for Compilation): Mention the powerpc64le-specific requirement in the manual. * sysdeps/powerpc/powerpc64le/configure.ac: New file with checks for the compiler features required for building float128. * sysdeps/powerpc/powerpc64le/configure: New, auto-generated file. --- manual/install.texi | 4 +++ sysdeps/powerpc/powerpc64le/configure | 45 ++++++++++++++++++++++++++++++++ sysdeps/powerpc/powerpc64le/configure.ac | 32 +++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 sysdeps/powerpc/powerpc64le/configure create mode 100644 sysdeps/powerpc/powerpc64le/configure.ac diff --git a/manual/install.texi b/manual/install.texi index 65174a8..ff5661a 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -475,6 +475,10 @@ the newest version of the compiler that is known to work for building release time, GCC 6.3 is the newest compiler verified to work to build @theglibc{}. +For PowerPC 64-bits little-endian (powerpc64le), GCC 6.2 or higher is +required. This compiler version is the first to provide the features +required for building @theglibc{} with support for @code{_Float128}. + 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 information is generated for functions selected by IFUNC resolvers. This diff --git a/sysdeps/powerpc/powerpc64le/configure b/sysdeps/powerpc/powerpc64le/configure new file mode 100644 index 0000000..78208d2 --- /dev/null +++ b/sysdeps/powerpc/powerpc64le/configure @@ -0,0 +1,45 @@ +# This file is generated from configure.ac by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/powerpc/powerpc64le. + + +{ $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; } +if ${libc_cv_compiler_powerpc64le_binary128_ok+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror -mfloat128" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +__float128 a, b, c, d, e; +int i; + +__float128 +foobar (__float128 x) +{ + a = __builtin_nansq ("0"); + b = __builtin_huge_valq (); + c = __builtin_infq (); + d = __builtin_fabsq (x); + e = __builtin_nanq ("0"); + i = __builtin_signbit (x); + return __builtin_copysignq (x, x); +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_cv_compiler_powerpc64le_binary128_ok=yes +else + libc_cv_compiler_powerpc64le_binary128_ok=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_binary128_ok" >&5 +$as_echo "$libc_cv_compiler_powerpc64le_binary128_ok" >&6; } +if test "$libc_cv_compiler_powerpc64le_binary128_ok" != "yes"; then : + critic_missing="$critic_missing binary128 floating point type (GCC >= 6.2) is required on powerpc64le." +fi + +test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5 diff --git a/sysdeps/powerpc/powerpc64le/configure.ac b/sysdeps/powerpc/powerpc64le/configure.ac new file mode 100644 index 0000000..e88e224 --- /dev/null +++ b/sysdeps/powerpc/powerpc64le/configure.ac @@ -0,0 +1,32 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/powerpc/powerpc64le. + +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" +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +__float128 a, b, c, d, e; +int i; + +__float128 +foobar (__float128 x) +{ + a = __builtin_nansq ("0"); + b = __builtin_huge_valq (); + c = __builtin_infq (); + d = __builtin_fabsq (x); + e = __builtin_nanq ("0"); + i = __builtin_signbit (x); + return __builtin_copysignq (x, x); +} +]])], + [libc_cv_compiler_powerpc64le_binary128_ok=yes], + [libc_cv_compiler_powerpc64le_binary128_ok=no]) +CFLAGS="$save_CFLAGS"]) +AS_IF([test "$libc_cv_compiler_powerpc64le_binary128_ok" != "yes"], + [critic_missing="$critic_missing binary128 floating point type (GCC >= 6.2) is required on powerpc64le."]) + +test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])