From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 031683858C52; Fri, 28 Oct 2022 17:43:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 031683858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666979012; bh=+UkvLDKvOkQdkbWy8xHjbbPTVNB+xB4NYaZv75V3ExA=; h=From:To:Subject:Date:From; b=kmMgmr0QMScp6I4/aX7x+E3jPjx3yc1QazvJUWsG79ErX4NemzGq1YtaGMV1pyAMw ECLf7Hkt4ahN+vVGke5GmWUPeKHre/exCEdzHU/RxrmZKZuhna+aS1h1b8kTJQkbSh 4NBs6v32fcaKamYNO4T6QGXcQgCpv2vYEsY9Yj5g= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] x86: Use -mfpmath=387 iff compiler supports it X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 0108c4fcc299af5f44771320877a872b70cfe9f9 X-Git-Newrev: 55655233d7022ee0a1ae5cd73896f3b27bf1701f Message-Id: <20221028174332.031683858C52@sourceware.org> Date: Fri, 28 Oct 2022 17:43:32 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=55655233d7022ee0a1ae5cd73896f3b27bf1701f commit 55655233d7022ee0a1ae5cd73896f3b27bf1701f Author: Adhemerval Zanella Date: Thu Mar 24 15:02:05 2022 -0300 x86: Use -mfpmath=387 iff compiler supports it Diff: --- sysdeps/x86/configure | 22 ++++++++++++++++++++++ sysdeps/x86/configure.ac | 10 ++++++++++ sysdeps/x86/fpu/Makefile | 5 ++++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/sysdeps/x86/configure b/sysdeps/x86/configure index af6ac34b5b..a4a192a55d 100644 --- a/sysdeps/x86/configure +++ b/sysdeps/x86/configure @@ -190,5 +190,27 @@ fi config_vars="$config_vars enable-x86-isa-level = $libc_cv_include_x86_isa_level" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -mpfmath=387" >&5 +$as_echo_n "checking if compiler supports -mpfmath=387... " >&6; } +if ${libc_cv_cc_mfpmath_387+:} false; then : + $as_echo_n "(cached) " >&6 +else + if { ac_try='${CC-cc} -Werror -mfpmath=387 -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_cc_mfpmath_387="-mfpmath=387" +else + libc_cv_cc_mfpmath_387= +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_mfpmath_387" >&5 +$as_echo "$libc_cv_cc_mfpmath_387" >&6; } +config_vars="$config_vars +config-cflags-mfpath-387 = $libc_cv_cc_mfpmath_387" + $as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h diff --git a/sysdeps/x86/configure.ac b/sysdeps/x86/configure.ac index 4e2a6d68ff..022ace0dd5 100644 --- a/sysdeps/x86/configure.ac +++ b/sysdeps/x86/configure.ac @@ -128,5 +128,15 @@ if test $libc_cv_include_x86_isa_level = yes; then fi LIBC_CONFIG_VAR([enable-x86-isa-level], [$libc_cv_include_x86_isa_level]) +dnl Determine if compiler supports -mfpmath=387 +AC_CACHE_CHECK([if compiler supports -mpfmath=387], + libc_cv_cc_mfpmath_387, [dnl +LIBC_TRY_CC_OPTION([-Werror -mfpmath=387], + [libc_cv_cc_mfpmath_387="-mfpmath=387"], + [libc_cv_cc_mfpmath_387=]) +]) +LIBC_CONFIG_VAR([config-cflags-mfpath-387], + [$libc_cv_cc_mfpmath_387]) + dnl Static PIE is supported. AC_DEFINE(SUPPORT_STATIC_PIE) diff --git a/sysdeps/x86/fpu/Makefile b/sysdeps/x86/fpu/Makefile index 68bd42cdd3..2d584dbfeb 100644 --- a/sysdeps/x86/fpu/Makefile +++ b/sysdeps/x86/fpu/Makefile @@ -4,7 +4,10 @@ CPPFLAGS += -I../soft-fp libm-support += powl_helper tests += test-fenv-sse test-fenv-clear-sse test-fenv-x87 test-fenv-sse-2 \ - test-flt-eval-method-387 test-flt-eval-method-sse + test-flt-eval-method-sse +ifneq ($(config-cflags-mfpath-387),) +tests += test-flt-eval-method-387 +endif CFLAGS-test-fenv-sse.c += -msse2 -mfpmath=sse CFLAGS-test-fenv-clear-sse.c += -msse2 -mfpmath=sse CFLAGS-test-fenv-sse-2.c += -msse2 -mfpmath=sse