next up previous contents
Next: Statistics processing utilities Up: Building applications ported to Previous: Using the generic makefile

Using ordinary UNIX command sequences

Some users may want to invoke the commands for building applications directly rather than using the generic makefile. In particular, users intending to run RSIM on platforms without the ELF library must directly run unelf on the Solaris executables of the applications to be simulated.

The first step is to generate relocatable object files (.o files) from the source-code files. This can be done using an ordinary SPARC C compiler for Solaris. The recommended options for invoking the Sun C compiler version 4.0 to generate object code from the source file src/source1.c are:

prompt% cc -xO4 -xtarget=ultra1/170 -xarch=v8plus -dalign -o obj/source1.o -c src/source1.c

These options generate code with all optimizations recommended by the compiler, with code scheduled for Sun Ultra-1 workstations with a 170 MHz UltraSPARC processor. The code uses the SPARC V8plus subset of the V9 architecture, and assumes that double-precision accesses are properly aligned, allowing use of double-precision floating-point loads and stores.

Next, a SPARC application executable must be generated. Recommended options for invoking the Sun linker to generate the file execs/appname.out from the files obj/source1.o and obj/source2.o are (substituting the fully-specified pathname of the RSIM distribution for /path_to_rsim/rsim-1.0 below):

prompt% /usr/ccs/bin/ld -dn -z muldefs -L /path_to_rsim/rsim-1.0/apps/utils/lib -emystart -o execs/appname.out /path_to_rsim/rsim-1.0/apps/utils/lib/crt0.obj obj/source1.o obj/source2.o -l rsim -l c -l m -l rsim

This generates a statically-linked executable that starts with the function mystart, linking the RSIM application startup object file (crt0.obj) with the application object files, and resolving unknown references with the RSIM library, the C library, and the system math library. The RSIM library is included twice so that unresolved references from the C and math libraries are resolved to RSIM library functions, when applicable.

If a different set of linker options is chosen, the user must guarantee that the linker output produced is a statically-linked application executable and that the entry point for the executable is the same as the base of the text segment, which in turn must correspond to the mystart function. Additional constraints on the application executable are given in Chapter 5.

After generating a SPARC application executable, the file to be run through RSIM must be predecoded, as described in Section 1. The syntax of predecode is:

prompt% predecode execs/appname

where execs/appname.out is the name of the SPARC application executable file to be predecoded. This command produces a file called appname.out.dec and also produces output on the screen related to the file being predecoded. As this output is generally not needed, the user will usually want to redirect this to /dev/null.

Users intending to run RSIM on target platforms that do not support ELF will need to first process the application executables to be simulated with the unelf utility as follows:

prompt% unelf execs/appname.out

where appname.out is the name of the file to be expanded. This command produces a file called app.out_unelf. unelf itself must be run on an ELF platform; however, we do not expect this to add any difficulty, as the applications themselves are currently built using an ELF platform.


next up previous contents
Next: Statistics processing utilities Up: Building applications ported to Previous: Using the generic makefile

Vijay Sadananda Pai
Thu Aug 7 14:18:56 CDT 1997