Ludovic Courtès writes: > Hi Marius, > > Marius Bakke skribis: > >> Ludovic Courtès writes: > > [...] > >>> The issue that Tobias reports reminds me of the CPATH vs. C_INCLUDE_PATH >>> issue that was causing troubles with newer GCCs, and that I think Marius >>> addressed in ‘core-updates’ (?). Marius, does that ring a bell? >> >> Unfortunately there are still issues with cross-compiling C++ on >> 'core-updates'. For 'C', the workaround was to go back to "CROSS_CPATH" >> instead of "CROSS_C_INCLUDE_PATH", like with native builds. > > That should also address C++, since CPATH (and CROSS_CPATH) are for all > language front-ends, no just C, no? Indeed. The cross-compilation problems are unrelated. >> For native builds on core-updates, GCC7 occasionally fails if the libc >> or kernel headers are not on C_INCUDE_PATH (see e.g. f90d6c3). It could >> be that cross builds need a similar workaround, but I have not found the >> magic incantation yet. > > How can it be that kernel headers are not on C_INCLUDE_PATH (or CPATH)? Sorry, this was a red herring. :-) (Kernel headers are of course on CPATH because they are propagated from glibc, but adding them on C_INCLUDE_PATH works around some corner cases because GCC disables warnings for such headers, which is expected by some build scripts.) I expected the problem with GCC not finding target libc headers to be a matter of getting it on CROSS_CPLUS_INCLUDE_PATH, just like we had to set C_INCLUDE_PATH for GCC 7's build processes to find libc. But, looking at this issue with a fresh mind I managed to locate the problem, and a one-liner fix: