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

GCC

XL C/C++

Description

-v

-v, -V, -#

Turn on verbose mode.

-p/-profile

-p

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

N/A

-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.

-fsyntax-only

-qsyntaxonly

Perform syntax checking without generating object files.

-fpic

-qpic=small

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.

-fPIC

-qpic=large

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

-pthread

-qthreaded or _r invocation mode

Create programs running in a multithreaded environment.

-fno-rtti

-qnortti

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.

-static

-qstaticlink

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

-static-libgcc

-qstaticlink = libgcc

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

-shared

-qnostaticlink or -qmkshrobj

Instruct the compiler to produce a shared object.

-shared-libgcc

-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.

-w

-w

Suppress warning messages.

 

-warn64

Enables checking for long-to-integer truncation.

 

-qinfo=<…>

Produces informational messages.

-fpack-struct

-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

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net