1. Output from running srcdir/config.guess: i686-pc-linux-gnu
2. The output of gcc -v for my newly installed gcc: Reading specs from /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs Configured with: ../gcc-3.3.6/configure --prefix=/opt/gcc-3.3.6 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-nls Thread model: posix gcc version 3.3.6 3. I downloaded and enabled only "core" and "g++". 4. The distribution name and version: Hand-crafted, based on the first release of an ancient bare-bones distro named "coredistro" (http://coredistro.sf.net), which was, in turn, based on LFS (http://www.linuxfromscratch.org), and is now, to my knowledge, defunct. 5. The version of the Linux kernel: 2.4.31 vanilla 6. The version of glibc you used: 2.2.4. Binutils is 2.16.1. Two notes: a) First I tried to disable the fixincludes script as suggested in http://archives.linuxfromscratch.org/lfs-museum/5.1.1/LFS-BOOK-5.1.1-HTML/chapter05/gcc-pass2.html, because I plan to update my glibc, so that I can use gcc-4. After I manually realized http://www.linuxfromscratch.org/patches/lfs/5.1.1/gcc-3.3.3-no_fixincludes-1.patch, the build failed at the first invocation of xgcc. I started from the beginning, letting fixincludes run, and everything worked. b) After installation I tried to compile one C and one C++ two-liner. Both C_INCLUDE_PATH and CPLUS_INCLUDE_PATH were set to /usr/include:/usr/local/include. g++ was unable to compile the two-liner until I removed /usr/include from CPLUS_INCLUDE_PATH. Then it succeeded. Thank you lacos -------- Two-liner: #include <iostream> int main() { std::cout << "Hello world!" << std::endl; } Failed to compile: $ CPLUS_INCLUDE_PATH=/usr/include:/usr/local/include g++ -v a.cpp Reading specs from /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs Configured with: ../gcc-3.3.6/configure --prefix=/opt/gcc-3.3.6 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-nls Thread model: posix gcc version 3.3.6 /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=6 -D_GNU_SOURCE a.cpp -D__GNUG__=3 -quiet -dumpbase a.cpp -auxbase a -version -o /tmp/ccokBQIh.s GNU C++ version 3.3.6 (i686-pc-linux-gnu) compiled by GNU C version 3.3.6. GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32129 ignoring nonexistent directory "/opt/gcc-3.3.6/i686-pc-linux-gnu/include" ignoring duplicate directory "/usr/local/include" ignoring duplicate directory "/usr/include" #include "..." search starts here: #include <...> search starts here: /usr/include /usr/local/include /opt/gcc-3.3.6/include/c++/3.3.6 /opt/gcc-3.3.6/include/c++/3.3.6/i686-pc-linux-gnu /opt/gcc-3.3.6/include/c++/3.3.6/backward /opt/gcc-3.3.6/include /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include End of search list. In file included from /opt/gcc-3.3.6/include/c++/3.3.6/i686-pc-linux-gnu/bits/gthr-default.h:37, from /opt/gcc-3.3.6/include/c++/3.3.6/i686-pc-linux-gnu/bits/gthr.h:98, from /opt/gcc-3.3.6/include/c++/3.3.6/i686-pc-linux-gnu/bits/c++io.h:37, from /opt/gcc-3.3.6/include/c++/3.3.6/bits/fpos.h:44, from /opt/gcc-3.3.6/include/c++/3.3.6/iosfwd:49, from /opt/gcc-3.3.6/include/c++/3.3.6/ios:44, from /opt/gcc-3.3.6/include/c++/3.3.6/ostream:45, from /opt/gcc-3.3.6/include/c++/3.3.6/iostream:45, from a.cpp:1: /usr/include/pthread.h:163: error: syntax error before `__thread' /usr/include/pthread.h:165: error: `pthread_create' declared as function returning a function /usr/include/pthread.h:166: error: syntax error before `void' /usr/include/pthread.h:591: error: storage class specifiers invalid in parameter declarations /usr/include/pthread.h:591: error: storage class specified for parameter ` parameter' In file included from /usr/include/pthread.h:655, from /opt/gcc-3.3.6/include/c++/3.3.6/i686-pc-linux-gnu/bits/gthr-default.h:37, from /opt/gcc-3.3.6/include/c++/3.3.6/i686-pc-linux-gnu/bits/gthr.h:98, from /opt/gcc-3.3.6/include/c++/3.3.6/i686-pc-linux-gnu/bits/c++io.h:37, from /opt/gcc-3.3.6/include/c++/3.3.6/bits/fpos.h:44, from /opt/gcc-3.3.6/include/c++/3.3.6/iosfwd:49, from /opt/gcc-3.3.6/include/c++/3.3.6/ios:44, from /opt/gcc-3.3.6/include/c++/3.3.6/ostream:45, from /opt/gcc-3.3.6/include/c++/3.3.6/iostream:45, from a.cpp:1: /usr/include/bits/sigthread.h:36: error: storage class specifiers invalid in parameter declarations /usr/include/bits/sigthread.h:36: error: storage class specified for parameter `parameter' Success: $ CPLUS_INCLUDE_PATH=/usr/local/include g++ -v a.cpp Reading specs from /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/specs Configured with: ../gcc-3.3.6/configure --prefix=/opt/gcc-3.3.6 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-nls Thread model: posix gcc version 3.3.6 /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=6 -D_GNU_SOURCE a.cpp -D__GNUG__=3 -quiet -dumpbase a.cpp -auxbase a -version -o /tmp/ccMpcC3Y.s GNU C++ version 3.3.6 (i686-pc-linux-gnu) compiled by GNU C version 3.3.6. GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32129 ignoring nonexistent directory "/opt/gcc-3.3.6/i686-pc-linux-gnu/include" ignoring duplicate directory "/usr/local/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /opt/gcc-3.3.6/include/c++/3.3.6 /opt/gcc-3.3.6/include/c++/3.3.6/i686-pc-linux-gnu /opt/gcc-3.3.6/include/c++/3.3.6/backward /opt/gcc-3.3.6/include /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/include /usr/include End of search list. as -V -Qy -o /tmp/ccqfJYe6.o /tmp/ccMpcC3Y.s GNU assembler version 2.16.1 (i686-pc-linux-gnu) using BFD version 2.16.1 /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/crtbegin.o -L/usr/local/lib -L/opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6 -L/opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../.. /tmp/ccqfJYe6.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/gcc-3.3.6/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/crtend.o /usr/lib/crtn.o $ ./a.out Hello world!