Index: tools/build/v2/tools/gcc.jam =================================================================== --- tools/build/v2/tools/gcc.jam (revision 47285) +++ tools/build/v2/tools/gcc.jam (working copy) @@ -141,6 +141,10 @@ { linker = hpux ; } + else if [ os.name ] = AIX + { + linker = aix ; + } else { linker = gnu ; @@ -327,7 +331,7 @@ # implement and will increase target path length even more. flags gcc.compile OPTIONS shared : -fPIC ; } -if [ os.name ] != NT && [ os.name ] != OSF && [ os.name ] != HPUX +if [ os.name ] != NT && [ os.name ] != OSF && [ os.name ] != HPUX && [ os.name ] != AIX { # OSF does have an option called -soname but it doesn't seem to work as # expected, therefore it has been disabled. @@ -612,6 +616,33 @@ : -fPIC : unchecked ; } + case aix : + { + # + # On AIX we *have* to use the native linker. + # + # Using -brtl, the AIX linker will look for libraries with both the .a and .so + # extensions, such as libfoo.a and libfoo.so. Without -brtl, the AIX linker + # looks only for libfoo.a. Note that libfoo.a is an archived file that may + # contain shared objects and is different from static libs as on Linux. + # + # The -bnoipath strips the prepending (relative) path of libraries from + # the loader section in the target library or executable. Hence, during load- + # time LIBPATH (identical to LD_LIBRARY_PATH) or a hard-coded -blibpath + # (*similar* to -lrpath/-lrpath-link) is searched. Without this option, + # the prepending (relative) path + library name is hard-coded in the loader + # section, causing *only* this path to be searched during load-time. + # Note that the AIX linker does not have an -soname equivalent, this + # is as close as it gets. + # + # The above options are definately for AIX 5.x, and most likely also for + # AIX 4.x and AIX 6.x. For details about AIX linker: + # http://download.boulder.ibm.com/ibmdl/pub/software/dw/aix/es-aix_ll.pdf + # + + flags $(toolset).link OPTIONS : -Wl,-brtl -Wl,-bnoipath : unchecked ; + } + case * : { errors.user-error