From 8e4987eebaf47998e3b26db6c5ce8d30a60b5e02 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Mon, 20 Oct 2025 11:40:18 -0400 Subject: [PATCH] Don't enable LTO on Solaris. --- configure | 6 ++++-- configure.ac | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 2ae949bc..4d2126ab 100755 --- a/configure +++ b/configure @@ -4225,8 +4225,10 @@ printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h fi +U="`uname -s`" -if test "$GCC" = yes; then +# LTO fails on Solaris for some reason +if test "$U" != "SunOS" -a "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" # Check for link-time optimization support CFLAGS="$CFLAGS -flto=auto" @@ -4260,7 +4262,7 @@ printf "%s\n" "$lto" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -ffat-lto-object" >&5 printf %s "checking whether $CC supports -ffat-lto-object... " >&6; } - CFLAGS="$CFLAGS -flto=auto -ffat-lto-objects" + CFLAGS="$CFLAGS -ffat-lto-objects" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int x = 1; diff --git a/configure.ac b/configure.ac index 07d2cc70..6d0d16ac 100644 --- a/configure.ac +++ b/configure.ac @@ -44,8 +44,10 @@ AC_CHECK_HEADERS(strings.h sys/types.h glob.h wctype.h locale.h langinfo.h sys/i dnl Checks for typedefs, structures, and compiler characteristics. AC_STRUCT_TM +U="`uname -s`" -if test "$GCC" = yes; then +# LTO fails on Solaris for some reason +if test "$U" != "SunOS" -a "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" # Check for link-time optimization support CFLAGS="$CFLAGS -flto=auto" @@ -62,7 +64,7 @@ if test "$GCC" = yes; then CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes" else AC_MSG_CHECKING([whether $CC supports -ffat-lto-object]) - CFLAGS="$CFLAGS -flto=auto -ffat-lto-objects" + CFLAGS="$CFLAGS -ffat-lto-objects" AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[int x = 1;]],