Release Notes for the Advance Toolchain 4.0 Version 4.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.5.2-ibm-r171016 [C,C++ (g++), fortran]
    - GNU Binutils-2.21.51-20110311
    - GLIBC-2.12-ibm
    - LIBDFP 1.0.4-r13157
    - GDB-7.2 with Python scripting
  o 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
  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.

Apart from package versions listed above:

What's new in this release
  o Updated configuration scripts for XLC 10.1/11.1 and XLF 12.1/13.1.
  o Libauxv is now shipped.
  o Zlib is now shipped.
  o GCC includes the following fixes:
    * PowerPC64 PR47935 fix
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00017.html

    * Harden rs6000 offsettable_ok_by_alignment
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00044.html

    * build_function_call and TREE_ADDRESSABLE
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00132.html

    * Fix PowerPC64 non-delegitimized UNSPEC
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00192.html

    * Fix PR 45844, gfortran.dg/vect/pr45714-b.f ICE on power7
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00829.html

    * [patch] Enhance conditional store sinking
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00885.html

    * [PATCH] Re-fix PR target/47755 on powerpc VSX
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00440.html

    * [PATCH, committed] Refix 48053, do not abort in loading 0 into VSX register under 32-bit
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00774.html

    * [PATCH RFC] PR 47862: Fix caller-save spill of vectors on PowerPC
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00034.html

    * [PATCH] PR 47862: Fix caller-save vector spill on PowerPC
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00223.html

    * [PATCH][4.5] Fix backport of PR 47862 to 4.5 branch
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00862.html

    * [PATCH, rs6000] Fix PR48053, ICEs in SPEC benchmarks
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00653.html

    * RFA (layout): PATCH for c++/48029 (ICE-on-valid with templates and * arrays)
      http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00500.html

    * Fixes for the following FSF Bugs: 48053, 48067, 44707, 48032, 47755, 47862, 70276, 47935, 47755, 46030, 47525, 47385.

    * Fix for FSF Bug 47272:
      vec_ld and vec_store return to their original implementation to ONLY use Altivec memory load/store, and people targeting VSX should use vec_vsx_ld and vec_vsx_st

  o Binutils includes the following fixes:
    * Back ported patches:
      http://sourceware.org/ml/binutils/2011-02/msg00000.html

    * PowerPC64 -R linking klibc
      http://sourceware.org/ml/binutils/2011-03/msg00202.html

    * PowerPC64 toc edit segfault
      http://sourceware.org/ml/binutils/2011-02/msg00067.html
      http://sourceware.org/ml/binutils/2011-02/msg00082.html
      http://sourceware.org/ml/binutils/2011-02/msg00161.html

    * PR12519 ELF .size expressions
      http://sourceware.org/ml/binutils/2011-02/msg00311.html

    * Re: binutils > 2.21.51.0.2 fails to build glibc
      http://sourceware.org/ml/binutils/2011-01/msg00159.html

  o GLIBC includes the following fixes:

    * [PATCH] PowerPC: Fix POWER6 s_isnanf.S: END(__isnan) toEND(__isnanf) to match EALIGN(__isnanf,...)
      http://sourceware.org/ml/libc-alpha/2011-03/msg00030.html

    * [PATCH] #include <stdint.h> in tst-writev.c
      http://sourceware.org/ml/libc-alpha/2011-02/msg00131.html

    * [PATCH] PowerPC64 - Disable VSX usage in rtld.c to prevent TOC refbefore relocs are resolved.
      http://sourceware.org/ml/libc-alpha/2011-02/msg00083.html

    * Re: [PATCH] PowerPC64 - Fix INTERNAL_[V]SYSCALL_NCS macros to notcast return val to (int)
      http://sourceware.org/ml/libc-alpha/2011-02/msg00089.html

  o Libdfp includes the following fixes:

    * [libdfp-patches] [PATCH] Fix issue with printf_dfp and issues with asm ENTRY macro causing .size expression errors.
      http://www.eglibc.org/archives/libdfp-patches/msg00015.html

    * [libdfp-patches] Fix bug in sysdeps/dpd/dpd-private.c: dpd_to_char[0x3f4] where "974" should be "774".
      http://www.eglibc.org/archives/libdfp-patches/msg00013.html

    * [libdfp-patches] Fix regression where -fpic and -mcpu="foo" aren't passed to libdecnumber submake
      http://www.eglibc.org/archives/libdfp-patches/msg00012.html

  o Valgrind now supports the subset of POWER7 instructions that are used by the POWER7-tuned GLIBC libraries, 
    so applications that link to these libraries can now be run under Valgrind.

What's new in 4.0-0
  o Libhugetlbfs 2.9 is now shipped.
  o MPC 0.8.2 is now shipped.
  o PPL 0.11 is now shipped.
  o CLOOG-PPL 0.15.10 is now shipped.
  o LIBELF 0.8.12 is now shipped.
  o Python 2.6.6 is now shipped.
  o Large TOC with -mcmodel=medium and -mcmodel=medium -fPIE optimizations.
  o XL MASS library enablement for vectorizing math functions.
  o Graphite loop optimizations.
  o Link Time Optimizations.
  o GDB updated to 7.2, featuring Python scripting support.
  
What's new in 3.0-1
  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.
  o Bug fixes for Valgrind and vgi2qt tool.
  o The 64-bit Stack is now marked non-executable.
  
What's new in 3.0-0

  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":
      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 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-at4.0-runtime-4.0-1
    advance-toolchain-at4.0-devel-4.0-1
    advance-toolchain-at4.0-perf-4.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/at4.0/share/zoneinfo 
  to /opt/at4.0/etc/localtime.

Installation on SLES9 and RHEL4:

  Users running applications on SLES9 or RHEL4 may install the compatibility RPM
  advance-toolchain-at4.0-runtime-compat-4.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-at4.0-cross-4.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 Libdfp has some known limitations as indicated in the Libdfp README.user
  documentation.

  o Valgrind does not yet support applications built with gcc options "-mvsx" or "-mcpu=power7".

  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/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.

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/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/at4.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/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/at4.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/at4.0/scripts/createldhuge.sh script is provided which copies
  /opt/at4.0/bin/ld to /opt/at4.0/bin/ld.orig and creates a wrapper script
  in /opt/at4.0/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.0at4.0/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 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/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

  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/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 10.1 and XLF 12.1

  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 config files for 
  XLC 10.1/11.1 and XLF 12.1/13.1 in /opt/at4.0/scripts:
    o XLC 10.1: vac-10_1-AT4.0.cfg
    o XLC 11.1: vac-11_1-AT4.0.cfg
    o XLF 12.1: xlf-12_1-AT4_0.cfg
    o XLF 13.1: xlf-12_1-AT4_0.cfg