It turned out to be a bug (or a feature depending on how do You count) of gcc configure script. In src/external/gpl3/gcc/dist/gcc/configure:5425 it says:
" # Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
# <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
Syntax error
_ACEOF"
And this was the test that was checking if C preprocessor is working. But neither limits.h nor assert.h were is the system includes as we have no includes in tooldir at this point. But the intention of this test was to look for the header files provided with gcc itself and not the system. Hence following CPP reference (
http://en.cppreference.com/w/cpp/preprocessor/include) when I have changed the snippet to use # include "limits.h" and # include "assert.h" it worked as it first looked in current dir and only then in system wide includes.
I will ask in gcc mailing list about this, but this has fixed this particular issue with mknative for me.