Requesting for help.

Hello All,

I need some help with respect to cross compiling for ARM.

While trying to cross compile for the ARM target, I am hitting some errors. I need some help in this.

I use the following command to cross compile for ARM Cortex A72 (ARM v8-a), 64 bit architecture:

cmake -v CC=‘clang’ CXX=‘clang++’ -DCMAKE_C_COMPILER=…/build_directory_llvm/bin/clang -DCMAKE_CXX_COMPILER=…/build_directory_llvm/bin/clang++ -DLLVM_TABLEGEN=…/build_llvm_directory/bin/llvm-tblgen -DCLANG_TABLEGEN=…/build_llvm_directory/bin/clang-tblgen -DCROSSCOMPILING=True -DCMAKE_INSTALL_PREFIX=…/tmp_two -DLLVM_DEFAULT_TARGET_TRIPLE=aarch64-linux-gnu -DLLVM_TARGET_ARCH=AARCH64 -DLLVM_TARGETS_TO_BUILD=ARM -DCMAKE_CXX_FLAGS=’-target aarch64-linux-gnu --sysroot=…/myOwnToolChainTwo/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/aarch64-linux-gnu/libc --gcc-toolchain=…/myOwnToolChainTwo/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/ -mcpu=cortex-a72’ -DLLVM_ENABLE_LIBCXX=ON -DLLVM_ENABLE_PIC=False …/llvm/

I hit the error stating that “error: unable to create target: 'No available targets are compatible with this triple.’”

I am using ARMv8-a as my target which is 64 bit. Can you please let me know whether the target triple I am using is correct? Can you also please let me know whether I am using the right -mcpu option?

Thanks,
Sumedh

You say you want to compile for 64 bit ARM (and most of your settings show that) but you have “-DLLVM_TARGETS_TO_BUILD=ARM”.

32 bit ARM and 64 bit ARM are different and unrelated architectures.

Try

-DLLVM_TARGETS_TO_BUILD=AArch64

Thanks Bruce, what about the target and DLLVM_DEFAULT_TARGET_TRIPLE options? Should it be aarch64-linux-gnu?

Thanks,
Sumedh