I'm using both --with-build-sysroot and --with-sysroot when I compile GCC, so that I can compile it against a different version of the local system than the one I'm compiling on. Most of the build works fine, with the exception of the libraries libgomp, libmudflap, and libssp.
Each of those fails because they do not take notice of the --with-build-sysroot directive, and thus they cannot find important files like crti.o etc. I configured with this: --with-build-sysroot=/tmp/invalid/gcc/i686-redhat71-linux-gnu --with-sysroot=/invalid where /tmp/invalid/gcc/i686-redhat71-linux-gnu is an extracted sysroot from Red Hat 7.1 (surprise!) Everything chugs along OK until the above-mentioned libraries, then: /usr/src/gcc/obj/gcc/./gcc/xgcc -B/usr/src/gcc/obj/gcc/./gcc/ -B/tmp/invalid/gcc/i686-generic-linux-gnu/bin/ -B/tmp/invalid/gcc/i686-generic-linux-gnu/lib/ -isystem /tmp/invalid/gcc/i686-generic-linux-gnu/include -isystem /tmp/invalid/gcc/i686-generic-linux-gnu/sys-include -shared .libs/ssp.o .libs/gets-chk.o .libs/memcpy-chk.o .libs/memmove-chk.o .libs/mempcpy-chk.o .libs/memset-chk.o .libs/snprintf-chk.o .libs/sprintf-chk.o .libs/stpcpy-chk.o .libs/strcat-chk.o .libs/strcpy-chk.o .libs/strncat-chk.o .libs/strncpy-chk.o .libs/vsnprintf-chk.o .libs/vsprintf-chk.o -Wl,--version-script=/usr/src/gcc/gcc-4.2.4/libssp/ssp.map -Wl,-soname -Wl,libssp.so.0 -o .libs/libssp.so.0.0.0 /tmp/invalid/gcc/bin/i686-generic-linux-gnu-ld: crti.o: No such file: No such file or directory collect2: ld returned 1 exit status make[4]: *** [libssp.la] Error 1 make[4]: Leaving directory `/usr/src/gcc/obj/gcc/i686-generic-linux-gnu/libssp' make[3]: *** [all] Error 2 make[3]: Leaving directory `/usr/src/gcc/obj/gcc/i686-generic-linux-gnu/libssp' make[2]: *** [all-target-libssp] Error 2 The other two libraries gave essentially identical errors. I don't think the -B etc. options here are correct; they seem to be remnants from previous versions of GCC, before the --with-sysroot and --with-build-sysroot flags were supported. The configure.in files for these libraries need to be updated. -- Summary: libgomp fails when using --with-build-sysroot Product: gcc Version: 4.2.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgomp AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: psmith at gnu dot org GCC target triplet: i686-generic-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36442