Hi all,
I would like to know if my compilation method is correct. What is the official method for compiling the aarch64 version in LLVM?
I want to run clangd, clang-format, clang-tidy on an aarch64 architecture board, and I wanto compile the ‘aarch64 clang tools’ using a computer with x86_64 architecture. Just to confirm again, the architecture of the compiling machine is x86_64(host), and the target platform is aarch64(target).
I attempted the task with the following command:
git clone --depth 1 --branch llvmorg-16.0.6 https://github.com/llvm/llvm-project.git
mkdir -p llvm-project/tmp_build && cd llvm-project/tmp_build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc-8 \
-D CMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++-8 \
-D CMAKE_LINKER=/usr/bin/aarch64-linux-gnu-ld \
-D CMAKE_ASM_COMPILER=/usr/bin/aarch64-linux-gnu-as \
-D CMAKE_AR=/usr/bin/aarch64-linux-gnu-ar \
-D CMAKE_NM=/usr/bin/aarch64-linux-gnu-nm \
-D CMAKE_RANLIB=/usr/bin/aarch64-linux-gnu-ranlib \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_VERBOSE_MAKEFILE=ON \
-D LLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
../llvm
make -j7
Here is the error log:
cd /home/user/llvm-project/tmp_build/tools/clang/tools/extra/clang-tidy/misc && ../../../../../../bin/clang-tidy-confusable-chars-gen /home/user/llvm-project/clang-tools-extra/clang-tidy/misc/ConfusableTable/confusables.txt /home/user/llvm-project/tmp_build/tools/clang/tools/extra/clang-tidy/misc/Confusables.inc
/lib/ld-linux-aarch64.so.1: No such file or directory
It builds the ‘clang-tidy-confusable-chars-gen’ tools using an ARM64 compiler, but it will be used on a host x86_64 machine. I’m searching for the compile log.
/usr/bin/aarch64-linux-gnu-g++-8 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -Wl,-rpath-link,/home/user/llvm-project/tmp_build/./lib -Wl,--gc-sections CMakeFiles/clang-tidy-confusable-chars-gen.dir/BuildConfusableTable.cpp.o -o ../../../../../../../bin/clang-tidy-confusable-chars-gen -Wl,-rpath,"\$ORIGIN/../lib" ../../../../../../../lib/libLLVMSupport.a -lpthread -lrt -ldl -lpthread -lm ../../../../../../../lib/libLLVMDemangle.a