[LTO] Build libiberty with --enable-shared if gold+lto are enabled
Diego Novillo
dnovillo@google.com
Tue Sep 29 20:52:00 GMT 2009
This patch from Ian removes the last libiberty modification. We
only need to build an -fPIC variant of libiberty if gold is
enabled.
Tested on x86_64 with and without gold support.
Diego.
2009-09-29 Ian Lance Taylor <iant@google.com>
Diego Novillo <dnovillo@google.com>
* configure.ac (extra_host_libiberty_configure_flags):
Set to --enable-shared.
* Makefile.def: For libiberty, set extra_configure_flags
to @extra_host_libiberty_configure_flags@.
* configure: Regenerate.
* Makefile.in: Regenerate.
libiberty/ChangeLog.lto
2009-09-29 Diego Novillo <dnovillo@google.com>
* configure.ac: Do not build with --enable-shared by
default.
* configure: Regenerate.
Index: configure.ac
===================================================================
--- configure.ac (revision 152279)
+++ configure.ac (working copy)
@@ -1809,12 +1809,15 @@ if test -d ${srcdir}/gcc; then
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,
Index: Makefile.def
===================================================================
--- Makefile.def (revision 152279)
+++ Makefile.def (working copy)
@@ -97,7 +97,8 @@ host_modules= { module= ld; bootstrap=tr
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';
Index: libiberty/configure.ac
===================================================================
--- libiberty/configure.ac (revision 152279)
+++ libiberty/configure.ac (working copy)
@@ -192,11 +192,10 @@ if [[ -n "${frag}" ]]; then
fi
# If they didn't specify --enable-shared, don't generate shared libs.
-# We build shared by default in lto. Find a better way before merging.
case "${enable_shared}" in
yes) shared=yes ;;
no) shared=no ;;
- "") shared=yes ;;
+ "") shared=no ;;
*) shared=yes ;;
esac
if [[ "${shared}" = "yes" ]]; then
More information about the Gcc-patches
mailing list