AOCC

AOCC (AMD Optimizing C/C++ Compiler) compiler system is Article description::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.

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

Add LLVM AR, NM and RANLIB if needed:

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

package.env
Please see to see how  works.

Add LLVM AR, NM and RANLIB if needed:

If you don't wish to replace vanilla-clang via, AOCC can be used per-package with:

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.

External resources

 * Phoronix web presenting benchmarks between AOCC, clang and GCC
 * AOCC 2.3 vs clang 11 vs GCC10