This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix toplevel 'config.status --recheck' for --enable-lto.
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 11 Oct 2009 13:10:45 +0200
- Subject: Fix toplevel 'config.status --recheck' for --enable-lto.
Currently, when rebuilding the tree after toplevel configure changed,
and lto was enabled, the triggered './config.status --recheck' fails
with:
checking for the correct version of libelf... yes
configure: error:
The following requested languages could not be built: lto
Supported languages are: c,c++,fortran,java,lto,objc,obj-c++
make: *** [config.status] Error 1
which happens because the language loop from the previous configure run
added another 'lto' to the --enable-languages command passed to
configure by config.status (--enable-languages does not allow languages
listed multiple times). The patch below fixes that.
Tested by running the following sequence of commands
../toplevel/configure $args
./config.status --recheck
./config.status --recheck
with args containing all possible combinations of
'' | --enable-lto | --disable-lto
with a few combinations of
--enable-languages=...
and with either a working, or a defunct installation of libelf in place,
and ensuring things work as expected most of the time, except for:
passing
--enable-languages=...,lto,...
will act as if lto was not passed in this argument (thus only care for
presence of --{en,dis}able-lto). Thoughts on whether it should do
something different, and if yes, what, or whether install.texi should be
adjusted? It currently states
@item --enable-languages=@var{lang1},@var{lang2},@dots{}
Specify that only a particular subset of compilers and
their runtime libraries should be built. For a list of valid values for
@var{langN} you can issue the following command in the
@file{gcc} directory of your GCC source tree:@*
@smallexample
grep language= */config-lang.in
@end smallexample
Currently, you can use any of the following:
@code{all}, @code{ada}, @code{c}, @code{c++}, @code{fortran}, @code{java},
@code{objc}, @code{obj-c++}.
Otherwise, OK for trunk (and sync to src)?
Thanks,
Ralf
Fix toplevel 'config.status --recheck' for --enable-lto.
ChangeLog:
2009-10-11 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure.ac: Add 'lto' to enable_languages, not
new_enable_languages, and only if not already present.
* configure: Regenerate.
diff --git a/configure.ac b/configure.ac
index bc2e593..e11035e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1845,7 +1845,10 @@ if test -d ${srcdir}/gcc; then
# 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,"
+ case ,${enable_languages}, in
+ *,lto,*) ;;
+ *) enable_languages="${enable_languages},lto" ;;
+ esac
if test "${ENABLE_GOLD}" = "yes" ; then
configdirs="$configdirs lto-plugin"
extra_host_libiberty_configure_flags=--enable-shared