advtool-faq

Advance Toolchain for Linux on Power FAQ

List of frequently asked questions (FAQ) that describes some common problems you might run into while you are using the Advance Toolchain for Linux on Power and how to fix them.

IBM Advance Toolchain for Linux on Power 16.0-5 is now available! Learn more

How do I find which package provides a specific feature

On RHEL-based systems you can run:

yum provides <feature>

On SLES you need to run the following command:

zypper what-provides <feature>
What does "undefined reference to sem_*" mean?

These kinds of errors usually appear when you are trying to link a multithreaded program without enabling multithreading support (that is, specify -pthread when you are calling the linker), for example:

/opt/at10.0/bin/gcc main.c -pthread
Why doesn't the Advance Toolchain find my library?

The loader keeps a cache of all libraries available in the library path (/opt/atX.X/etc/ld.so.conf). Every time a new library is installed in one of the directories of the library path or when the library path is changed, it is necessary to update this cache by running /opt/atX.X/sbin/ldconfig as root.

Why does my program fail with "No such file or directory"?

The symptom of this issue is: a program built with the Advance Toolchain fails to run with the error message:

bash: ./program: No such file or directory

This message is indicating the system was not able to run this program. Usually this error happens because the system wasn't able to find the correct major version of the Advance Toolchain. In other words, Bash didn't find the loader specified in the .interp section of the executable.

You can identify which Advance Toolchain version built this program by running:

ldd <program>

Then, look for /opt/atX.X/lib64/ld64.so.2. Ensure to install the latest update of the major version you identified.

Can I set RPATH/RUNPATH with the Advance Toolchain?

Yes. The Advance Toolchain uses the RPATH and RUNPATH tags to identify where its libraries are located, but it is possible to add new directories by using the linker parameter -rpath=dir.

By default, the Advance Toolchain prepends its own lib directory to the RPATH/RUNPATH. However, in case the user changes this behavior, the user must ensure the Advance Toolchain lib directory appears before a directory with another libc, for example, /usr/lib, /usr/lib64, /lib, or /lib64. This measure guarantees you don't mix parts of different glibc versions.

Can I mix parts of different glibc versions?

No. The GNU C Library is not designed to support mixing parts of different glibc versions, for example: use the loader provided by the Linux distribution and glibc libraries provided by the Advance Toolchain.

When these libraries are mixed up, the program usually aborts complaining about missing symbols in one of the libraries provided by glibc.

To avoid these issues, the user has to:

  • Ensure the Advance Toolchain lib directories appear before a directory with another libc in the library search path that is /usr/lib, /usr/lib64, /lib, or /lib64. Which includes LD_LIBRARY_PATH, RPATH/RUNPATH, and /opt/atX.X/etc/ld.so.conf.
  • Force to use the Advance Toolchain loader when forcing the preload of an Advance Toolchain library with a program compiled by using the system's toolchain, for example:
    LD_PRELOAD=/opt/atX.X/lib64/libtcmalloc.so /opt/atX.X/lib64/ld-X.XX.so /usr/bin/printenv PATH
    
How to verify whether the Advance Toolchain is corrupted?

The package manager provides:

  • On RPM-based systems (RHEL, SLES, Fedora):
    rpm --verify <list of packages>
    

    Replace <list of packages> by the list of Advance Toolchain packages installed in the system, for example:

    rpm --verify advance-toolchain-atX.X-runtime advance-toolchain-atX.X-devel advance-toolchain-atX.X-perf advance-toolchain-atX.X-mcore-libs
    

    If this command creates any output, some of the packages are corrupted. If it returns 0, the installation is fine.

  • On DEB-based systems (Ubuntu, Debian):
    debsums <list of packages>
    

    Replace <list of packages> by the list of Advance Toolchain packages installed in the system, for example:

    debsums advance-toolchain-atX.X-runtime advance-toolchain-atX.X-devel advance-toolchain-atX.X-perf advance-toolchain-atX.X-mcore-libs
    

    This command is going to print the status for each file. If it returns 2, there is at least one corrupted file. If it returns 0, the installation is fine.

    In case the previous commands report any issue, uninstall, and install the corrupted package again.

When to use Advance Toolchain?

The Advance Toolchain provides toolchain functionality earlier and a group of optimized libraries. AT is highly recommended when you want to build an optimized CPU-bound application on POWER or want some of the new toolchain functionalities on POWER before they make into a distribution. Also, you must use AT when you link with a library built with AT.

In some scenarios, you don't get many advantages by using the Advance Toolchain, and it is easier to use the distro's toolchain that usually performs well. Such cases include building applications that are not CPU-bound and on I/O constrained environments.

Are there any issues to be aware of?

Yes! The following is a list of Advance Toolchain limitations and known issues:

  • The cross-package upgrade from 9.0-4, 10.0-5, 11.0-1 or older versions to a newer release need to be forced.
  • The upgrade from 9.0-0 to a newer release need to be forced. The problem was fixed in 9.0-1 and does not affect that, nor newer releases.
  • oprofile's operf tool running on SLES 11: if you are running operf as the root user, only --system-wide or --pid modes are supported. This restriction is permanent.
  • gcc no longer has support for Graphite loop optimizations starting on Advance Toolchain 6.0-0.
  • libdfp has some known limitations as indicated in the libdfp README.user documentation.
Where can I get help?

Customer support for the Advance Toolchain is provided in one of the following ways:

  • If you are using the Advance Toolchain as directed by an IBM product team (that is IBM XL Compiler or PowerVM Lx86), report the suspected issues to the IBM Support giving that product name and entitlement.
  • IBM's Support Line for Linux Offerings now provides support for the Advance Toolchain as well. If you have a contract with a Support Line for Linux, place a call to IBM Support, for example for United States:
    1. Dial 1-800-426-IBM-SERV.
    2. Option #2 (Other business products or solutions).
    3. Option #2 (Software).
    4. Option #7 (Other OS/Linux).
    For other countries, click here.
  • All other users can use the Support forum. To ask questions about using the Advance Toolchain or to report a suspected defect, click here.
    1. Click in "Ask a question".
    2. Enter your question or problem.
    3. Add the "advancetoolchain" tag and click in "Post your question".
    4. An initial response is attempted within 2 business days.
  • Also, if you have a GitHub account you can open an issue in the Advance Toolchain repository.

The Advance Toolchain is supported on many Linux distributions.