The Tornado 2.0 project facility is correctly preconfigured for building WRS BSPs. However, if you choose not to use the project facility or if you need to customize your build, you may need the information in the following sections. This includes a configuration constant, an environment variable, and compiler options that together specify the information the GNU toolkit requires to compile correctly for the MIPS targets.
Setting the preprocessor variable CPU ensures that VxWorks and your applications build with the appropriate architecture-specific features enabled. Define this variable to be R3000 (for the MIPS R3000 or R3500), R4000 (for the R4200 or R4600), or R4650 (for the MIPS R4640 or R4650).
For example, to define CPU for an R3500 on the compiler command line, specify the following command-line option when you invoke the compiler:
-DCPU=R3000
To provide the same information in a header or source file, include the following line in the file:
#define CPU R3000
All VxWorks makefiles pass along the definition of this variable to the compiler. You can define CPU on the make command line as follows:
% make CPU=R3000 ...
You can also set the definition directly in a makefile, with the following line:
CPU=R3000
The following is an example of a compiler command line for R3000 cross-development. The file to be compiled in this example has a base name of applic.
% ccmips -DCPU=R3000 -I/usr/vw/h -mcpu=r3000 -O2 -funroll-loops \ -nostdinc -G 0 -c applic.c
This is an example for the R4000:
% ccmips -DCPU=R4000 -I/usr/vw/h -mcpu=r4000 -mips3 -mgp32 \ -mfp32 -O2 -funroll-loops -nostdinc -G 0 -c applic.c
The options shown in the examples have the following meanings:1
|
NOTE: To specify optimization for use with GDB, use the -O0 flag.
|
||||||||||||||||||
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; a list of these options is included in the Guide. Other options are not supported, although they are available with the tools as shipped.