From e1091db82fccf294381943caa99b8aedac89a28e Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Fri, 14 Oct 2022 13:31:57 -0400 Subject: [PATCH] Don't try to use -ffat-lto-objects with clang --- configure | 14 ++++++++++++-- configure.in | 11 +++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/configure b/configure index eceaa348..19293229 100755 --- a/configure +++ b/configure @@ -3975,7 +3975,14 @@ fi if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" # Check for link-time optimization support - for f in -flto=auto -ffat-lto-objects; do + f=-flto=auto + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $f" >&5 +$as_echo_n "checking whether $CC supports $f... " >&6; } + if $CC -E $f /dev/null > /dev/null 2>&1 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + CFLAGS="$CFLAGS $f" + f=-ffat-lto-objects { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $f" >&5 $as_echo_n "checking whether $CC supports $f... " >&6; } if $CC -E $f /dev/null > /dev/null 2>&1 ; then @@ -3986,7 +3993,10 @@ $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - done + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi fi if test "$ac_cv_perlartifacts" = "yes" ; then diff --git a/configure.in b/configure.in index 8d448752..5d84edb9 100644 --- a/configure.in +++ b/configure.in @@ -47,7 +47,12 @@ AC_HEADER_TIME if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" # Check for link-time optimization support - for f in -flto=auto -ffat-lto-objects; do + f=-flto=auto + AC_MSG_CHECKING([whether $CC supports $f]) + if $CC -E $f /dev/null > /dev/null 2>&1 ; then + AC_MSG_RESULT([yes]) + CFLAGS="$CFLAGS $f" + f=-ffat-lto-objects AC_MSG_CHECKING([whether $CC supports $f]) if $CC -E $f /dev/null > /dev/null 2>&1 ; then AC_MSG_RESULT([yes]) @@ -55,7 +60,9 @@ if test "$GCC" = yes; then else AC_MSG_RESULT([no]) fi - done + else + AC_MSG_RESULT([no]) + fi fi if test "$ac_cv_perlartifacts" = "yes" ; then