diff options
author | davek <davek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-27 02:22:40 +0000 |
---|---|---|
committer | davek <davek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-04-27 02:22:40 +0000 |
commit | 4d992eb62c555460d61df8961f2f8df95a4f3a0f (patch) | |
tree | f1cd7b961ac18dc1a7983cdd108f5b91bbc0cb46 /configure.ac | |
parent | ebd9ec2029d82392f94ae86a3c11bf553f5fc0b4 (diff) | |
download | gcc-4d992eb62c555460d61df8961f2f8df95a4f3a0f.tar.gz |
ChangeLog:
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.
gcc/ChangeLog:
PR lto/42776
* configure.ac (gcc_cv_as_section_has_align): Set if installed
binutils supports extended .section directive needed by LTO, or
warn if older binutils found.
(LTO_BINARY_READER): New AC_SUBST'd variable.
(LTO_USE_LIBELF): Likewise.
* gcc/config.gcc (lto_binary_reader): New target-specific configure
variable.
* gcc/Makefile.in (LTO_BINARY_READER): Import AC_SUBST'd autoconf var.
(LTO_USE_LIBELF): Likewise.
* configure: Regenerate.
* collect2.c (is_elf): Rename from this ...
(is_elf_or_coff): ... to this, and recognize and allow i386 COFF
object files in addition to ELF-formatted ones.
(scan_prog_file): Caller updated. Also allow for LTO info marker
symbol to be prefixed or not by an extra underscore.
* config/i386/t-cygming (winnt.o): Also depend on LTO_STREAMER_H.
* config/i386/winnt.c: Also #include lto-streamer.h
(i386_pe_asm_named_section): Specify 1-byte section alignment for
LTO named sections.
(i386_pe_asm_output_aligned_decl_common): Add comment.
(i386_pe_maybe_record_exported_symbol): Allow decl arg to be NULL.
gcc/lto/ChangeLog:
PR lto/42776
* Make-lang.in (LTO_OBJS): Use LTO_BINARY_READER instead of
hardcoding 'lto-elf.o'.
($(LTO_EXE)): Use LTO_USE_LIBELF instead of hardcoding '-lelf'.
* lto-coff.h: New file.
* lto-coff.c: Likewise.
gcc/testsuite/ChangeLog:
PR lto/42776
* lib/lto.exp (lto_prune_vis_warns): New function.
(lto-link-and-maybe-run): Call it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158762 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index c46fc4d9946..1ae21407cb8 100644 --- a/configure.ac +++ b/configure.ac @@ -1637,17 +1637,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 @@ -1783,7 +1774,24 @@ 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*) ;; + *) 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. |