Commit 45b3824d by Thomas Schwinge Committed by Thomas Schwinge

Non-host system configuration for linker plugins.

	* configure.ac (--enable-linker-plugin-configure-flags)
	(--enable-linker-plugin-flags): New flags.
	(configdirs): Conditionally add libiberty-linker-plugin.
	* configure: Regenerate.
	* Makefile.def (host_modules): Add libiberty-linker-plugin.
	(host_modules) <lto-plugin>: Pay attention to
	@extra_linker_plugin_flags@ and
	@extra_linker_plugin_configure_flags@.
	(all-lto-plugin): Also depend on all-libiberty-linker-plugin.
	* Makefile.in: Regenerate.
	gcc/
	* doc/install.texi (--enable-linker-plugin-configure-flags)
	(--enable-linker-plugin-flags): Document new flags.

From-SVN: r211644
parent b6383ab8
2014-06-13 Thomas Schwinge <thomas@codesourcery.com> 2014-06-13 Thomas Schwinge <thomas@codesourcery.com>
* configure.ac (--enable-linker-plugin-configure-flags)
(--enable-linker-plugin-flags): New flags.
(configdirs): Conditionally add libiberty-linker-plugin.
* configure: Regenerate.
* Makefile.def (host_modules): Add libiberty-linker-plugin.
(host_modules) <lto-plugin>: Pay attention to
@extra_linker_plugin_flags@ and
@extra_linker_plugin_configure_flags@.
(all-lto-plugin): Also depend on all-libiberty-linker-plugin.
* Makefile.in: Regenerate.
* Makefile.tpl (configure-[+prefix+][+module+]) * Makefile.tpl (configure-[+prefix+][+module+])
(configure-stage[+id+]-[+prefix+][+module+]): If specified, use (configure-stage[+id+]-[+prefix+][+module+]): If specified, use
"module_srcdir" instead of "module" for locating a module's srcdir. "module_srcdir" instead of "module" for locating a module's srcdir.
......
...@@ -85,6 +85,14 @@ host_modules= { module= libdecnumber; bootstrap=true; }; ...@@ -85,6 +85,14 @@ host_modules= { module= libdecnumber; bootstrap=true; };
host_modules= { module= libgui; }; host_modules= { module= libgui; };
host_modules= { module= libiberty; bootstrap=true; host_modules= { module= libiberty; bootstrap=true;
extra_configure_flags='@extra_host_libiberty_configure_flags@';}; extra_configure_flags='@extra_host_libiberty_configure_flags@';};
// Linker plugins may need their own build of libiberty; see
// gcc/doc/install.texi. We take care that this build of libiberty doesn't get
// installed. It's a helper library for linker plugins, so we pay attention to
// @extra_linker_plugin_flags@ and @extra_linker_plugin_configure_flags@.
host_modules= { module= libiberty-linker-plugin; bootstrap=true;
module_srcdir=libiberty;
extra_configure_flags='@extra_host_libiberty_configure_flags@ --disable-install-libiberty @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@';
extra_make_flags='@extra_linker_plugin_flags@'; };
// We abuse missing to avoid installing anything for libiconv. // We abuse missing to avoid installing anything for libiconv.
host_modules= { module= libiconv; host_modules= { module= libiconv;
extra_configure_flags='--disable-shared'; extra_configure_flags='--disable-shared';
...@@ -111,7 +119,8 @@ host_modules= { module= libtermcap; no_check=true; ...@@ -111,7 +119,8 @@ host_modules= { module= libtermcap; no_check=true;
host_modules= { module= utils; no_check=true; }; host_modules= { module= utils; no_check=true; };
host_modules= { module= gnattools; }; host_modules= { module= gnattools; };
host_modules= { module= lto-plugin; bootstrap=true; host_modules= { module= lto-plugin; bootstrap=true;
extra_configure_flags=--enable-shared; }; extra_configure_flags='--enable-shared @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@';
extra_make_flags='@extra_linker_plugin_flags@'; };
target_modules = { module= libstdc++-v3; target_modules = { module= libstdc++-v3;
bootstrap=true; bootstrap=true;
...@@ -338,7 +347,10 @@ dependencies = { module=all-fixincludes; on=all-libiberty; }; ...@@ -338,7 +347,10 @@ dependencies = { module=all-fixincludes; on=all-libiberty; };
dependencies = { module=all-gnattools; on=all-target-libada; }; dependencies = { module=all-gnattools; on=all-target-libada; };
dependencies = { module=all-gnattools; on=all-target-libstdc++-v3; }; dependencies = { module=all-gnattools; on=all-target-libstdc++-v3; };
// Depending on the specific configuration, the LTO plugin will either use the
// generic libiberty build or the specific build for linker plugins.
dependencies = { module=all-lto-plugin; on=all-libiberty; }; dependencies = { module=all-lto-plugin; on=all-libiberty; };
dependencies = { module=all-lto-plugin; on=all-libiberty-linker-plugin; };
dependencies = { module=all-utils; on=all-libiberty; }; dependencies = { module=all-utils; on=all-libiberty; };
......
...@@ -644,6 +644,8 @@ DEBUG_PREFIX_CFLAGS_FOR_TARGET ...@@ -644,6 +644,8 @@ DEBUG_PREFIX_CFLAGS_FOR_TARGET
SYSROOT_CFLAGS_FOR_TARGET SYSROOT_CFLAGS_FOR_TARGET
stage1_languages stage1_languages
extra_host_libiberty_configure_flags extra_host_libiberty_configure_flags
extra_linker_plugin_flags
extra_linker_plugin_configure_flags
clooginc clooginc
clooglibs clooglibs
islinc islinc
...@@ -778,6 +780,8 @@ with_cloog_include ...@@ -778,6 +780,8 @@ with_cloog_include
with_cloog_lib with_cloog_lib
enable_cloog_version_check enable_cloog_version_check
enable_lto enable_lto
enable_linker_plugin_configure_flags
enable_linker_plugin_flags
enable_stage1_languages enable_stage1_languages
enable_objc_gc enable_objc_gc
with_build_sysroot with_build_sysroot
...@@ -1477,6 +1481,12 @@ Optional Features: ...@@ -1477,6 +1481,12 @@ Optional Features:
--disable-cloog-version-check --disable-cloog-version-check
disable check for CLooG version disable check for CLooG version
--enable-lto enable link time optimization support --enable-lto enable link time optimization support
--enable-linker-plugin-configure-flags=FLAGS
additional flags for configuring linker plugins
[none]
--enable-linker-plugin-flags=FLAGS
additional flags for configuring and building linker
plugins [none]
--enable-stage1-languages[=all] --enable-stage1-languages[=all]
choose additional languages to build during stage1. choose additional languages to build during stage1.
Mostly useful for compiler development Mostly useful for compiler development
...@@ -6302,6 +6312,23 @@ else ...@@ -6302,6 +6312,23 @@ else
fi fi
# Check whether --enable-linker-plugin-configure-flags was given.
if test "${enable_linker_plugin_configure_flags+set}" = set; then :
enableval=$enable_linker_plugin_configure_flags; extra_linker_plugin_configure_flags=$enableval
else
extra_linker_plugin_configure_flags=
fi
# Check whether --enable-linker-plugin-flags was given.
if test "${enable_linker_plugin_flags+set}" = set; then :
enableval=$enable_linker_plugin_flags; extra_linker_plugin_flags=$enableval
else
extra_linker_plugin_flags=
fi
# By default, C and C++ are the only stage 1 languages. # By default, C and C++ are the only stage 1 languages.
stage1_languages=,c, stage1_languages=,c,
...@@ -6712,6 +6739,21 @@ for i in ${target_configdirs_all} ; do ...@@ -6712,6 +6739,21 @@ for i in ${target_configdirs_all} ; do
fi fi
done done
# libiberty-linker-plugin is special: it doesn't have its own source directory,
# so we have to add it after the preceding checks.
if test x"$extra_linker_plugin_flags$extra_linker_plugin_configure_flags" != x
then
case " $configdirs " in
*" libiberty "*)
# If we can build libiberty, we can also build libiberty-linker-plugin.
configdirs="$configdirs libiberty-linker-plugin"
extra_linker_plugin_configure_flags="$extra_linker_plugin_configure_flags \
--with-libiberty=../libiberty-linker-plugin";;
*)
as_fn_error "libiberty missing" "$LINENO" 5;;
esac
fi
# Produce a warning message for the subdirs we can't configure. # Produce a warning message for the subdirs we can't configure.
# This isn't especially interesting in the Cygnus tree, but in the individual # This isn't especially interesting in the Cygnus tree, but in the individual
# FSF releases, it's important to let people know when their machine isn't # FSF releases, it's important to let people know when their machine isn't
......
...@@ -1731,6 +1731,19 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always. ...@@ -1731,6 +1731,19 @@ ACX_ELF_TARGET_IFELSE([# ELF platforms build the lto-plugin always.
esac esac
]) ])
AC_ARG_ENABLE(linker-plugin-configure-flags,
[AS_HELP_STRING([[--enable-linker-plugin-configure-flags=FLAGS]],
[additional flags for configuring linker plugins @<:@none@:>@])],
extra_linker_plugin_configure_flags=$enableval,
extra_linker_plugin_configure_flags=)
AC_SUBST(extra_linker_plugin_configure_flags)
AC_ARG_ENABLE(linker-plugin-flags,
[AS_HELP_STRING([[--enable-linker-plugin-flags=FLAGS]],
[additional flags for configuring and building linker plugins @<:@none@:>@])],
extra_linker_plugin_flags=$enableval,
extra_linker_plugin_flags=)
AC_SUBST(extra_linker_plugin_flags)
# By default, C and C++ are the only stage 1 languages. # By default, C and C++ are the only stage 1 languages.
stage1_languages=,c, stage1_languages=,c,
...@@ -2141,6 +2154,21 @@ for i in ${target_configdirs_all} ; do ...@@ -2141,6 +2154,21 @@ for i in ${target_configdirs_all} ; do
fi fi
done done
# libiberty-linker-plugin is special: it doesn't have its own source directory,
# so we have to add it after the preceding checks.
if test x"$extra_linker_plugin_flags$extra_linker_plugin_configure_flags" != x
then
case " $configdirs " in
*" libiberty "*)
# If we can build libiberty, we can also build libiberty-linker-plugin.
configdirs="$configdirs libiberty-linker-plugin"
extra_linker_plugin_configure_flags="$extra_linker_plugin_configure_flags \
--with-libiberty=../libiberty-linker-plugin";;
*)
AC_MSG_ERROR([libiberty missing]);;
esac
fi
# Produce a warning message for the subdirs we can't configure. # Produce a warning message for the subdirs we can't configure.
# This isn't especially interesting in the Cygnus tree, but in the individual # This isn't especially interesting in the Cygnus tree, but in the individual
# FSF releases, it's important to let people know when their machine isn't # FSF releases, it's important to let people know when their machine isn't
......
2014-06-13 Thomas Schwinge <thomas@codesourcery.com>
* doc/install.texi (--enable-linker-plugin-configure-flags)
(--enable-linker-plugin-flags): Document new flags.
2014-06-13 Martin Jambor <mjambor@suse.cz> 2014-06-13 Martin Jambor <mjambor@suse.cz>
PR ipa/61186 PR ipa/61186
......
...@@ -1780,6 +1780,25 @@ GLIBC 2.11 or above, otherwise disabled. ...@@ -1780,6 +1780,25 @@ GLIBC 2.11 or above, otherwise disabled.
Enable support for link-time optimization (LTO). This is enabled by Enable support for link-time optimization (LTO). This is enabled by
default, and may be disabled using @option{--disable-lto}. default, and may be disabled using @option{--disable-lto}.
@item --enable-linker-plugin-configure-flags=FLAGS
@itemx --enable-linker-plugin-flags=FLAGS
By default, linker plugins (such as the LTO plugin) are built for the
host system architecture. For the case that the linker has a
different (but run-time compatible) architecture, these flags can be
specified to build plugins that are compatible to the linker. For
example, if you are building GCC for a 64-bit x86_64
(@samp{x86_64-unknown-linux-gnu}) host system, but have a 32-bit x86
GNU/Linux (@samp{i686-pc-linux-gnu}) linker executable (which is
executable on the former system), you can configure GCC as follows for
getting compatible linker plugins:
@smallexample
% @var{srcdir}/configure \
--host=x86_64-unknown-linux-gnu \
--enable-linker-plugin-configure-flags=--host=i686-pc-linux-gnu \
--enable-linker-plugin-flags='CC=gcc\ -m32\ -Wl,-rpath,[...]/i686-pc-linux-gnu/lib'
@end smallexample
@item --with-plugin-ld=@var{pathname} @item --with-plugin-ld=@var{pathname}
Enable an alternate linker to be used at link-time optimization (LTO) Enable an alternate linker to be used at link-time optimization (LTO)
link time when @option{-fuse-linker-plugin} is enabled. link time when @option{-fuse-linker-plugin} is enabled.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment