Release Notes for the Advance Toolchain 4.0 Version 4.0-4


| Features | Previous Releases | Support | Installation | Usage | Limitations |

Features in 4.0-4

  • The Advance Toolchain is a self contained toolchain which isn't reliant on the base system toolchain.
  • Decimal Floating Point support in the following packages:
    • GCC-4.5.2-ibm-r179810 [C,C++ (g++), fortran]
    • GNU Binutils-2.21.53.20111001
    • GLIBC-2.12-ibm
    • LIBDFP 1.0.4-r14146
    • GDB-7.3.1 with Python scripting
  • Releases of the following packages in support of the Advance Toolchain:
    • Valgrind-3.6.0
    • OProfile-0.9.7 with Java (1.5 or later) support
    • GMP-4.3.2
    • MPFR-3.0.0
    • MPC-0.8.2
    • PPL-0.11
    • CLOOG-PPL-0.15.10
    • LIBELF-0.8.12
    • Libhugetlbfs 2.9
    • Zlib 1.2.5
    • Libauxv 0.0.9
    • Libexpat 2.0.1
    • Python 2.6.6
  • Power6 enablement.
  • Power6 Optimized scheduler.
  • Power6 Native DFP instruction support.
  • Power6 VMX enablement with auto-vector.
  • Power7 enablement.
  • Power7 Optimized scheduler.
  • Power7 Native DFP instruction support.
  • Power7 VMX/VSX enablement with auto-vector.
  • ppc970,POWER4,POWER5,POWER5+,POWER6, POWER6x and POWER7 optimized system libraries.

Apart from package versions listed above:

Previous releases

New features in 4.0-3

  • GCC includes the following fixes:
  • GLIBC includes the following fixes:
    • Trigonometric optimizations for POWER cpus.
    • Set stacksize in __aio_create_helper_thread to default for AIO with TLS.
    • Static TLS memory leak fix (DTV case).
    • Remove pthread_attr_setstacksize from __aio_create_helper_thread.
  • Valgrind POWER7 patch to with complete support for POWER7 # (minus DFP support)
  • Update oprofile from 0.9.7-rc4 to 0.9.7 GA
  • Fix sample counts for OProfile XML output.

New features in 4.0-2

  • GLIBC includes the following fixes:
    • Set stacksize in __aio_create_helper_thread to default for AIO with TLS.
    • Trigonometric optimizations for POWER CPUs.
  • Enhanced POWER7 support in Valgrind.

New features in 4.0-1

New features in 4.0-0

  • Libhugetlbfs 2.9 is now shipped.
  • MPC 0.8.2 is now shipped.
  • PPL 0.11 is now shipped.
  • CLOOG-PPL 0.15.10 is now shipped.
  • LIBELF 0.8.12 is now shipped.
  • Python 2.6.6 is now shipped.
  • Large TOC with -mcmodel=medium and -mcmodel=medium -fPIE optimizations.
  • XL MASS library enablement for vectorizing math functions.
  • Graphite loop optimizations.
  • Link Time Optimizations.
  • GDB updated to 7.2, featuring Python scripting support.

What's new in 3.0-1

  • Cross-compiler available for x86 32-bit as a separate download.
  • Compatibility runtime RPM for older Linux distributions (SLES9 and RHEL4).
  • Large TOC fixes for GCC and Binutils.
  • Valgrind-itrace now supports dynamically linked 32-bit and 64-bit executables, as well as statically linked executables.
  • Bug fixes for Valgrind and vgi2qt tool.
  • The 64-bit Stack is now marked non-executable.

New features in 3.0-0

  • Binaries are all 64-bit.
  • The compiler now defaults to 64-bit.
  • Better Thread Local Storage support.
  • Several POWER7-specific optimizations for GCC and GLIBC.

Documentation for each component can be found here:


Support

Customer support for the Advance Toolchain (AT) is provided in one of three ways:

  1. If you are using AT as directed by an IBM product team (ex.: IBM XL Compiler or PowerVM Lx86) please report suspected AT problems to IBM Support using that product name and entitlement.
  2. IBM's Support Line for Linux Offering in the United States now provides support for AT as well. If you have a contract with a U.S. Support Line for Linux contract, place a call to IBM Support:
    • Dial 1-800-426-IBM-SERV
    • Option #2 (Other business products or solutions)
    • Option #2 (Software)
    • Option #7 (Other OS/Linux)
  3. All other users can use an electronic forum that is monitored Monday through Friday. For questions regarding the use of or to report a suspected defect in AT, click here.
    • Open the Advance Toolchain topic.
    • Select 'Post a New Reply'.
    • Enter and submit your question or problem.
    • An initial response will be attempted within 2 business days.

Installation

The gpg public key gpg-pubkey-- will be provided in the repository where these release notes were found. This pubkey can be used to verify the authenticity of both the Advance Toolchain rpms and the repository contents.

Download this gpg-pubkey and import it into your rpm database using the following:

rpm --import gpg-pubkey--

Note: on SLES10, please install the ncurses package (64-bit) before installing the Advance Toolchain.

Using YaST

To install, execute yast as root. Then:

  • Select Add-on Product.
  • Select the FTP Protocol:
    • (x) FTP...
    • Under Server Name:
      ftp.unicamp.br
    • Under Directory on Server:
      /pub/linuxpatch/toolchain/at/at4.0/suse/SLES_10
  • You will get a warning about there being no product information available at the given location. This is because the repomd based repository doesn't contain the YaST product information. This is not a bug. Select [Continue].
  • Under the Software Management interface, search for advance toolchain and mark the runtime, devel and perf packages for installation as necessary and click [Accept].

Manual installation

If you are installing the rpms manually you will need to install the rpms in the following order (due to prerequisites):

advance-toolchain-at4.0-runtime-4.0-4
advance-toolchain-at4.0-devel-4.0-4
advance-toolchain-at4.0-perf-4.0-4

If you are updating a previous installation, you need to update as a batch, so rpm can solve the dependencies, i.e.:

rpm -Uvh advance-toolchain-at4.0-runtime-4.0-4.ppc64.rpm advance-toolchain-at00-devel-0.0-0.ppc64.rpm advance-toolchain-at00-perf-0.0-0.ppc64.rpm

The rpm command should always be run as root. Failure to do so will result in an error similar to this:

error: can't create transaction lock on /var/lib/rpm/__db.000

Important notes

  • Timezone files: If you need to use something different than Factory, then you should copy the timezone file you want from /opt/at4.0/share/zoneinfo to /opt/at4.0/etc/localtime
  • advance-toolchain-at4.0-runtime-compat-4.0-4: DO NOT INSTALL it on SLES10 and beyond or RHEL5 and beyond. These are intended for runtime compatibility on SLES9 and RHEL4 only (see below).

Installation on SLES9 and RHEL4 - Runtime compatibility

Users running applications on SLES9 or RHEL4 may install the compatibility rpm advance-toolchain-at4.0-runtime-compat-4.0-4 in order to get the Advance Toolchain optimized runtime libraries. Optimized libraries are available for:

  • PPC970
  • POWER4
  • POWER5
  • POWER5+

Installation of the cross-compiler (Intel x86)

You can download advance-toolchain-at4.0-cross-4.0-4 and install in a x86 machine to build Power binaries on it. Binaries generated by the cross-compiler will run on a Power system with the same version of the Advance Toolchain installed.


Usage

Manual Pages

In order for the system man application to pick up Advance Toolchain installed man pages, the user must export the location of the AT man pages in the MANPATH variable prior to invoking man. This is best accomplished with the following commands:

unset MANPATH
export MANPATH="/opt/at4.0/share/man:`manpath`"
man <topic>

Or the user may override the current environment MANPATH as demonstrated in the following example:

MANPATH="/opt/at4.0/share/man:`manpath`" man lsauxv

Optimization Selection

Directing GCC to build an application for a particular cpu can take advantage of processor specific instruction selection. In some cases it case significantly improve performance. Building without selecting a particular cpu simply causes GCC to select the default (lowest common denominator) instruction set.

-mcpu=power4
-mcpu=970
-mcpu=power5
-mcpu=power5+
-mcpu=power6
-mcpu=power6x
-mcpu=power7

Note: when using -mcpu=power7', DO NOT disable Altivec (i.e. -mno-altivec) without also disabling VSX (i.e. -mno-vsx). The following combination is illegal:

-mcpu=power7 -mno-altivec

Platform and Hardware Capabilities Determination

The Advance Toolchain includes libauxv and lsauxv, a system library and application, respectively, which provide a mechanism for querying the system platform information from the kernel's auxiliary vector. The system hardware capabilities (hwcap) may be queried through the auxiliary vector as well. For example, the platform can be queried dynamically with the following function:

char * platform = (char *) query_auxv (AT_PLATFORM);

Information from the hwcap can be queried in the following manner:

unsigned long int hwcap_mask = (unsigned long int) query_auxv (AT_HWCAP);
if (hwcap_mask & PPC_FEATURE_HAS_FPU)
printf(" HAS_FPU\n");

Further information on using libauxv and/or lsauxv can be found in the 'auxv' and 'lsauxv' manual pages provided by the Advance Toolchain (See 'Manual Pages' above).

Relinking a pre-built application with the Advance Toolchain

  1. Locate all of the application's .o files. You can also link .a files to pick them all up at once. These will be needed for the relink.
  2. Locate the paths to all of the necessary linked shared-object files, e.g.

    /usr/X11R6/lib for libXrender
    /opt/gnome/lib for libgtk-x11-2.0

  3. Edit /opt/at4.0/etc/ld.so.conf and add the directories to all of the shared object files to the end of this file. Don't forget 'lib64' for the 64-bit equivalent libraries if applicable, e.g.

    /opt/gnome/lib/
    /opt/gnome/lib64/
    /usr/X11R6/lib
    /usr/X11R6/lib64/

  4. Run the Advance Toolchain's ldconfig application to regenerate /opt/at4.0/etc/ld.so.cache, e.g.

    sudo /opt/at4.0/sbin/ldconfig

    The loader uses /opt/at4.0/etc/ld.so.cache to find the libraries the application was linked against.
  5. Re-link using the Advance Toolchain's compiler:

    /opt/at4.0/bin/gcc -g -O2 -o <application_name> <list_of_dot_o_files> \
    <list_of_dot_a_files> -L<path_to_libraries> \
    -l<one_for_each_library_needed_for_the_link>

    e.g.

    /opt/at4.0/bin/gcc -g -O2 -o mandelbrot callbacks.o interface.o \
    main.o quadmand.o support.o mandel_internals.a \
    -L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/opt/gnome/lib -lgtk-x11-2.0
    -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 \
    -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl \
    -lglib-2.0 -lfreetype -lfontconfig \
    -lXrender -lX11 -lXext -lpng12 -lz -lglitz -lm -lstdc++ -lpthread \
    -lgthread-2.0

  6. If ld gives an error like the following then you're missing the path to that library in the link stage. Add it with -L<path to library>, e.g.

    /opt/at4.0/bin/ld: cannot find -lgtk-x11-2.0

    Add -L/opt/gnome/lib/ to the gnome compilation line. You need to tell the linker where to find all of the libraries.
  7. When running the re-linked application if you get an error like the following:

    ./mandelbrot: error while loading shared libraries: libglib-2.0.so.0: cannot open shared object file: No such file or directory.

    You need to add the path to the library in question to /opt/at4.0/etc/ld.so.conf and rerun /opt/at4.0/sbin/ldconfig The Advance Toolchain's loader needs to know where to find the libraries and uses the generated /opt/at00/etc/ld.so.cache to find them.
  8. You can verify that the Advance Toolchain libraries were picked up by running the application prefaced with LD_DEBUG=libs, e.g.

    LD_DEBUG=all ./mandelbrot

WARNING: do NOT use LD_LIBRARY_PATH to point to the Advance Toolchain libraries if your applications are not relinked with the Advance Toolchain. Doing so can result in ld.so and libc.so version mismatch and cause runtime failures.

Library search paths

/opt/at4.0/etc/ld.so.conf already contains include /etc/ld.so.conf in the search order but may you may need to re-run /opt/at4.0/sbin/ldconfig in order populate /opt/at00/etc/ld.so.cache with the specialized search paths you've added to /etc/ld.so.conf.

Using the AT with Libhugetlbfs 2.0 (and later)

AT 4.0 and later now have support for 32-bit and 64-bit libhugetlbfs 2.0 (and later). Please refer to the Advance Toolchain's libhugetlbfs man page for more information on using libhugetlbfs 2.0:

unset MANPATH
export MANPATH="/opt/at4.0/share/man:`manpath`"
man libhugetlbfs

Using the AT with Libhugetlbfs 1.x

(Note: Libhugetlbfs 1.x is deprecated on SLES11 and RHEL6. Please use Libhugetlbfs 2.0. This information is preserved for compatibility with older applications.)

The Advance Toolchain will work with the default system libhugetlbfs 1.x link editor wrapper and linker scripts.

The /opt/at4.0/scripts/createldhuge.sh script is provided which copies /opt/at4.0/bin/ld to /opt/at00/bin/ld.orig and creates a wrapper script in /opt/at00/bin/ld. You only need to run this if you want the Advance Toolchain to work with libhugetlbfs.

The new /opt/at4.0/bin/ld is a wrapper script which detects whether the --hugetlbfs-link or --hugetlbsf-align switches have been passed to the linker. If so then it sets a script-local LD environment variable to /opt/at4.0at00/bin/ld.orig and invokes the system's ld.hugetlbfs, e.g.

LD="/opt/at4.0/bin/ld.orig" /usr/share/libhugetlbfs/ld.hugetlbfs *switches*

If it doesn't detect the hugetlbfs-link/hugetlbfs-align switch then it simply forwards the linker invocation to /opt/at4.0/bin/ld.orig directly.

If libhugetlbfs support is desired, the first thing to do is backup the original Advance Toolchain linker just-in-case there are problems and you need to restore it manually.

cp -p /opt/at4.0/bin/ld /opt/at4.0/bin/ld.backup

The scripts in /opt/at4.0/scripts/ will do the rest of the work for you:

createldhuge.sh
restoreld.sh

Invoke createldhuge.sh to create the wrapper ld:

sudo sh createldhuge.sh /usr/share/libhugetlbfs/ld.hugetlbfs /opt/at4.0

This MUST be executed as sudo (or root) for the ld wrapper script to be created properly.

When/If you want to restore the original Advance Toolchain linker, simply run:

sudo sh restoreld.sh.

The Advance Toolchain GCC always ignores the -B/usr/share/libhugetlbfs directive because it has been built to always invoke /opt/at4.0/bin/ld directly. You can use the GCC invocation you've always used, e.g.

/opt/at4.0/bin/gcc temp.c -v -o temp -B/usr/share/libhugetlbfs/ -Wl,--hugetlbfs-link=BDT

Note, if you invoke /opt/at4.0/bin/ld --hugetlbfs-link=BDT directly, you'll need to supply a -m* flag which is normally provided by GCC directly ('man ld' for supported emulations).

Using AT with XLC and XLF

When compiling binaries using XLC or XLF, the user must add the "-F path_to_cfg_file" option to the compiler command line. The Advance Toolchain provides a script that creates those files in /opt/at4.0/scripts. You need to run:

/opt/at4.0/scripts/at-create-ibmcmp-cfg.sh

Please notice the absolute path when calling the script. DO NOT call it using a relative path.

Debugging

GDB can be asked to output _Decimal[32|64|128] formatted floating point registers by default, using GDB's printf command.

When using 'objdump' to inspect POWER6 code, make sure to use the -Mpower6 flag:

objdump -d -Mpower6 your_file

The same applies to POWER7 code.


Advance Toolchain Limitations

  • Libdfp has some known limitations as indicated in the Libdfp README.user documentation.
  • Valgrind does not yet support applications built with gcc options "-mvsx" or "-mcpu=power7".
  • OProfile currently doesn't support profiling using JVMPI.
  • OProfile Java profiling restriction: To use OProfile for profiling Java VMs 1.5 or greater, users generally have two options available when invoking the JVM: -agentlib or -agentpath. However, when using the Advance Toolchain's OProfile, you must use

    -agentpath:/opt/at4.0/lib64/oprofile/libjvmti_oprofile.so

    for 64-bit JVMs, or

    agentpath:/opt/at4.0/lib/oprofile/libjvmti_oprofile.so

    for 32-bit JVMs.