Section D.2. Porting Considerations

D.2. Porting Considerations

Software professionals porting applications from UNIX or Linux on other platforms to Linux on POWER must remember the following:

  • Linux on POWER is a big-endian platform.

  • Linux on POWER supports two programming models: ILP32 and LP64.

  • The current IBM POWER microprocessor is a 64-bit architecture running a 64-bit Linux OS. However, Linux on POWER provides full binary compatibility with existing 32-bit applications and supports new 64-bit applications.

  • Linux on POWER uses the ELF object file format.

  • The basic compiler flags used in GCC and XL compilers are generally the same. However, a number of the flags differ. For example, Table D-1 compares the commonly used GNU and XL compiler flags.

Table D-1. GNU and XL Compiler Switches


XL C/C++



-v, -V, -#

Turn on verbose mode.



Set up the object files produced by the compiler for profiling.


-q32, -q64, or set the OBJECT_MODE environment variable

Create 32- or 64-bit objects. GCC 64-bit compilers are located at /opt/cross/bin.



Perform syntax checking without generating object files.



Generate position-independent code for use in shared libraries. In XL C/C++, the size of the Global Offset Table is no larger than 64K. If -qpic is specified without any suboptions, -qpic=small is assumed. The -qpic option is enabled if the -qmkshrobj compiler option is specified.



Allows the Global Offset Table to be larger than 64K in size.


-qthreaded or _r invocation mode

Create programs running in a multithreaded environment.



Disable generation of runtime type -qrtti identification (RTTI) for exception handling and for use by typeid and dynamic_cast operators. On XL C/C++, the default is -qnortti.



Objects generated with this option do not link with shared libraries.


-qstaticlink = libgcc

Instruct the compiler to link with the static version of libgcc.


-qnostaticlink or -qmkshrobj

Instruct the compiler to produce a shared object.


-qnostaticlink =libgcc

Instruct the compiler to link with the shared version of libgcc.

-Wl, -rpath

-Wl, -rpath, or -R

Pass a colon-separated list of directories used to specify directories searched by the runtime linker.

-fno-implicit-templates, -frepo

-qtempinc, -qtemplateregistry, -qtemplaterecompile

Template instantiation.



Suppress warning messages.



Enables checking for long-to-integer truncation.



Produces informational messages.


-qalign= bit_packed

Use bit_packed alignment rules.


-qalign= linuxppc

Uses default GCC alignment rules to maintain compatibility with GCC objects. This is the default.

-O, -O2, -O3

-O, -O2, -O3, -O4, -O5

Optimization levels.


-qarch, -qtune, -qcache

Optimization options for a particular processor.

UNIX to Linux Porting. A Comprehensive Reference
UNIX to Linux Porting: A Comprehensive Reference
ISBN: 0131871099
EAN: 2147483647
Year: 2004
Pages: 175 © 2008-2017.
If you may any questions please contact us: