Documentation  |  Table of Contents  |   < Previous  |   Next >  |   Index

3    Palm OS Compiler Tools

Introduction to Palm OS® Developer Suite

Palm OS® Developer Suite

This chapter describes how to use the Palm OS compiler tools:

Using Compiler Tools with the Workbench ^TOP^

The Palm OS compiler tools are fully integrated with the Workbench (described in Chapter 2, "Eclipse Workbench Integration,").

The Palm OS C/C++ Perspective uses different compiler chains to build projects, dependent on the application types and target types.

Table 3.1  Compiler chains use by Palm OS Developer Suite

Compiler

When Used

PRC-Tools GNU 68K compiler,
m68K-palmos-gcc.exe

Palm OS 68K applications, shared libraries, and static libraries targeted for Device and Simulator

GNU x86 compiler,
i686-pc-cygwin-gcc-3.3.1.exe

Palm OS Protein applications, shared libraries, and static libraries targeted for Palm OS Cobalt Simulator; PNOs targeted for either Palm OS Garnet Simulator or Palm OS Cobalt Simulator.

Palm OS Protein C/C++ Compiler, pacc.exe

Palm OS Protein applications, shared libraries, and static libraries targeted for Device; PNOs targeted for Device.

When you use the development environment's menu to build a project, the correct compiler chain is called to compile your application.

Setting Compiler Options ^TOP^

To set compiler options in the development environment, you use the Eclipse Workbench's Preferences dialog box. Select Window > Preferences to open the Preferences dialog box, shown in Figure 3.1.

Figure 3.1  Palm OS Development Preferences

GNU Compiler Options

To set compiler options for the GNU C/C++ compilers (gcc), select GNU Compiler. You can set options for both the 68K and the x86 compilers on this page.

For information on the GNU compiler options, see the documentation at PRC-Tools web site (http://prc-tools.sourceforge.net/doc/).

Palm OS Protein C/C++ Compiler Options

To set compiler options for Palm OS Protein C/C++ compiler (pacc), select Palm OS Protein Compiler. You can also set options for Palm OS Linker (palink) and Palm OS Librarian (palib) tools on this page.

For information on the Palm OS Protein C/C++ compiler options, see the book Palm OS Protein C/C++ Compiler Tools Guide.

Running the Compiler Tools ^TOP^

To run the compiler in the development environment, select one of the menu items from the Build menu. For example, select Build > Build Solution to use all of the Palm OS tools to build your Palm OS application.

Using the Palm OS Protein C/C++ Compiler Tools Independently ^TOP^

As is common with command line compilers, Palm OS Protein
C/C++ Compiler, pacc, acts as a driver. pacc invokes all of the commands necessary to produce linked files from source code.

Figure 3.2  Compiler Overview

pacc, paasm, palink: Compiler Tools ^TOP^

  • pacc compiles the source files into assembly
  • pacc calls the assembler, paasm, to produce object code
  • pacc calls the linker, palink, to generate the ELF executable image.

palib: Librarian ^TOP^

palib lets you create and manage a collection of ELF object files. With palib, you can:

  • Create a new library.
  • Add files to the library.
  • Delete files from the library.
  • Replace files in a library.
  • Extract files from a library.

elfdump: Diagnostic Tool ^TOP^

elfdump lets you place the contents of an ELF object file into a text file. With elfdump, you can:

  • Disassemble executable bytecode sections
  • Disassemble data sections as code.
  • Disassemble for a given instruction set architecture
  • Show only segment and section summaries
  • Show specific sections, such as code, data, debug information or symbols.

Getting More Information ^TOP^

The Palm OS compiler tools are described in detail in the book Palm OS Protein C/C++ Compiler Tools Guide.