> I wrote previously > I think I just have to figure out the way to configure gcc to do all > that exactly as it is doing now, but not generate the > --sysroot option. > I really want to avoid patching it. I hacked up a silly patch in binutils after which it works. I'm now happily cross-compling core-utils against glibc for MIPS, on an x86 box. I've looked at older versions of this function and it didn't have the else. The idea is to try the catenated name with sysroot, and if that doesn't work, try the uncatenated name. I really hate this "solution", but it gets me past a hurdle. I already have a patched kernel and a patched glibc, so what the heck, right? I think ld expects gcc to feed it absolute paths which are to be interpreted relative to the sysroot. But that isn't what gcc is doing: it's feeding absolute paths from the real system root. It would be nice if I could figure out how to get gcc to feed absolute paths to collect which /require/ the root to be tacked on. E.g. /usr/lib/crt<whatever>.o which would be combined with /path/to/sysroot to create /path/to/sysroot/usr/lib/crt<whatever>.o. Ah well. --- binutils-2.17.orig/ld/ldfile.c 2005-05-12 03:32:02.000000000 -0400 +++ binutils-2.17/ld/ldfile.c 2006-08-24 20:38:38.335091736 -0400 @@ -317,7 +317,8 @@ } free (name); } - else if (ldfile_try_open_bfd (entry->filename, entry)) + + if (ldfile_try_open_bfd (entry->filename, entry)) { entry->sysrooted = IS_ABSOLUTE_PATH (entry->filename) && is_sysrooted_pathname (entry->filename, TRUE);