Clang LLVM for PPC. Clang unable to find PowerPC gcc toochain and binutils

Hi all

I am building Clang/LLVM for PowerPC processor. The cmake command i’m using is:

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/llvm6 -DCMAKE_CROSSCOMPILING=True -DLLVM_DEFAULT_TARGET_TRIPLE=powerpc-linux-gnu -DLLVM_TARGET_ARCH=PowerPC -DLLVM_TARGETS_TO_BUILD=PowerPC …/llvm-6.0.0.src

PowerPC gcc toolchain along with binutils are installed in /usr/powerpc-eabi directory.

My questions are:

  1. How to tell LLVM about gcc toolchain and binutils installation directory? Do we have to change/modify/add the path of gcc toolchain in llvm-6.0.0.src/tools/clang/lib/Driver directory files?
  2. LLVM is successfully built using above cmake. I’m not able to use --sysroot=/usr/powerpc-eabi. In fact it is ineffective.

Please help.

Rgs,
VSP

It would appear that the location of your build compiler is non-standard. I believe you should try with -DGCC_INSTALL_PREFIX=/usr/powerpc-eabi

Nemanja

Hi all

I am building Clang/LLVM for PowerPC processor. The cmake command i’m using is:

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/llvm6 -DCMAKE_CROSSCOMPILING=True -DLLVM_DEFAULT_TARGET_TRIPLE=powerpc-linux-gnu -DLLVM_TARGET_ARCH=PowerPC -DLLVM_TARGETS_TO_BUILD=PowerPC …/llvm-6.0.0.src

PowerPC gcc toolchain along with binutils are installed in /usr/powerpc-eabi directory.

My questions are:

  1. How to tell LLVM about gcc toolchain and binutils installation directory? Do we have to change/modify/add the path of gcc toolchain in llvm-6.0.0.src/tools/clang/lib/Driver directory files?

There’s an option --gcc-toolchain=.