Chapter 26. Compiler and Linker Options

Table of Contents
Compiling a C Application
Compiling a C++ Application

eCos is built using the GNU C and C++ compilers. eCos relies on certain features of these tools such as constructor priority ordering and selective linking which are not part of other toolchains.

Some GCC options are required for eCos, and others can be useful. This chapter gives a brief description of the required options as well as some recommended eCos-specific options. All other GCC options (described in the GCC manuals) are available.

Compiling a C Application

The following command lines demonstrate the minimum set of options required to compile and link an eCos program written in C.

$ TARGET-gcc -c  -IINSTALL_DIR/include file.c
$ TARGET-gcc -o program file.o -LINSTALL_DIR/lib -Ttarget.ld -nostdlib