aboutsummaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 1676c40..67973b1 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -3202,6 +3202,19 @@ foo: nop
rm -f conftest],
[AC_DEFINE(HAVE_GAS_PE_SECREL32_RELOC, 1,
[Define if your assembler and linker support 32-bit section relative relocs via '.secrel32 label'.])])
+ # 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.
+ gcc_GAS_CHECK_FEATURE([.section with alignment], gcc_cv_as_section_has_align,
+ [2,20,1],-fatal-warnings,[.section lto_test,"dr0"])
+ if test x$gcc_cv_as_section_has_align != xyes; then
+ case ",$enable_languages," in
+ *,lto,*)
+ AC_MSG_WARN([LTO for $target requires binutils >= 2.20.1, but version found appears insufficient; LTO will not work until binutils is upgraded.])
+ ;;
+ esac
+ fi
;;
esac
@@ -4270,6 +4283,17 @@ changequote([,])dnl
AC_DEFINE(ENABLE_LTO, 1, [Define to enable LTO support.])
enable_lto=yes
AC_SUBST(enable_lto)
+ # 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
+ AC_SUBST(LTO_BINARY_READER)
+ AC_SUBST(LTO_USE_LIBELF)
;;
*) ;;
esac