https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119215
--- Comment #27 from James K. Lowden <jklowden at gcc dot gnu.org> ---
(In reply to Sam James from comment #26)
> (In reply to James K. Lowden from comment #25)
> > I overstated the case; I never successfully built cobol1 with lto.
...
> Does --enable-lto help? It's the default but I'm not sure how it interacts
> with your --enable-languages= (where you can also pass lto).
I'm afraid not.
$ head build-lto/config.log | sed -Ene "/[/]config/ s:${PWD}:...:gp"
$ .../configure --prefix=/tmp/gcc/lto --with-build-config=bootstrap-lto
--disable-multilib --enable-lto --enable-languages=cobol
$ grep -E configure.+error: log | sed "s,$HOME/projects/3rd/gcc,...,"
configure: error: in `.../master/build-lto/libdecnumber':
configure: error: C compiler cannot create executables
checking host system type... configure: error: in
`.../master/build-lto/libbacktrace':
configure: error: C compiler cannot create executables
configure: error: in `.../master/build-lto/libcody':
configure: error: C++ compiler cannot create executables
configure: error: in `.../master/build-lto/lto-plugin':
configure: error: C compiler cannot create executables
checking for an ANSI C-conforming const... configure: error: Link tests are not
allowed after GCC_NO_EXECUTABLES.
checking for CET support... configure: error: Link tests are not allowed after
GCC_NO_EXECUTABLES.
It's always a 77 error, apparently:
$ sed -Ene '/Error 77/ s/^.*make/make/p' log
make[3]: *** [Makefile:10339: configure-stage2-libdecnumber] Error 77
make[3]: *** [Makefile:7304: configure-stage2-libbacktrace] Error 77
make[3]: *** [Makefile:9428: configure-stage2-libcody] Error 77
make[3]: *** [Makefile:15351: configure-stage2-lto-plugin] Error 77
The good news I guess is that there are 25 library directories in the build
tree, of which only the above 4 report errors.