https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71134
Bug ID: 71134 Summary: GCC fails to build with in-tree dependencies: Product: gcc Version: 6.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: dcollinsn at gmail dot com Target Milestone: --- The folder ~/toolchain/gcc-6.1.0 is the unzipped GCC source distribution. I have extracted into that folder the contents of binutils-2.26.tar.gz, gmp-6.1.0.tar.xz, mpc-1.0.3.tar.gz, mpfr-3.1.4.tar.gz, and isl-0.16.1.tar.bz2. All were extracted to their own folders (gcc-6.1.0/gmp/, etc) with the exception of binutils, which was extracted directly into the source directory. The folder ~/toolchain/gcc-build is a separate, empty build directory. The platform is Debian Stretch, otherwise up to date, running inside VMware. I have configured using the following instructions. --enable-shared and --enable-host-shared are to attempt to fix a separate bug. I accept the default languages. I have also deleted all instances of --disable-shared in Makefile.in because I was getting similar issues as in Bug 67137, despite the "jit" language not being selected. dcollins@nightshade64:~/toolchain/gcc-build$ ../gcc-6.1.0/configure --program-suffix=-6.1 --enable-shared --enable-host-shared <snip> dcollins@nightshade64:~/toolchain/gcc-build$ make <snip> Configuring stage 2 in ./libiberty configure: loading cache ./config.cache checking whether to enable maintainer-specific portions of Makefiles... no checking for makeinfo... makeinfo --split-size=5000000 --split-size=5000000 checking for perl... perl checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for x86_64-pc-linux-gnu-ar... ar checking for x86_64-pc-linux-gnu-ranlib... ranlib checking whether to install libiberty headers and static library... no configure: target_header_dir = checking for x86_64-pc-linux-gnu-gcc... /home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc -B/home/dcollins/toolchain/gcc-build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -L/home/dcollins/toolchain/gcc-build/./ld checking for suffix of object files... configure: error: in `/home/dcollins/toolchain/gcc-build/libiberty': configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. Makefile:16209: recipe for target 'configure-stage2-libiberty' failed make[2]: *** [configure-stage2-libiberty] Error 1 make[2]: Leaving directory '/home/dcollins/toolchain/gcc-build' Makefile:29946: recipe for target 'stage2-bubble' failed make[1]: *** [stage2-bubble] Error 2 make[1]: Leaving directory '/home/dcollins/toolchain/gcc-build' Makefile:916: recipe for target 'all' failed make: *** [all] Error 2 dcollins@nightshade64:~/toolchain/gcc-build$ cat libiberty/config.log <snip> ## ----------- ## ## Core tests. ## ## ----------- ## configure:2334: loading cache ./config.cache configure:2493: checking whether to enable maintainer-specific portions of Makefiles configure:2503: result: no configure:2518: checking for makeinfo configure:2545: result: makeinfo --split-size=5000000 --split-size=5000000 configure:2585: checking for perl configure:2601: found /usr/bin/perl configure:2612: result: perl configure:2631: checking build system type configure:2645: result: x86_64-pc-linux-gnu configure:2665: checking host system type configure:2678: result: x86_64-pc-linux-gnu configure:2703: checking for x86_64-pc-linux-gnu-ar configure:2730: result: ar configure:2795: checking for x86_64-pc-linux-gnu-ranlib configure:2822: result: ranlib configure:2907: checking whether to install libiberty headers and static library configure:2930: result: no configure:2932: target_header_dir = configure:2944: checking for x86_64-pc-linux-gnu-gcc configure:2971: result: /home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc -B/home/dcollins/toolchain/gcc-build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/b in/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -L/home/dcollins/toolchain/gcc-build/./ld configure:3240: checking for C compiler version configure:3249: /home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc -B/home/dcollins/toolchain/gcc-build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/u sr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -L/home/dcollins/toolchain/gcc-build/./ld --version >&5 xgcc (GCC) 6.1.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:3260: $? = 0 configure:3249: /home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc -B/home/dcollins/toolchain/gcc-build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/u sr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -L/home/dcollins/toolchain/gcc-build/./ld -v >&5 Reading specs from /home/dcollins/toolchain/gcc-build/./prev-gcc/specs COLLECT_GCC=/home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc COLLECT_LTO_WRAPPER=/home/dcollins/toolchain/gcc-build/./prev-gcc/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-6.1.0/configure --program-suffix=-6.1 --enable-shared --enable-host-shared Thread model: posix gcc version 6.1.0 (GCC) configure:3260: $? = 0 configure:3249: /home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc -B/home/dcollins/toolchain/gcc-build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/u sr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -L/home/dcollins/toolchain/gcc-build/./ld -V >&5 xgcc: error: unrecognized command line option '-V' xgcc: fatal error: no input files compilation terminated. configure:3260: $? = 1 configure:3249: /home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc -B/home/dcollins/toolchain/gcc-build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/u sr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -L/home/dcollins/toolchain/gcc-build/./ld -qversion >&5 xgcc: error: unrecognized command line option '-qversion'; did you mean '--version'? xgcc: fatal error: no input files compilation terminated. configure:3260: $? = 1 configure:3276: /home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc -B/home/dcollins/toolchain/gcc-build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -L/home/dcollins/toolchain/gcc-build/./ld -o conftest -g -O2 -gtoggle -static-libstdc++ -static-libgcc conftest.c >&5 /home/dcollins/toolchain/gcc-build/prev-gas/.libs/lt-as-new: error while loading shared libraries: libopcodes-2.26.20160125.so: cannot open shared object file: No such file or directory configure:3279: $? = 1 configure:3467: checking for suffix of object files configure:3489: /home/dcollins/toolchain/gcc-build/./prev-gcc/xgcc -B/home/dcollins/toolchain/gcc-build/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/ -isystem /usr/local/x86_64-pc-linux-gnu/include -isystem /usr/local/x86_64-pc-linux-gnu/sys-include -L/home/dcollins/toolchain/gcc-build/./ld -c -g -O2 -gtoggle conftest.c >&5 /home/dcollins/toolchain/gcc-build/prev-gas/.libs/lt-as-new: error while loading shared libraries: libopcodes-2.26.20160125.so: cannot open shared object file: No such file or directory configure:3493: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "" | #define PACKAGE_TARNAME "" | #define PACKAGE_VERSION "" | #define PACKAGE_STRING "" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:3507: error: in `/home/dcollins/toolchain/gcc-build/libiberty': configure:3510: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. Noticing that the issue was a missing libopcodes, I did the following dcollins@nightshade64:~/toolchain/gcc-build$ find . | grep libopcodes ./prev-opcodes/libopcodes.a ./prev-opcodes/libopcodes.la ./prev-opcodes/.libs/libopcodes-2.26.20160125.so ./prev-opcodes/.libs/libopcodes.a ./prev-opcodes/.libs/libopcodes.so ./prev-opcodes/.libs/libopcodes.lai ./prev-opcodes/.libs/libopcodes.la dcollins@nightshade64:~/toolchain/gcc-build$ make all-opcodes <snip> dcollins@nightshade64:~/toolchain/gcc-build$ find . | grep libopcodes ./opcodes/libopcodes.a ./opcodes/libopcodes.la ./opcodes/.libs/libopcodes-2.26.20160125.so ./opcodes/.libs/libopcodes.a ./opcodes/.libs/libopcodes.so ./opcodes/.libs/libopcodes.lai ./opcodes/.libs/libopcodes.la ./prev-opcodes/libopcodes.a ./prev-opcodes/libopcodes.la ./prev-opcodes/.libs/libopcodes-2.26.20160125.so ./prev-opcodes/.libs/libopcodes.a ./prev-opcodes/.libs/libopcodes.so ./prev-opcodes/.libs/libopcodes.lai ./prev-opcodes/.libs/libopcodes.la Continuing with `make` now allows the build to proceed. The same problem - and the same solution - repeats later in the bootstrapping process as well.