Any suggestions? Does the -isysroot compiler flag fix this sort of issue? It does not seem to be used in the gcc build.
I'd expect it might. Run with -v and see if isysroot is given to ld. If not, add -Wl,-isysroot=... to pass it down to ld. In later compilers, we do this automagically, given -isysroot.