Ok, I give up. I killed many hours trying to build a cross-compiling x86_64-linux-uclibc-gcc, version 4.3.0.
After many "WTF?" moments I decided to go back and try to build a cross-compiler which I already have, just older version: I decided to build i486 one, not x86_64. Because I already have i486-linux-uclibc-gcc version 4.2.1 and it works. I unpacked and built i486-linux-uclibc-gcc version 4.3.0 with absolutely the same configure and make command lines, and it does not work. Specifically, it seems to mess up paths: i486-linux-uclibc-gcc: error trying to exec 'cc1': execvp: No such file or directory stracing gcc invocation reveals typical "..bin/../lib/something/../../../../../something-else/.." stuff, but this time, it definitely fails to pick up cc1. (See below for strace comparison between 4.2.1 and 4.3.0) Yeah, yeah, I saw it with x86_64-linux-uclibc-gcc too and was able to overcome it with even more hacks and options in configure, but it won't stop there! It will use wrong as and/or ld; then it will also try to link wrong crtXXXXX.o files which do not exist! So I won't try to fix that now - instead, let's concentrate on "how in hell? it was working before!" Well, hrm.... last sanity check: I remove i486-linux-uclibc-gcc version 4.2.1, unpack fresh 4.2.1, build it with the very same configure and make options and IT WORKS! So, something definitely is changed incompatibly between 4.2.1 and 4.3.0 Help... STATIC=/usr/app/gcc-4.3.0-i486-linux-uclibc "configure" invocation: ../gcc-4.3.0/configure \ --prefix=$STATIC \ --exec-prefix=$STATIC \ --bindir=/usr/bin \ --sbindir=/usr/sbin \ --libexecdir=$STATIC/libexec \ --datadir=$STATIC/share \ --sysconfdir=/etc \ --sharedstatedir=$STATIC/var/com \ --localstatedir=$STATIC/var \ --libdir=/usr/lib \ --includedir=/usr/include \ --infodir=/usr/info \ --mandir=/usr/man \ \ --with-slibdir=$STATIC/lib \ --disable-shared \ --with-local-prefix=/usr/local \ --with-gxx-include-dir=$STATIC/include/g++-v3 \ --enable-languages="c,c++" \ --disable-nls \ \ --build=i386-pc-linux-gnu \ --host=i386-pc-linux-gnu \ --target=i486-linux-uclibc \ \ --disable-__cxa_atexit \ --enable-target-optspace \ --with-gnu-ld \ --disable-threads \ --disable-multilib \ --without-headers \ "make" invocation: make all-gcc "make install" invocation: make \ prefix=$STATIC \ exec-prefix=$STATIC \ bindir=$STATIC/bin \ sbindir=$STATIC/sbin \ libexecdir=$STATIC/libexec \ datadir=$STATIC/share \ sysconfdir=$STATIC/var/etc \ sharedstatedir=$STATIC/var/com \ localstatedir=$STATIC/var \ libdir=$STATIC/lib \ includedir=$STATIC/include \ infodir=$STATIC/info \ mandir=$STATIC/man \ \ install-gcc gcc 4.3.0 fails to find cc1: 30816 stat64("/.share/usr/app/gcc-4.3.0-i486-linux-uclibc/bin/../app/gcc-4.3.0-i486-linux-uclibc/libexec/gcc/i486-linux-uclibc/4.3.0/cc1", 0xffde613c) = -1 ENOENT (No such file or directory) 30816 stat64("/.share/usr/app/gcc-4.3.0-i486-linux-uclibc/bin/../app/gcc-4.3.0-i486-linux-uclibc/libexec/gcc/cc1", 0xffde613c) = -1 ENOENT (No such file or directory) 30816 stat64("/.share/usr/app/gcc-4.3.0-i486-linux-uclibc/bin/../lib/gcc/i486-linux-uclibc/4.3.0/../../../../../i486-linux-uclibc/bin/i486-linux-uclibc/4.3.0/cc1", 0xffde613c) = -1 ENOENT (No such file or directory) 30816 stat64("/.share/usr/app/gcc-4.3.0-i486-linux-uclibc/bin/../lib/gcc/i486-linux-uclibc/4.3.0/../../../../../i486-linux-uclibc/bin/cc1", 0xffde613c) = -1 ENOENT (No such file or directory) 30816 vfork() = 30817 30817 execve("/root/bin/cc1", ["cc1", "-quiet", "-Iinclude", "-Ilibbb", "-I/.1/usr/srcdevel/bbox/fix/busy"..., "-iprefix", "/.share/usr/app/gcc-4.3.0-i486-l"..., "-D_GNU_SOURCE", "-DNDEBUG", "-D_LARGEFILE_SOURCE", "-D_LARGEFILE64_SOURCE", "-D_FILE_OFFSET_BITS=64", "-DBB_VER=KBUILD_STR(1.11.0.svn)", "-DBB_BT=AUTOCONF_TIMESTAMP", "-DKBUILD_STR(s)=#s", "-DKBUILD_BASENAME=KBUILD_STR(app"..., ...], [/* 35 vars */]) = -1 ENOENT (No such file or directory) 30817 execve("/bin/cc1", ["cc1", "-quiet", "-Iinclude", "-Ilibbb", "-I/.1/usr/srcdevel/bbox/fix/busy"..., "-iprefix", "/.share/usr/app/gcc-4.3.0-i486-l"..., "-D_GNU_SOURCE", "-DNDEBUG", "-D_LARGEFILE_SOURCE", "-D_LARGEFILE64_SOURCE", "-D_FILE_OFFSET_BITS=64", "-DBB_VER=KBUILD_STR(1.11.0.svn)", "-DBB_BT=AUTOCONF_TIMESTAMP", "-DKBUILD_STR(s)=#s", "-DKBUILD_BASENAME=KBUILD_STR(app"..., ...], [/* 35 vars */]) = -1 ENOENT (No such file or directory) 30817 execve("/usr/bin/cc1", ["cc1", "-quiet", "-Iinclude", "-Ilibbb", "-I/.1/usr/srcdevel/bbox/fix/busy"..., "-iprefix", "/.share/usr/app/gcc-4.3.0-i486-l"..., "-D_GNU_SOURCE", "-DNDEBUG", "-D_LARGEFILE_SOURCE", "-D_LARGEFILE64_SOURCE", "-D_FILE_OFFSET_BITS=64", "-DBB_VER=KBUILD_STR(1.11.0.svn)", "-DBB_BT=AUTOCONF_TIMESTAMP", "-DKBUILD_STR(s)=#s", "-DKBUILD_BASENAME=KBUILD_STR(app"..., ...], [/* 35 vars */]) = -1 ENOENT (No such file or directory) gcc 4.2.1 successfully finds cc1: 30862 stat64("/.share/usr/app/gcc-4.2.1-i486-linux-uclibc/bin/../app/gcc-4.2.1-i486-linux-uclibc/libexec/gcc/i486-linux-uclibc/4.2.1/cc1", 0xffae663c) = -1 ENOENT (No such file or directory) 30862 stat64("/.share/usr/app/gcc-4.2.1-i486-linux-uclibc/bin/../app/gcc-4.2.1-i486-linux-uclibc/libexec/gcc/cc1", 0xffae663c) = -1 ENOENT (No such file or directory) 30862 stat64("/usr/app/gcc-4.2.1-i486-linux-uclibc/libexec/gcc/i486-linux-uclibc/4.2.1/cc1", {st_mode=S_IFREG|0755, st_size=4420187, ...}) = 0 30862 access("/usr/app/gcc-4.2.1-i486-linux-uclibc/libexec/gcc/i486-linux-uclibc/4.2.1/cc1", X_OK) = 0 30862 vfork() = 30863 30863 execve("/usr/app/gcc-4.2.1-i486-linux-uclibc/libexec/gcc/i486-linux-uclibc/4.2.1/cc1", ["/usr/app/gcc-4.2.1-i486-linux-uc"..., "-quiet", "-Iinclude", "-Ilibbb", "-I/.1/usr/srcdevel/bbox/fix/busy"..., "-iprefix", "/.share/usr/app/gcc-4.2.1-i486-l"..., "-D_GNU_SOURCE", "-DNDEBUG", "-D_LARGEFILE_SOURCE", "-D_LARGEFILE64_SOURCE", "-D_FILE_OFFSET_BITS=64", "-DBB_VER=KBUILD_STR(1.11.0.svn)", "-DBB_BT=AUTOCONF_TIMESTAMP", "-DKBUILD_STR(s)=#s", "-DKBUILD_BASENAME=KBUILD_STR(app"..., ...], [/* 35 vars */]) = 0 both are produced by the following command (only i486-linux-uclibc-gcc is different): strace -f -o strace.log \ i486-linux-uclibc-gcc -Wp,-MD,applets/.applets.o.d -Iinclude -Ilibbb -I/.1/usr/srcdevel/bbox/fix/busybox.t8/libbb -include include/aut oconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D"BB_VER=KBUILD_STR(1.11.0.svn)" -DBB_BT= AUTOCONF_TIMESTAMP -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(applets)" -D"KBUILD_MODNAME=KBUILD_STR(applets)" -c -o applets/applets.o applets/applets.c -- vda