Software professionals porting applications from UNIX or Linux on other platforms to Linux on POWER must remember the following:
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. |