Appendix C. Libraries in XL C/C++


Redistributable libraries

XL C/C++ provides the following redistributable libraries. Depending on your application, you may need to ship one or more of these libraries together with applications built with XL C/C++.

libibmc++.so
Used only by C++ programs.

libxlsmp.so libxlsmp_ser.so libxlsmpdebug.so
Required when -qsmp or -qsmp=omp options are in effect.

Order of linking

XL C/C++ links libraries in the following order:

  1. user .o files and libraries
  2. XL C/C++ libraries
  3. C++ standard libraries
  4. C standard libraries

The table below shows the linking order in greater detail for a "Hello World" type of program.

Directory paths shown may vary depending on your particular compiler configuration. See the default configuration file installed on your system for information specific to your particular compiler configuration. See Specify Compiler Options in a Configuration File for more information about compiler default configuration files in general.

ld Command Components Options ld Arguments xldriver attributes
ld gcc, g++ collect2 ld / ld_64
xlc, xlC ld
enable exception handling personality handlers all --eh-frame-hdr Option added to command line by xldriver
generate .ident directives -Qn

otherwise -Qy Option added to command line by xldriver
output kind -shared -static -shared Option added to command line by xldriver
-shared -shared
-static -static
Otherwise
arch 32-bit -melf32ppclinux Option added to command line by xldriver
64-bit -mel64ppc
dynamic loader 32-bit !-shared !-static -dynamic-linker /lib/ld.so.1 dynlib
64-bit !-shared !-static -dynamic-linker /lib64/ld64.so.1 dynlib64
call to main( ) 32-bit !-shared /usr/libcrt1.o crt
64-bit !-shared /opt/cross/powerpc64-linux/lib/crt1.o crt_64
32-bit !-shared -p /usr/lib/gcrt1.o mcrt
32-bit !-shared -pg gcrt
64-bit !-shared -p /opt/cross/powerpc64-linux/lib/gcrt1.o mcrt_64
64-bit !-shared -pg gcrt_64
init/fini functions prolog 32-bit all /usr/lib/crti.o crtp
64-bit all /opt/cross/powerpc64-linux/lib/crti.o crtp_64
init/fini register -shared -static crtbeginT.o crtbegin_t / crtbegin_t_64
-static
-shared crtbeginS.o crtbegin_s / crtbegin_s_64
otherwise crtbegin.o crtbegin / crtbegin_64
library search paths 32-bit gcc -L<gcc>/gcc-lib gcc_libdirs
64-bit gcc -L<gcc64>/gcc-lib gcc_libdirs_64
32-bit g++ -L<gcc>/gcc-lib/powerpc-suse-linux-gnu/3.2
-L<gcc>/gcc-lib
gcc_libdirs
64-bit g++ -Lgcc64/gcc-lib/powerpc64-linux-gnu/3.2
-Lgcc64/gcc-lib
gcc_libdirs_64
user .o files and libraries all

vacpp libraries all
libraries2 / libraries2_64
C++ standard libraries g++ -lstdc++ -lm gcc_cpp_libs / gcc_cpp_libs_64
C standard libraries gcc
-static
-static -shared-libgcc
-shared -static-libgcc
-lgcc
-lgcc_eh
-lc
-lgcc
-lgcc_eh
gcc_static_libs / gcc_static_libs_64
g++
-shared-libgcc
-lgcc_s
-lgcc
-lc
-lgcc_s
-lgcc
gcc_shared_libs / gcc_shared_libs_64
all
gcc_libs / gcc_libs_64
save/restore routines all crtsavres.o crtsavres / crtsavres_64
init/fini run
crtend.o crtend / crtend_64
-shared crtendS.o crtend_s / crtend_s_64
init/fini functions epilog all /usr/lib/crtn.o crte
/opt/cross/powerpc64-linux/lib/crtn.o crte_64

IBM Copyright 2003