RTEMS Logo

RTEMS 4.7.2 On-Line Library


Miscellaneous Support Files GCC Compiler Specifications File

PREV UP NEXT Bookshelf BSP and Device Driver Development Guide

5.1: GCC Compiler Specifications File

The file bsp_specs defines the start files and libraries that are always used with this BSP. The format of this file is admittedly cryptic and this document will make no attempt to explain it completely. Below is the bsp_specs file from the PowerPC psim BSP:

%rename cpp old_cpp
%rename lib old_lib
%rename endfile old_endfile
%rename startfile old_startfile
%rename link old_link

*cpp:
%(old_cpp) %{qrtems: -D__embedded__} -Asystem(embedded)

*lib:
%{!qrtems: %(old_lib)} %{qrtems: --start-group \
%{!qrtems_debug: -lrtemsall} %{qrtems_debug: -lrtemsall_g} \
-lc -lgcc --end-group  ecrtn%O%s \
%{!qnolinkcmds: -T linkcmds%s}}

*startfile:
%{!qrtems: %(old_startfile)} %{qrtems:  ecrti%O%s \
%{!qrtems_debug: startsim.o%s} \
%{qrtems_debug: startsim_g.o%s}}

*link:
%{!qrtems: %(old_link)} %{qrtems: -Qy -dp -Bstatic \
-T linkcmds%s -e _start -u __vectors}

The first section of this file renames the built-in definition of some specification variables so they can be augmented without embedded their original definition. The subsequent sections specify what behavior is expected when the -qrtems or -qrtems_debug option is specified.

The *cpp definition specifies that when -qrtems is specified, predefine the preprocessor symbol __embedded__.

The *lib section insures that the RTEMS library, BSP specific linker script, gcc support library, and the EABI specific ecrtn file are used.

The *startfile section specifies that the BSP specific file startsim.o will be used instead of crt0.o. In addition, the EABI specific file ecrti.o will be linked in with the executable.

The *link section specifies the arguments that will be passed to the linker.

The format of this file is specific to the GNU Compiler Suite. The argument used to override and extend the compiler built-in specifications is relatively new to the toolset. The -specs option is present in all egcs distributions and gcc distributions starting with version 2.8.0.


PREV UP NEXT Bookshelf BSP and Device Driver Development Guide

Copyright © 1988-2004 OAR Corporation