https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91879
--- Comment #8 from Stas Sergeev <stsp at users dot sourceforge.net> --- (In reply to Andrew Pinski from comment #7) > Have you looked into --with-build-sysroot ? Thanks! Very helpful. But now it has the same problem when configuring libstdc++: --- configure:4574: /home/stas/src/build-gcc/build/djcross-gcc-9.2.0/djcross/./gcc/x gcc -B/home/stas/src/build-gcc/build/djcross-gcc-9.2.0/djcross/./gcc/ -B/usr/loc al/cross/i586-pc-msdosdjgpp/bin/ -B/usr/local/cross/i586-pc-msdosdjgpp/lib/ -isy stem /usr/local/cross/i586-pc-msdosdjgpp/include -isystem /usr/local/cross/i586- pc-msdosdjgpp/sys-include --sysroot=/home/stas/src/build-gcc/ttt/usr/local/cross -c -g -O2 conftest.c >&5 conftest.c:10:10: fatal error: stdio.h: No such file or directory 10 | #include <stdio.h> | ^~~~~~~~~ --- As you can see, it added the correct --sysroot. But unfortunately -isystem is still unaffected. If I change -isystem in the command line above, then conftest.c can be compiled. Here's the full top-level configure invocation: --- ../gnu/gcc-9.2.0/configure --disable-plugin --enable-lto --disable-libssp -- disable-nls --enable-libquadmath-support --enable-version-specific-runtime-libs --enable-fat --enable-libstdcxx-filesystem-ts --with-build-sysroot=/home/stas/sr c/build-gcc/ttt/usr/local/cross --target=i586-pc-msdosdjgpp --prefix=/usr/local/ cross --enable-languages=c,c++ --- As you can see, I added --with-build-sysroot.