AOCC

= AMD Optimizing C/C++ Compiler =

The AOCC compiler system is a high performance, production quality code generation tool. The AOCC environment provides various options to developers when building and optimizing C, C++, and Fortran applications targeting 32-bit and 64-bit Linux® platforms. The AOCC compiler system offers a high level of advanced optimizations, multi-threading and processor support that includes global optimization, vectorization, inter-procedural analyses, loop transformations, and code generation. AMD also provides highly optimized libraries, which extract the optimal performance from each x86 processor core when utilized. The AOCC Compiler Suite simplifies and accelerates development and tuning for x86 applications.

See Phoronix pages for benchmarks between AOCC, clang and GCC. Here's AOCC-2.3 vs. clang-11 vs. GCC-10.

Installation
First download the latest version from AOCC's homepage. Read the EULA carefully before accepting it. Choose a location to run it from,

Optional: Make a symlink for future upgrades:

Unarchived media has a script to check for all prerequisities:

Usage
You should try to match the symlinks of aocc to clang's.

With "AOCC_PATH" in make.conf / package.env
Please see to see how package.env works.

Add llvm AR, NM and RANLIB if needed:

Via /etc/env.d
Test that it works:

package.env
Please see to see how package.env works.

Add llvm AR, NM and RANLIB if needed:

make.conf
AOCC can be used globally by defining it in

Please see Clang

Switching to aocc
Please read the : part above. Continue from there, without choosing method of usage first.

Add following USE flags to your

Compile llvm/clang toolchain with your (working) system default compiler first,

After it's done, switch to aocc:

And add known packages to workaround-list:

Rebuild clang.

Check that your config works:

Rebuild your system.

Please see the original forum post for where these steps came from.

"/opt/aocc/bin/clang: file not found!"
For some reason the symlink was wiped few times during. It seems to be related to packages calling  during their emerge. There are a couple core packages doing so. Beware of this, and avoid using --keep-going.

"error while loading shared libraries: libLLVM-11.so"
If you get an error saying clang: error while loading shared libraries: libLLVM-11.so: cannot open shared object file: No such file or directory you most likely attempted to symlink or override all system llvm settings. Don't do that.

multilib system, "multilib-strict check failed!"
It seems like aocc doesn't work very well on a multilib system, might be due to missing i686 compatible compiler. Workarounds for using system-clang might be needed.