https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91879
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |WAITING Last reconfirmed| |2019-09-24 Ever confirmed|0 |1 --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Stas Sergeev from comment #3) > And yet what I see is that when gcc is building its libs, > it looks for the system headers under prefix, not under destdir. 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? > (In reply to Jonathan Wakely from comment #2) > > (In reply to Stas Sergeev from comment #0) > > > Hello. > > > > > > I tried to build gcc with non-empty DESTDIR. > > > > What exact commands did you run? > > I have the script that runs basically "make all-gcc" and > "make" after setting some env vars. And what fails is the > plain "make" step. I can show you how exactly: You didn't show how. What exact commands did you run? 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. > Please note the > -isystem /usr/local/cross/i586-pc-msdosdjgpp/include -isystem > /usr/local/cross/i586-pc-msdosdjgpp/sys-include > > above. Clearly it misses the DESTDIR, and feeding the > DESTDIR there makes the problem to go away. The GNU coding standards specifically say "DESTDIR should be supported only in the install* and uninstall* targets, as those are the only targets where it is useful." -- https://www.gnu.org/prep/standards/html_node/DESTDIR.html 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.