Page 1 of 1

C++ freestanding headers issues with C freestanding headers

Posted: Wed Jan 25, 2023 8:35 am
by MageNukem
Hi to everyone reading this.

I recently switch to C++ for my kernel (which is still pretty small) and I use a cross compiler for it.
I wanted to install the C and C++ freestanding headers which seems to work but the C++ headers (<cstdint>, <cstdarg>, ...) don't include the respective C headers.

These are the configuration flags I used:

Code: Select all

--target=${target} --disable-nls --enable-languages=c,c++ --without-headers --disable-hosted-libstdcxx
In e.g. the <cstdint> header the following #if is not satisfied:

Code: Select all

#if _GLIBCXX_HAVE_STDINT_H
# include <stdint.h>
#endif
because in the <c++config.h> the _GLIBCXX_HAVE_STDINT_H macro is not defined:

Code: Select all

/* Define to 1 if you have the <stdint.h> header file. */
/* #undef _GLIBCXX_HAVE_STDINT_H */
I couldn't find a solution to why this is and I hope that someone out there knows would could be wrong.

Thanks for reading!

Re: C++ freestanding headers issues with C freestanding head

Posted: Thu Jan 26, 2023 2:58 pm
by Octocontrabass
This sounds very similar to a recent discussion elsewhere. Is the problem fixed by this patch?