https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91879
--- Comment #6 from Stas Sergeev <stsp at users dot sourceforge.net> --- (In reply to Jonathan Wakely from comment #5) > Which makes sense, since the system headers are not part of GCC itself, so > why would it expect them in the temporary staging area for GCC's own files? OK, I understand. But then its a bit unclear to me how to build the cross-compiler. I build both gcc and its libs on the host, so somehow I need to provide it with the location of the headers _on host_, which is different with what will it be later on the target. > You didn't show how. What exact commands did you run? If only that would be so easy to tell with the script I have. :) > I'm not interested in the libtool command that GCC runs, I want to know what > your script does. Not what it runs basically, but precisely. The configure > command, and the make commands. OK, still "basically", but hopefully more informative than before: --- export DESTDIR=/path/to/somedir cd builddir ../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 --target=i586-pc-msdosdjgpp --pref ix=/usr/local/cross --enable-languages=c,c++ make all-gcc make install-gcc make [ fails here ] make install-strip --- Some things are still stripped, as the script also sets pathes after make install-gcc and does some other things. If this is still not enough, I'll work on a minimal reproducer. > So if you need it defined before that step, you're doing something wrong. We > can't tell what you're doing wrong, because you haven't said what you're > doing. I am trying to get this build script to work: https://github.com/stsp/build-gcc/tree/master to build djgpp tool-chain w/o root privs. The current strategy of that script is to install built gcc on host (needs root), then build gcc libs from there. I want to confine it to the DESTDIR, including the headers installation, so the way I run that script (I don't expect you are going to try it yourself of course): --- QUIET=1 DESTDIR=`pwd`/ttt ./build-djgpp.sh gcc-9.2.0 ---