Chapter 14. Toolchain
To build GCC for use with this package, it is necessary to follow some additional steps compared with what would ordinarily be required for building the compiler. These steps are required to provide the eCos header files which are used by the GCC build, to determine properties of the run-time system and to apply a set of changes (a “patch”) to allow eCos to provide C++ exception support in a flexible and future-proof way. This patch takes particular care to ensure that the compiler and libstdc++ continue to behave correctly when no eCos kernel is present.
With eCos installed, the
ECOS_REPOSITORYenvironment variable set and ecosconfig in yourPATHvariable, run the following commands at a bash shell prompt in an empty directory, choosing a TARGET of the appropriate architecture:$
ecosconfig new$TARGETlibstdc++ecosconfig tree$make headers-
Take the header tree generated under
install/includeand install it in thesubdirectory where you intend to install your tools. For example if you wish to install the new tools toTARGET/sys-include/opt/newtools, then place the headers in a new directory/opt/newtools/. (Note you must ensure you have write-access toTARGET/sys-include/optin this example, or you can choose an alternate path). A C++ exception support patch is supplied on the eCosPro Developer's Kit CD-ROM. Once the patch has been applied, it is necessary to run the following command:
$
contrib/gcc_update --touchConfigure GCC from within an empty build directory as follows, ensuring that the GNU binary utilities are at the head of the
PATH:$
/src/gcc-3.x.x/configure --target=TARGET\ --prefix=/opt/newtools --enable-languages=c,C++ \ --with-gnu-as --with-gnu-ld --with-newlib \ --enable-threads
| 2025-10-02 | eCosPro Non-Commercial Public License |



