This seems to be a rather common issue when working with cross-compilation toolchains, specially those involving the use of musl as their libc of choice.
Previously, musl didn't provide stdc-predef.h which was thought to be the main cause for this ignored error, but it seems that this error is surfacing again without a valid cause.
Initially, I got rid of this error by specifying the following flag--with-native-system-header-dir=/include (the trailing slash before include is needed) to the configure function for crossgcc, which when combined with --with-sysroot=$DIRECTORY (according to gcc's current documentation), will cause gcc to search for header files within $DIRECTORY/include.
But now, it seems that this error managed to pop up again with no apparent reason, and it should be treated as an ignored warning more or less.
Debian recommends creating an empty stdc-predef.h file to silence this error, according to Debian's bootstrap issues.
In my opinion, the real reason why this error is showing is due to the C library (which is musl in our case) not being available in $sysroot (along with its headers, including stdc-predef.h) at the time of running the build function, which means that it's a harmless error and should remain ignored.
Since the build is continuing just fine, and isn't exiting with various missing header files, creating an empty stdc-predef.h in $sysroot's appropriate include directory seems the right way to go.
This seems to be a rather common issue when working with cross-compilation toolchains, specially those involving the use of
musl
as their libc of choice.Previously,
musl
didn't providestdc-predef.h
which was thought to be the main cause for this ignored error, but it seems that this error is surfacing again without a valid cause.Initially, I got rid of this error by specifying the following flag
--with-native-system-header-dir=/include
(the trailing slash beforeinclude
is needed) to theconfigure
function forcross
gcc
, which when combined with--with-sysroot=$DIRECTORY
(according togcc
's current documentation), will causegcc
to search for header files within$DIRECTORY/include
.But now, it seems that this error managed to pop up again with no apparent reason, and it should be treated as an ignored warning more or less.
Debian recommends creating an empty
stdc-predef.h
file to silence this error, according to Debian's bootstrap issues.In my opinion, the real reason why this error is showing is due to the C library (which is
musl
in our case) not being available in$sysroot
(along with its headers, includingstdc-predef.h
) at the time of running thebuild
function, which means that it's a harmless error and should remain ignored.Since the
build
is continuing just fine, and isn't exiting with various missing header files, creating an emptystdc-predef.h
in$sysroot
's appropriateinclude
directory seems the right way to go.For further reading: