Installing gcc-4.1.0-beta20050709 using a Gentoo ebuild resulted in an unusable g++ - I think the problem is gcc installer related rather than Gentoo, though. Gentoo builds gcc with the following configuration: .../gcc-4.1-20050709/configure \ --enable-version-specific-runtime-libs \ --prefix=/usr \ --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0-beta20050709 \ --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050709/include \ --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050709 \ --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050709/man \ --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050709/info \ --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050709/include/g++-v4 \ --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f95 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu The problem is that the installation process puts libstdc++ (and all the other built libraries), as well as the fixincludes'd headers, into /usr/lib/gcc/i686-pc-linux-gnu/4.1.0 rather than the locations specified by bindir, datadir, and includedir. Gentoo is (I believe correctly) assuming that the runtime libraries should be in the directories it specified. This appears to be caused by the following: ---[gcc/Makefile.in]--- ... libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version) ... where libsubdir is then used for GCC_INCLUDE_DIR, and a lot of other things. $(version) is set from the contents of the gcc/BASEVER file (containing "4.1.0"). There appears to be no way via configure to get the "expected" behaviour, which is why I suspect it is a gcc issue... Phil
--enable-version-specific-runtime-libs over rides all those directories.
Ok... I'll see if I can see why the behaviour under Gentoo should have changed between 4.0.1 and 4.1.0 (they use the same core code to do the build/install). Is it a bug that the cxxabi.h and g++-v4/ files are installed under the directory specified by --includedir, then? I suppose I might still be a little confused as to what $gcc_version actually is meant to be - just the BASE_VER or the full version name (with snapshot information included). Phil
Ok, I've tried to configure with: ../gcc-4.1-20050730/configure --prefix=/usr \ --libexecdir=/usr/libexec/gcc/i686-pc-linux-gnu/4.1.0-beta20050730 \ --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.1.0-beta20050730 \ --libdir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730 \ --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/include \ --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/include/g++-v4 \ --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050730 \ --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050730/man \ --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050730/info \ --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++,f95 (I've dropped --enable-version-specific-runtime-libs, and explicitly added every other directory option that looks useful.) This results in a directory tree which is mostly ok, but some bits still look "odd" to me. The following bits are fine (contents are as expected - they match the configure): /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/include [mf-runtime.h] /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/include/ssp /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/include/g++-v4 /usr/i686-pc-linux-gnu/gcc-bin/4.1.0-beta20050730 [front-end executables] /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730 [libgcc_s.so*, libgfortran*, libiberty.a, libmudflap*, libssp*, libstdc++*, libsupc++*] /usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050730/man /usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050730/info /usr/share/gcc-data/i686-pc-linux-gnu/4.1.0-beta20050730/locale The following bits are not where I'd expect based on what was specified in the configure. An extra level of "gcc/i686-pc-linux-gnu/4.1.0" has been added in that I'm not convinced should (or needs) to be there: /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/gcc/i686-pc-linux-gnu/4.1.0 [crtbegin*, crtend*, libgcc.a, libgcc_eh.a, libgcov.a] /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/gcc/i686-pc-linux-gnu/4.1.0/install-tools [gsyslimits.h, macro_list, mkheaders.conf] /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/gcc/i686-pc-linux-gnu/4.1.0/install-tools/include [Some fixincludes stuff (gcc/include, I think): emmintrin.h, float.h, iso646.h, ...] /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/gcc/i686-pc-linux-gnu/4.1.0/include [Lots more fixincludes stuff (looks like /usr/include)] /usr/libexec/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/gcc/i686-pc-linux-gnu/4.1.0 [cc1, cc1plus, collect2, f951] /usr/libexec/gcc/i686-pc-linux-gnu/4.1.0-beta20050730/gcc/i686-pc-linux-gnu/4.1.0/install-tools [fixinc.sh, fixincl, mkheaders] The only question I have is: is this the expected, correct, behaviour, or not? Phil
This is all expected behavior. See <http://gcc.gnu.org/install/configure.html>. Basically even if you supply --libdir=dirname we will always add $target/$version as you might install different versions of gcc in that libdir.