C++ Code Size - 2025.2 English - UG1400

Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400)

Document ID
UG1400
Release Date
2025-11-20
Version
2025.2 English

A GCC toolchain with the latest open source C++ standard library (libstdc++-v3) can generate larger code and data fragments than an equivalent C program. A significant portion of this overhead comes from code and data for exception handling and runtime type information. Some C++ applications do not require these features.

Advanced users can use the -fno-exceptions and/or the -fno-rtti switches to remove the overhead and optimize for size. Refer to the GCC documentation for more specific information on available compiler options and their impact.

C++ programs can have more intensive dynamic memory requirements (stack and heap size) due to more complex language features and library routines. Many of the C++ library routines can request memory to be allocated from the heap. Review your heap and stack size requirements for C++ programs to ensure that they are satisfied.