Hi, I tried to compile gcc 4.2.2 from source on Debian etch AMD64 and failed. I used the system compiler: $ gcc -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release x86_64-linux-gnu Thread model: posix gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) Here is what I did and got in return: $ ./configure --prefix=/usr/local/gcc-4.2 [No error] $ make bootstrap [...] config.status: executing default-1 commands Adding multilib support to Makefile in ../.././libmudflap multidirs=32 with_multisubdir= Running configure in multilib subdirs 32 pwd: /var/tmp/LB/gcc-4.2.2/x86_64-unknown-linux-gnu/libmudflap Running configure in multilib subdir 32 pwd: /var/tmp/LB/gcc-4.2.2/x86_64-unknown-linux-gnu configure: creating cache ./config.cache checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for --enable-version-specific-runtime-libs... no checking whether to enable maintainer-specific portions of Makefiles... no checking for x86_64-unknown-linux-gnu-gcc... /var/tmp/LB/gcc-4.2.2/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/var/tmp/LB/gcc-4.2.2/host-x86_64-unknown-linux-gnu/gcc/ -B/usr/local/gcc-4.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.2/x86_64-unknown-linux-gnu/sys-include -m32 checking for C compiler default output file name... a.out checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. make[1]: *** [configure-target-libmudflap] Error 1 make[1]: Leaving directory `/var/tmp/LB/gcc-4.2.2' make: *** [bootstrap] Error 2
What happens if you don't build in the source directory?
I get exactly the same error: $ ../gcc-4.2.2/configure --prefix=/usr/local/gcc-4.2 $ make bootstrap [...] checking for x86_64-unknown-linux-gnu-gcc... /var/tmp/LB/build/./gcc/xgcc -B/var/tmp/LB/build/./gcc/ -B/usr/local/gcc-4.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.2/x86_64-unknown-linux-gnu/sys-include -m32 checking for C compiler default output file name... a.out checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details. make[1]: *** [configure-target-libmudflap] Error 1 make[1]: Leaving directory `/var/tmp/LB/build' make: *** [bootstrap] Error 2
Use --disable-multilib as you don't have a full install of GNU/Linux glibc on x86_64 which includes the 32bits headers/libraries.
Wouldn't it be nice if the configure script caught this sort of thing automatically? It's obviously going to be a very common problem.
The --disable-multilib options allowed me to build gcc. Thank you for the tip! However, it was my understanding that if "./configure" does not fail, "make bootstrap" should not fail.