2. Preliminary Note for Cross Platform UsersΒΆ

The use of GNAT in a cross environment is very similar to its use in a native environment. Most of the tools described in the GNAT User’s Guide for Native Platforms including the ASIS-based tools (gnatelim, gnatstub, gnatpp), have similar functions and options in both modes. The major difference is that the name of the cross tools includes the target for which the cross compiler is configured. For instance, the cross gnatmake tool is invoked as <target>-gnatmake where <target> stands for the name of the cross target. Thus, in an environment configured for the target powerpc-wrs-vxworks, the gnatmake command is powerpc-wrs-vxworks-gnatmake. This convention allows the installation of a native and one or several cross development environments on the same machine.

The rest of this manual generally refers to the tools with their simple native names (e.g., gcc) when describing their generic functionality, and with their full cross names (e.g., <target>-gcc) when describing their invocation.

Note that most bare-board platforms no longer include the older <target>-gnatmake builder. The newer multi-lingual builder gprbuild is used instead. This change only applies to bare-board targets; those with real-time operating systems (e.g., VxWorks) still have gnatmake available.

The tools that are most relevant in a cross environment are gcc, gnatmake, gnatbind, and gnatlink to build cross applications; and gnatls for cross library browsing.

gdb is usually available for cross debugging in text mode. The graphical debugger interface in GPS is always a native tool but it can be configured to drive a cross debugger, thus allowing graphical cross debugging sessions. Some other tools such as gnatchop, gnatkr, gnatprep, gnatxref, gnatfind and gnatname are also provided for completeness even though they do not differ greatly from their native counterparts.

The GNAT Project facility is integrated into the cross environment.

GPS uses the gnatlist attribute in the Ide package, whose value is <target>-gnatls, to compute the cross-prefix. From this information the correct location for the GNAT run-time library, and thus also the correct cross-references, can be determined. See the GPS documentation for more details, in particular the section “Working in a Cross Environment”.