Release Notes for the Advance Toolchain 3.0 Version 3.0-1

Features:

  o The Advance Toolchain is a self contained toolchain which isn't
    reliant on the base system toolchain.
  o Decimal Floating Point support in the following packages:
    - GCC-4.4.4-ibm-r162934 [C,C++ (g++), fortran]
    - GNU Binutils-2.20.51-20100805
    - GLIBC-2.11-ibm
    - LIBDFP 1.0.3
    - GDB-7.1
    - GMP-4.2.4
  o Releases of the following packages in support of the Advance Toolchain:
    - Valgrind-3.4.1
    - OProfile-0.9.6 with Java (1.5 or later) support
    - MPFR-2.4.1
  o Power6 enablement.
  o Power6 Optimized scheduler.
  o Power6 Native DFP instruction support.
  o Power6 VMX enablement with auto-vector.
  o Power7 enablement.
  o Power7 Optimized scheduler.
  o Power7 Native DFP instruction support.
  o Power7 VMX/VSX enablement with auto-vector.
  o ppc970,POWER4,POWER5,POWER5+,POWER6, POWER6x and POWER7 optimized system libraries.
  o Libhugetlbfs 1.0 support ONLY (2.0 is currently not supported).
  
Apart from package versions listed above:

What's new from 3.0-0
  o Cross-compiler available for x86 32-bit as a separate download.
  o Compatibility runtime RPM for older Linux distributions (SLES9 and RHEL4).
  o Large TOC fixes for GCC and Binutils.
  o Valgrind-itrace now supports dynamically linked 32-bit and 64-bit
  executables, as well as statically linked executables.  Limitation:  To
  trace a 32-bit dynamic executable, it must be compiled with the Advance
  Toolchain's gcc.
  o Bug fixes for Valgrind and vgi2qt tool.
  o The 64-bit Stack is now marked non-executable.

  
What's new from 2.1-1

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

Documentation for each component can be found at:

  o GCC: http://gcc.gnu.org/onlinedocs/gcc-4.4.4/gcc/
  o Binutils: http://sourceware.org/binutils/docs/
  o GLIBC: http://www.gnu.org/software/libc/manual/html_node/index.html
  o LIBDFP: http://www.eglibc.org/cgi-bin/viewcvs.cgi/*checkout*/libdfp/trunk/README.user?rev=11222
  o GDB: http://sourceware.org/gdb/current/onlinedocs/gdb/
  o GMP: http://gmplib.org/manual/
  o MPFR: http://www.mpfr.org/mpfr-current/mpfr.html
  o Valgrind: http://valgrind.org/docs/manual/manual.html
  o OProfile: http://oprofile.sourceforge.net/doc/

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:
    o 1-800-426-IBM-SERV
    o Option #2 (Other business products or solutions)
    o Option #2 (Software)
    o 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, go to:
  http://www-128.ibm.com/developerworks/forums/forum.jspa?forumID=1518 
    o Open the Advance Toolchain topic.
    o Select 'Post a New Reply'
    o Enter and submit your question or problem
    o 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 zlib, ncurses and python packages (64-bit)
  before installing the Advance Toolchain.

  YaST:
    To install execute 'yast' as root and select 'Add-on Product'.

    Select the FTP Protocol:
      (x) FTP...
    Under "Server Name":
      linuxpatch.ncsa.uiuc.edu
    Under "Directory on Server":
      
      /toolchain/at/at3.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 and devel versions for installation as necessary and
    click [Accept].  
  

  Note: If you're installing the rpms by hand you will need to install the
  rpms in the following order due to prerequisites:

    advance-toolchain-at3.0-runtime-3.0-1
    advance-toolchain-at3.0-devel-3.0-1
    advance-toolchain-at3.0-perf-3.0-1

  A batch install should install them in the correct order, i.e.

    rpm -i advance-toolchain*

  Note on timezone files: If you need to use something different than Factory,
  then you should copy the timezone file you want from /opt/at3.0/share/zoneinfo 
  to /opt/at3.0/etc/localtime.

Installation on SLES9 and RHEL4:

  Users running applications on SLES9 or RHEL4 may install the compatibility RPM
  advance-toolchain-at3.0-runtime-compat-3.0-1 in order to get the Advance Toolchain
  optimized runtime libraries. Optimized libraries are available for ppc970, POWER4,
  POWER5 and POWER5+.

Installation of the cross-compiler:

  You can download advance-toolchain-at3.0-cross-3.0-1 and install in a x86 machine to 
  start using it. Binaries generated by the cross-compiler will run on a Power system
  with the Advance Toolchain installed.

Advance Toolchain Limitations

  o If you need a 'cc' symbolic link to the GCC binary, you need to create it
  in /opt/at3.0/bin.

  o Libdfp has some known limitations as indicated in the Libdfp README.user
  documentation.

  o Valgrind currently doesn't support POWER7-specific instructions.

  o OProfile currently doesn't support profiling using JVMPI.

  o 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/at3.0/lib64/oprofile/libjvmti_oprofile.so" for 64-bit
  JVMs or "agentpath:/opt/at3.0/lib/oprofile/libjvmti_oprofile.so" for
  32-bit JVMs.

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 combination:

  -mcpu=power7 -mno-altivec

  is illegal.

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 (e.g. objdump -d -Mpower6 your_file). The same applies to POWER7 codes
  (e.g. objdump -d -Mpower7 your_file).

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/at3.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/at3.0/etc/ld.so.cache, e.g.

    sudo /opt/at3.0/sbin/ldconfig

  The loader uses /opt/at3.0/etc/ld.so.cache to find the libraries the
  application was linked against.

  5.) Re-link using the Advance Toolchain's compiler:

    /opt/at3.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/at3.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/at3.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/at3.0/etc/ld.so.conf and rerun /opt/at3.0/sbin/ldconfig. The Advance
  Toolchain's loader needs to know where to find the libraries and uses the
  generated /opt/at3.0/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 aren't 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/at3.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/at3.0/sbin/ldconfig in order
  populate /opt/at3.0/etc/ld.so.cache with the specialized search paths you've
  added to /etc/ld.so.conf.

Using the AT with Libhugetlbfs

  The Advance Toolchain will work with the default system libhugetlbfs linker
  wrapper and linker scripts.

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

  The new /opt/at3.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/at3.0at3.0/bin/ld.orig
  and invokes the system's ld.hugetlbfs, e.g.

    LD="/opt/at3.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/at3.0/bin/ld.orig directly.

  If hugetlbfs 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/at3.0/bin/ld /opt/at3.0/bin/ld.backup

  The scripts in /opt/at3.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/at3.0

  NOTE: 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/at3.0/bin/ld
  directly.  You can use the GCC invocation you've always used, e.g.

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

  Note, if you invoke /opt/at3.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 10.1 and XLF 12.1

  When compiling binaries using XLC 10.1 or XLF 12.1, the user must add the
  "-F path-to-cfg-file" option to the compiler command line. The Advance Toolchain
  provides config files for XLC 10.1 and XLF 12.1 in /opt/at3.0/scripts. For XLC, use
  "vac-AT3.0.cfg", and for XLF, "xlf-AT3.0.cfg".