Installation of freestanding headers

Manuel Hohmann mhohmann@physnet.uni-hamburg.de
Sun Aug 21 14:56:00 GMT 2011


Hi everybody,

I have the following problem: I would like to set up a full freestanding
GCC C++ compiler toolchain for OS kernel development. The latter
requires that I use a "bare metal" target (i686-elf, x86_64-elf,
arm-elf, m68k-elf), and I don't have any hosted libraries. Setting up a
GCC C / C++ cross compiler for these targets works just fine. The
freestanding C headers are also installed properly.

However, for a full freestanding environment, I also need the
freestanding C++ headers. According to the GCC / libstdc++ docs, these
should be part of the libstdc++. Further looking into the docs I found
that the --disable-hosted-libstdcxx configure switch should tell
libstdc++ to install the freestanding headers only. But unfortunately,
the build process still insists on building the full hosted C++ library,
which of course fails since I don't have any C library implementation
for my target architecture. In the libstdc++ sources I found:

(libstdc%2B%2B-v3/acinclude.m4)

dnl
dnl Check if the user only wants a freestanding library implementation.
dnl
dnl --disable-hosted-libstdcxx will turn off most of the library build,
dnl installing only the headers required by [17.4.1.3] and the language
dnl support library.  More than that will be built (to keep the Makefiles
dnl conveniently clean), but not installed.
dnl

So does that mean that GCC will try to build the full hosted libstdc++
anyway, just to keeps the Makefiles simpler? Is there any possibility to
install just the freestanding C++ headers, without having a hosted C
library?

Regards,
Manuel Hohmann



More information about the Libstdc++ mailing list