summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDave Korn <dave.korn@artimi.com>2010-05-26 05:16:30 +0000
committerDave Korn <dave.korn@artimi.com>2010-05-26 05:16:30 +0000
commite6da849392e3f2052ccfb110760bf12a3935ead3 (patch)
treef286057fbaaa483e1fabb52e3daf075e8e0f3652 /configure.ac
parentdf91c7baabb0e5116613ff6cf5f374cf82495c60 (diff)
downloadgdb-e6da849392e3f2052ccfb110760bf12a3935ead3.tar.gz
Merge from gcc:
2010-05-18 Steven Bosscher <steven AT gcc.gnu.org> * configure.ac (--enable-lto): All *-apple-darwin* now support LTO. * configure: Regenerate. 2010-05-07 Steven Bosscher <steven AT gcc.gnu.org> * configure.ac (--enable-lto): Add x86_64-apple-darwin* as a platform that supports LTO. * configure: Regenerate. 2010-04-27 Dave Korn <dave.korn.cygwin AT gmail.com> PR lto/42776 * configure.ac (--enable-lto): Refactor handling so libelf tests are only performed inside then-clause of ACX_ELF_TARGET_IFELSE, and allow LTO to be explicitly enabled on non-ELF platforms that are known to support it inside else-clause. * configure: Regenerate.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac31
1 files changed, 20 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 6d3390a737d..507ab547b53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1651,17 +1651,8 @@ AC_ARG_ENABLE(lto,
enable_lto=$enableval,
enable_lto=yes; default_enable_lto=yes)
-ACX_ELF_TARGET_IFELSE([],
-if test x"$default_enable_lto" = x"yes" ; then
- enable_lto=no
-else
- if test x"$enable_lto" = x"yes"; then
- AC_MSG_ERROR([LTO support requires an ELF target.])
- fi
-fi
-default_enable_lto=no)
-if test x"$enable_lto" = x"yes" ; then
+ACX_ELF_TARGET_IFELSE([if test x"$enable_lto" = x"yes" ; then
# Make sure that libelf.h and gelf.h are available.
AC_ARG_WITH(libelf, [ --with-libelf=PATH Specify prefix directory for the installed libelf package
Equivalent to --with-libelf-include=PATH/include
@@ -1777,7 +1768,25 @@ to specify its location.])
# Flags needed for libelf.
AC_SUBST(libelflibs)
AC_SUBST(libelfinc)
-fi
+fi],[if test x"$default_enable_lto" = x"yes" ; then
+ # On non-ELF platforms, LTO must be explicitly enabled.
+ enable_lto=no
+ else
+ # Apart from ELF platforms, only Windows supports LTO so far. It
+ # would also be nice to check the binutils support, but we don't
+ # have gcc_GAS_CHECK_FEATURE available here. For now, we'll just
+ # warn during gcc/ subconfigure; unless you're bootstrapping with
+ # -flto it won't be needed until after installation anyway.
+ case $target in
+ *-cygwin*|*-mingw*) ;;
+ *-apple-darwin*) ;;
+ *) if test x"$enable_lto" = x"yes"; then
+ AC_MSG_ERROR([LTO support is not enabled for this target.])
+ fi
+ ;;
+ esac
+ fi
+ default_enable_lto=no])
# By default, C is the only stage 1 language.