Chapter 10. Introduction

Table of Contents
Overview of features

This documentation describes the eCos support for the GNU standard C++ library v3 which is a component of the GNU Compiler Collection (GCC). This library, also known as libstdc++, has been designed to fully implement the requirements of the ISO 14822 standard C++ specification, and also provides some of the underlying support for language features such as C++ exceptions and run-time type identification (RTTI).

As with normal GNU toolchains, the standard C++ library is prebuilt alongside the toolchain. The library itself is not contained in this eCos package. Instead the purpose of this package is to provide any ancillary support for the library, provide the CDL definitions required for the correct operation of the library, provide a rigorous and broad testsuite for the library, and of course provide this documentation.

Although the standard C++ library is part of the toolchain, some enhancements have been made to the GCC compiler specifically to support eCos, details of which are found in Chapter 13.

Overview of features

The GNU standard C++ library implements virtually all the library requirements of the C++ standard. Details of the status of the library including known issues may be found on the GNU C++ Standard Library documentation pages.

In summary, the library provides support for standard C++ functionality such as:

  • C++ exceptions

  • Run-time type identification (RTTI) and type information

  • Memory allocation routines: new, delete, allocators, etc.

  • I/O streams, string streams and I/O manipulators

  • C++ friendly numeric limits

  • Strings and character traits

  • Containers: queues, deques, lists, stacks, vectors, maps, sets and bitsets

  • Iterators

  • Algorithms such as sort, find, compare, count, replace, etc. that usually operate on containers and iterators

  • Complex numbers

  • Numeric arrays

  • Numeric algorithms such as accumulate, inner product, partial sum, adjacent difference

  • etc...

This eCos package for libstdc++ also provides support for thread-safe exceptions when using the eCos kernel, as well as expressing with CDL the requirements that the C++ library has on the rest of the eCos system. This is in fact an option within the package named CYGPKG_LIBSTDCXX_LIBRARY, which may be overridden and disabled, although this must be done at the developer's own risk.

This package also contains a large number of tests, including some rigorous tests of core functionality such as C++ exceptions (and in particular their thread-safety and correct operation in a multi-threaded environment), RTTI, and the main library features. These may be found in the tests subdirectory within this package. The GNU libstdc++ v3 testsuite has also been imported and is found in the tscpp subdirectory.

The GNU libstdc++ implementation configures itself on the basis of underlying OS support. In a few areas, where underlying eCos support does not exist, the library configures itself to avoid the requirement for that support. This is normally of little consequence, for example due to libstdc++ providing an alternative implementation with a minor performance impact, or some trivial divergence from strict C++ standard semantics. In some cases the affected functionality is optional in the first place, for example for aspects of C99 standard support. There is one notable area which is affected however, which is that eCos contains very little support for wide characters (wchar). As such, libstdc++ configures itself to omit its own wide character interface that would have been implemented using the underlying OS wide character support. For example, this removes provision of the various wstring and wstreams classes and functions.

Documentation license for this page: eCosPro License