This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
patch committed: Sync some top level files from gcc
- From: Ian Lance Taylor <iant at google dot com>
- To: binutils at sourceware dot org
- Date: Tue, 06 Oct 2009 22:57:21 -0700
- Subject: patch committed: Sync some top level files from gcc
I have committed the appended patch to sync some top level files the
gcc repository: Makefile.def, Makefile.tpl, configure.ac, Makefile.in,
configure.
Ian
New top-level ChangeLog entries:
2009-10-06 Ian Lance Taylor <iant@google.com>
* Makefile.def: check-gold depends upon all-gas.
* Makefile.in: Rebuild.
2009-10-03 2009-02-05 Rafael Avila de Espindola <espindola@google.com>
* Makefile.def: all-lto-plugin depends on all-libiberty.
set bootstrap=true for lto-plugin.
Add lto-plugin.
* Makefile.in: Regenerate.
* configure.ac (host_libs): Add lto-plugin.
* configure: Regenerate.
2009-10-03 Diego Novillo <dnovillo@google.com>
* Makefile.tpl (HOST_EXPORTS): Add LIBELFLIBS and LIBELFINC.
(HOST_LIBELFLIBS): Define.
(HOST_LIBELFINC): Define.
* Makefile.in: Regenerate.
* configure.ac: Add --enable-lto.
Add --with-libelf, --with-libelf-include and --with-libelf-lib.
If --enable-lto is used, add 'lto' to new_enable_languages.
If --enable-lto is used and gold is enabled, add
lto-plugin to configdirs.
* configure: Regenerate.
2009-10-01 Loren J. Rittle <ljrittle@acm.org>
Paolo Bonzini <bonzini@gnu.org>
* Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Use $$s rather than
$(srcdir).
* Makefile.in: Rebuilt.
2009-09-22 Loren J. Rittle <ljrittle@acm.org>
* Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Remove stray $$r/.
* Makefile.in: Rebuilt.
Index: Makefile.def
===================================================================
RCS file: /cvs/src/src/Makefile.def,v
retrieving revision 1.104
diff -u -r1.104 Makefile.def
--- Makefile.def 2 Sep 2009 07:05:01 -0000 1.104
+++ Makefile.def 7 Oct 2009 05:53:30 -0000
@@ -97,7 +97,8 @@
host_modules= { module= libcpp; bootstrap=true; };
host_modules= { module= libdecnumber; bootstrap=true; };
host_modules= { module= libgui; };
-host_modules= { module= libiberty; bootstrap=true; };
+host_modules= { module= libiberty; bootstrap=true;
+ extra_configure_flags='@extra_host_libiberty_configure_flags@';};
// We abuse missing to avoid installing anything for libiconv.
host_modules= { module= libiconv;
extra_configure_flags='--disable-shared';
@@ -141,6 +142,7 @@
missing=maintainer-clean; };
host_modules= { module= utils; no_check=true; };
host_modules= { module= gnattools; };
+host_modules= { module= lto-plugin; bootstrap=true; };
target_modules = { module= libstdc++-v3;
bootstrap=true;
@@ -346,6 +348,8 @@
dependencies = { module=all-gnattools; on=all-target-libada; };
+dependencies = { module=all-lto-plugin; on=all-libiberty; };
+
dependencies = { module=configure-mpfr; on=all-gmp; };
dependencies = { module=configure-mpc; on=all-mpfr; };
dependencies = { module=configure-ppl; on=all-gmp; };
@@ -424,6 +428,7 @@
dependencies = { module=all-gold; on=all-build-bison; };
dependencies = { module=all-gold; on=all-build-byacc; };
dependencies = { module=check-gold; on=all-binutils; };
+dependencies = { module=check-gold; on=all-gas; };
dependencies = { module=configure-opcodes; on=configure-intl; };
dependencies = { module=all-opcodes; on=all-bfd; };
Index: Makefile.tpl
===================================================================
RCS file: /cvs/src/src/Makefile.tpl,v
retrieving revision 1.210
diff -u -r1.210 Makefile.tpl
--- Makefile.tpl 7 Sep 2009 00:44:07 -0000 1.210
+++ Makefile.tpl 7 Oct 2009 05:53:35 -0000
@@ -222,6 +222,8 @@
PPLINC="$(HOST_PPLINC)"; export PPLINC; \
CLOOGLIBS="$(HOST_CLOOGLIBS)"; export CLOOGLIBS; \
CLOOGINC="$(HOST_CLOOGINC)"; export CLOOGINC; \
+ LIBELFLIBS="$(HOST_LIBELFLIBS)" ; export LIBELFLIBS; \
+ LIBELFINC="$(HOST_LIBELFINC)" ; export LIBELFINC; \
@if gcc-bootstrap
$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
@endif gcc-bootstrap
@@ -238,7 +240,7 @@
-B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
-I$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
- -I$$r/$(srcdir)/libstdc++-v3/libsupc++ \
+ -I$$s/libstdc++-v3/libsupc++ \
-L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs"; export CXX; \
CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD; \
GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
@@ -296,6 +298,10 @@
HOST_CLOOGLIBS = @clooglibs@
HOST_CLOOGINC = @clooginc@
+# Where to find libelf
+HOST_LIBELFLIBS = @libelflibs@
+HOST_LIBELFINC = @libelfinc@
+
# ----------------------------------------------
# Programs producing files for the BUILD machine
# ----------------------------------------------
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/configure.ac,v
retrieving revision 1.83
diff -u -r1.83 configure.ac
--- configure.ac 29 Sep 2009 21:31:07 -0000 1.83
+++ configure.ac 7 Oct 2009 05:53:38 -0000
@@ -260,6 +260,13 @@
noconfigdirs="$noconfigdirs gas"
fi
+use_included_zlib=
+# Make sure we don't let ZLIB be added if we didn't want it.
+if test x$with_system_zlib = xyes ; then
+ use_included_zlib=no
+ noconfigdirs="$noconfigdirs zlib"
+fi
+
# some tools are so dependent upon X11 that if we're not building with X,
# it's not even worth trying to configure, much less build, that tool.
@@ -1611,6 +1618,127 @@
AC_SUBST(clooglibs)
AC_SUBST(clooginc)
+# Check for LTO support.
+AC_ARG_ENABLE(lto,
+[ --enable-lto enable link time optimization support],
+enable_lto=$enableval,
+enable_lto=yes; default_enable_lto=yes)
+
+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
+ plus --with-libelf-lib=PATH/lib])
+
+ AC_ARG_WITH(libelf_include, [ --with-libelf-include=PATH Specify directory for installed libelf include files])
+
+ AC_ARG_WITH(libelf_lib, [ --with-libelf-lib=PATH Specify the directory for the installed libelf library])
+
+ case $with_libelf in
+ "")
+ libelflibs="-lelf"
+ libelfinc="-I/usr/include/libelf"
+ ;;
+ *)
+ libelflibs="-L$with_libelf/lib -lelf"
+ libelfinc="-I$with_libelf/include -I$with_libelf/include/libelf"
+ LIBS="$libelflibs $LIBS"
+ ;;
+ esac
+
+ if test "x$with_libelf_include" != x; then
+ libelfinc="-I$with_libelf_include"
+ fi
+
+ if test "x$with_libelf_lib" != x; then
+ libelflibs="-L$with_libelf_lib -lelf"
+ LIBS="$libelflibs $LIBS"
+ fi
+
+ if test "x$with_libelf$with_libelf_include$with_libelf_lib" = x \
+ && test -d ${srcdir}/libelf; then
+ libelflibs='-L$$r/$(HOST_SUBDIR)/libelf/.libs -L$$r/$(HOST_SUBDIR)/libelf/_libs -lelf '
+ libelfinc='-I$$r/$(HOST_SUBDIR)/libelf/include -I$$s/libelf/include'
+ LIBS="$libelflibs $LIBS"
+ fi
+
+ saved_CFLAGS="$CFLAGS"
+ saved_CPPFLAGS="$CPPFLAGS"
+ saved_LIBS="$LIBS"
+
+ CFLAGS="$CFLAGS $libelfinc"
+ CPPFLAGS="$CPPFLAGS $libelfinc"
+ LIBS="$LIBS $libelflibs"
+
+ AC_CHECK_HEADERS(libelf.h, [have_libelf_h=yes])
+ AC_CHECK_HEADERS(gelf.h, [have_gelf_h=yes])
+
+ AC_CHECK_HEADERS(libelf/libelf.h, [have_libelf_libelf_h=yes])
+ AC_CHECK_HEADERS(libelf/gelf.h, [have_libelf_gelf_h=yes])
+
+ # If we couldn't find libelf.h and the user forced it, emit an error.
+ if test x"$have_libelf_h" != x"yes" \
+ && test x"$have_libelf_libelf_h" != x"yes" ; then
+ if test x"$default_enable_lto" != x"yes" ; then
+ AC_MSG_ERROR([LTO support requires libelf.h or libelf/libelf.h.])
+ else
+ enable_lto=no
+ libelflibs=
+ libelfinc=
+ fi
+ fi
+
+ # If we couldn't find gelf.h and the user forced it, emit an error.
+ if test x"$have_gelf_h" != x"yes" \
+ && test x"$have_libelf_gelf_h" != x"yes" ; then
+ if test x"$default_enable_lto" != x"yes" ; then
+ AC_MSG_ERROR([LTO support requires gelf.h or libelf/gelf.h.])
+ else
+ enable_lto=no
+ libelflibs=
+ libelfinc=
+ fi
+ fi
+
+ # Check that the detected libelf has the functions we need. We cannot
+ # rely on just detecting the headers since they do not include
+ # versioning information. Add functions, if needed.
+ if test x"$enable_lto" = x"yes" ; then
+ AC_MSG_CHECKING([for the correct version of libelf])
+ AC_TRY_LINK(
+ [#include <libelf.h>],[
+ elf_errmsg (0);
+ elf_getscn (0, 0);
+ elf_nextscn (0, 0);
+ elf_strptr (0, 0, 0);
+ elf_getident (0, 0);
+ elf_getshdrstrndx (0, 0);
+ elf_begin (0, 0, 0);
+ elf_ndxscn (0);
+ elf_end (0);
+ ],
+ [AC_MSG_RESULT([yes]);],
+ [AC_MSG_RESULT([no]); enable_lto=no; libelflibs= ; libelfinc= ]
+ )
+
+ # If we couldn't enable LTO and the user forced it, emit an error.
+ if test x"$enable_lto" = x"no" \
+ && test x"$default_enable_lto" != x"yes" ; then
+ AC_MSG_ERROR([To enable LTO, GCC requires libelf v0.8.12+.
+Try the --with-libelf, --with-libelf-include and --with-libelf-lib options
+to specify its location.])
+ fi
+ fi
+
+ CFLAGS="$saved_CFLAGS"
+ CPPFLAGS="$saved_CPPFLAGS"
+ LIBS="$saved_LIBS"
+
+ # Flags needed for libelf.
+ AC_SUBST(libelflibs)
+ AC_SUBST(libelfinc)
+fi
+
# By default, C is the only stage 1 language.
stage1_languages=,c,
@@ -1679,6 +1807,18 @@
done
new_enable_languages=,c,
+
+ # If LTO is enabled, add the LTO front end.
+ extra_host_libiberty_configure_flags=
+ if test "$enable_lto" = "yes" ; then
+ new_enable_languages="${new_enable_languages}lto,"
+ if test "${ENABLE_GOLD}" = "yes" ; then
+ configdirs="$configdirs lto-plugin"
+ extra_host_libiberty_configure_flags=--enable-shared
+ fi
+ fi
+ AC_SUBST(extra_host_libiberty_configure_flags)
+
missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
potential_languages=,c,
@@ -2088,7 +2228,7 @@
fi
fi
-# Set with_gnu_as and with_gnu_ld as appropriate.
+# Set with_gnu_as, with_gnu_ld, and with_system_zlib as appropriate.
#
# This is done by determining whether or not the appropriate directory
# is available, and by checking whether or not specific configurations
@@ -2099,7 +2239,9 @@
#
# If the default for a toolchain is to use GNU as and ld, and you don't
# want to do that, then you should use the --without-gnu-as and
-# --without-gnu-ld options for the configure script.
+# --without-gnu-ld options for the configure script. Similarly, if
+# the default is to use the included zlib and you don't want to do that,
+# you should use the --with-system-zlib option for the configure script.
if test x${use_gnu_as} = x &&
echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then
@@ -2113,6 +2255,14 @@
extra_host_args="$extra_host_args --with-gnu-ld"
fi
+if test x${use_included_zlib} = x &&
+ echo " ${configdirs} " | grep " zlib " > /dev/null 2>&1 ; then
+ :
+else
+ with_system_zlib=yes
+ extra_host_args="$extra_host_args --with-system-zlib"
+fi
+
# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure
# can detect this case.