The following sections describe how to use the VxSim compilers. The recommended way to build VxSim modules is to use the project tool. For complete information on this tool, see the Tornado User's Guide: Projects. If you are using manual methods in your project, the information required for manual builds and loading is summarized below.
This information applies to using manual methods on both the built-in version of VxSim and the optional networking product.
|
CAUTION: The compiler used by the Tornado tools to compile VxSim applications for Windows is the GNU C/C++ compiler rather than the MicroSoft tools.
|
||||||||||||||||||
The following is an example of a compiler command line for VxSim development. The file to be compiled in this example has a base name of applic.
% ccsimso -DCPU=SIMSPARCSOLARIS -ansi -nostdinc -g -fno-builtin \ -fvolatile -DRW_MULTI_THREAD -D_REENTRANT -O2 -I. \ -I /wind/target/h -c applic.c
The following is an example of a compiler command line for VxSim development. The file to be compiled in this example has a base name of applic.
% cchppa -g -ansi -nostdinc -DRW_MULTI_THREAD -D_REENTRANT -O2 \ -fvolitile -fno-builtin -I. -I/wind/target/h -DCUP_SIMHPPA \ -c applic.c
The following is an example of a compiler command line for VxSim development. The file to be compiled in this example has a base name of applic.
% ccsimpc -DCPU=SIMNT -mpentium -ansi -nostdinc -g -nostdlib \ -fno-builtin -fno-defer-pop -Wall -DRW_MULTI_THREAD \ -D_REENTRANT -I. -I C:/Tornado/target/h -c applic.c
The options shown in the example have the following meanings:1
|
CAUTION: VxSim for HP-UX uses the HP native linker ld rather than the GNU linker (ldhppa).
|
||||||||||||||||||
-> ld </usr/tony/application.o value = 3957696 = 0x3c63c0
As with VxWorks, the Tornado dynamic linker ld( ) requires a relocatable object module. The object format is as follows:
|
|||||||||||||||||||
|
|||||||||||||||||||
|
|||||||||||||||||||
The other method of linking is to modify the target makefile to link the application code statically into VxSim when VxSim is built. This method is also useful if you have already debugged a module and you do not want to download it to the target every time you start VxSim.
To link the application code statically into VxSim, follow these steps:
MACH_EXTRA = application.o
Large applications may be managed more effectively by using multiple object files. Before downloading the application to VxSim, the objects can be combined into a single file by performing a partial link as shown below:
% /bin/ldsimso -B immediate -N -r -o application.o module1.o \ module2.o ...
If you want to use CrossWind to debug your application on the HP-UX simulator, you must run xlinkHppa on the partially-linked object file before downloading it to VxWorks. For example:
% xlinkHppa application.o
The following tools are available to extract the symbol table from an object file created for a simulator. The syntax is:
elfXsyms < objMod > symTbl
xsymHppa < objMod > symTbl
1: For more information on these and other compiler options, see the GNU ToolKit User's Guide. WRS supports compiler options used in building WRS software; see the Guide for a list. Other options are not supported, although they are available with the tools as shipped.