https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102803
--- Comment #4 from Carlos Galvez <carlosgalvezp at gmail dot com> --- Thanks a lot for the detailed answer! That's very interesting, so it can actually have to do with how the Ubuntu version has been built. I'll definitely give it a try building locally. Your output looks like exactly what I would expect. The remaining /usr/include and /usr/local/include are due to the Linux system headers, which are GCC-agnostic (I think), so it makes sense that it picks them from there.