ARM-software / LLVM-embedded-toolchain-for-Arm

A project dedicated to building LLVM toolchain for 32-bit Arm embedded targets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building from source / elaboration

FabKlein opened this issue · comments

Hello,

I had an issue running the prebuild linux toolchain on RedHat7 because of glibc and other libraries mismatch, so had to build it from the source.

Running the build command mentioned in building-from-source.md

cmake .. -GNinja -DFETCHCONTENT_QUIET=OFF
did not succeed as is, because build system is picking an outdated default host compiler, so it is required to add an explicit path to a valid one.

-DCMAKE_C_COMPILER=/path/tovalidcompiler
-DCMAKE_CXX_COMPILER=/path/tovalidcompiler

It seems that it's also necessary to set LLVMEmbeddedToolchainForArm_COMMIT to avoid following issue with git command

CMake Error at llvm16/LLVM-embedded-toolchain-for-Arm-release-16.0.0/cmake/generate_version_txt.cmake:1 (execute_process):
  execute_process failed command indexes:
 
    1: "Child return code: 128"

Can you please kindly elaborate a little more on the different options to ensure a smooth build from source process ?
Thanks in advance

Hi, unfortunately building from the "Source code (tar.gz)" package shown on the releases page doesn't work (GitHub doesn't give an option not to create those). A Git checkout of this repo should be used instead. This will be fixed in the LLVM 17 release (see #242).

Other than that, please refer to the prerequisites list on the page you linked. Yes, I wouldn't expect the default RedHat7 toolchain to meet those requirements. If you want to work around that by specifying additional CMake parameters then that seems reasonable, but you're skiing off-piste there.

Thanks
Good to know this git issue will be fixed
Looks than other than adding explicit host toolchain path meeting listed prerequisites, with -DCMAKE_C_COMPILE/DCMAKE_CXX_COMPILER, everything else is fine to get a successful build