The porting work is considered complete when two objectives are met. The first objective is to make sure all the necessary objects and executables of the application are produced. The second objective is to make sure the ported application, including all executables produced, runs and stays up long enough to pass basic unit testing. If the application passes basic unit testing, it is then passed on to the next phase of the project, which is testing and debugging. Here are some important highlights discussed in this chapter:
GNU does not have shorthand methods to invoking their compiler like AIX (xlC_r, xlC, xlC128, and so on) that will automatically include pthreads, DCE threads, or 128-bit libraries. You must include these parameters and libraries separately on the gcc/g++ and ld line when building your executable.
Both AIX and Linux support the common parameters for building executables, such as the following:
-c Compile only
-o Object name
-D Preprocessor directive name
-L Library search path
-I Library name
-l Include file search path
But many compiler and link parameters control the behavior and the type of output generated in AIX and Linux. Refer back to Tables 5-3 and 5-4 for an extensive list of AIX compiler and linker parameters and their equivalent Linux compiler and linker parameters.
To build an executable in Linux, you must use the gmake utility. The traditional System V make is not compatible in Linux. AIX traditionally uses the System V version of make.
AIX and Linux linkers differ in many ways. AIX uses the XCOFF binary format, whereas Linux uses the ELF format. In addition, AIX and Linux build runtime linkable objects differently, which has an effect on the library search behavior for the l parameter. Linux has library versioning and AIX does not. Users must run their newly created library through the versioning tool under Linux before it can be used.
For template instantiation, AIX and Linux use a repository to store template instantiations and compile that code along with other code as a final step in the compile process prior to linking. The AIX equivalent to qtempinc and qtemplateregistry is frepo in Linux.
AIX and Linux have a long list of compatible system and library APIs. Along with other differences, notable differences are in the return value of ERRNOs.
As of the writing of this book, AIX fully supports POSIX threads and Linux supports Native POSIX Threads Library (NPTL), which has support for POSIX and more. However, both AIX and Linux implement kernel threads and user threads differently.
Large Page Support can be turned on in AIX in a number of ways:
Environment variable: LDR_CNTRL
Compiler flag: -qlargepage
Linker flag: -bmaxdata=<value>
Relinking the executable with ldedit blpdata <filename>
To enable Large Page Support in Linux, you need to reconfigure the kernel. Chapter 3 shows you how to enable Large Page Support for Linux.
Although some applications are relatively easy to port because of their inherently portable characteristics, some applications written to use AIX extensions take a little more porting effort. Overall, Linux 2.6 has improved its capabilities to readily accept software applications to run on it. Porting to Linux has never been easier. New features such as a preemptive kernel and support for better threads scheduling makes Linux an operating system that is truly ready for enterprise use.