summaryrefslogtreecommitdiff
path: root/gcc/configure
diff options
context:
space:
mode:
authordavek <davek@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-27 02:22:40 +0000
committerdavek <davek@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-27 02:22:40 +0000
commit4d992eb62c555460d61df8961f2f8df95a4f3a0f (patch)
treef1cd7b961ac18dc1a7983cdd108f5b91bbc0cb46 /gcc/configure
parentebd9ec2029d82392f94ae86a3c11bf553f5fc0b4 (diff)
downloadgcc-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 'gcc/configure')
-rwxr-xr-xgcc/configure59
1 files changed, 57 insertions, 2 deletions
diff --git a/gcc/configure b/gcc/configure
index fc4013b98f8..0515812873d 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -671,6 +671,8 @@ subdirs
slibdir
dollar
gcc_tooldir
+LTO_USE_LIBELF
+LTO_BINARY_READER
enable_lto
MAINT
zlibinc
@@ -17092,7 +17094,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17095 "configure"
+#line 17097 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -17198,7 +17200,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17201 "configure"
+#line 17203 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -22942,6 +22944,48 @@ if test $gcc_cv_as_ix86_pe_secrel32 = yes; then
$as_echo "#define HAVE_GAS_PE_SECREL32_RELOC 1" >>confdefs.h
fi
+ # Test if the assembler supports the extended form of the .section
+ # directive that specifies section alignment. LTO support uses this,
+ # but normally only after installation, so we warn but don't fail the
+ # configure if LTO is enabled but the assembler does not support it.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for .section with alignment" >&5
+$as_echo_n "checking assembler for .section with alignment... " >&6; }
+if test "${gcc_cv_as_section_has_align+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ gcc_cv_as_section_has_align=no
+ if test $in_tree_gas = yes; then
+ if test $gcc_cv_gas_vers -ge `expr \( \( 2 \* 1000 \) + 20 \) \* 1000 + 1`
+ then gcc_cv_as_section_has_align=yes
+fi
+ elif test x$gcc_cv_as != x; then
+ echo '.section lto_test,"dr0"' > conftest.s
+ if { ac_try='$gcc_cv_as $gcc_cv_as_flags -fatal-warnings -o conftest.o conftest.s >&5'
+ { { 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
+ gcc_cv_as_section_has_align=yes
+ else
+ echo "configure: failed program was" >&5
+ cat conftest.s >&5
+ fi
+ rm -f conftest.o conftest.s
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_section_has_align" >&5
+$as_echo "$gcc_cv_as_section_has_align" >&6; }
+
+ if test x$gcc_cv_as_section_has_align != xyes; then
+ case ",$enable_languages," in
+ *,lto,*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: LTO for $target requires binutils >= 2.20.1, but version found appears insufficient; LTO will not work until binutils is upgraded." >&5
+$as_echo "$as_me: WARNING: LTO for $target requires binutils >= 2.20.1, but version found appears insufficient; LTO will not work until binutils is upgraded." >&2;}
+ ;;
+ esac
+ fi
;;
esac
@@ -25078,6 +25122,17 @@ $as_echo "#define ENABLE_LTO 1" >>confdefs.h
enable_lto=yes
+ # LTO needs to speak the platform's object file format, and has a
+ # number of implementations of the required binary file access APIs.
+ # ELF is the most common, and default. We only link libelf if ELF
+ # is indeed the selected format.
+ LTO_BINARY_READER=${lto_binary_reader}
+ LTO_USE_LIBELF=-lelf
+ if test "x$lto_binary_reader" != "xlto-elf" ; then
+ LTO_USE_LIBELF=
+ fi
+
+
;;
*) ;;
esac