Question

--disable-hosted-libstdcxx
                          only build freestanding C++ runtime support

from the <gcc>/libstdc++-v3/configure --help .

What is this freestanding mode and what are the limits and the benefits ?

For the very little that I know about it looks like it's equivalent to some static linkage of the libstdc++ but then what is the point of this "mode" if you can just build your *.a library ? It doesn't sound like a good explanation.

Was it helpful?

Solution

"freestanding" is a minimal configuration for a c++ program, as opposed to "hosted" (full standard library support making use of advanced platform OS features). In theory, "freestanding" c++ program can be made to run on bare iron.

In "freestanding" mode only the following headers can be safely used:

  • cstdarg
  • cstddef
  • cstdlib
  • exception
  • limits
  • new
  • exception
  • typeinfo

With optional:

  • cxxabi.h.

And C++11 ones:

  • initializer_list
  • type_traits

Applications must link to "libsupc++.a" library for limited runtime features support.

http://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html

This is supposed to conform to section 17.6.1.3 of the c++ standard (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf)

OTHER TIPS

Freestanding is used if you are making an operating system, or if you are using an operating system that may not support the standard libraries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top