However it still warns me that Atleast one of the variables CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH must be set for ARMClang.
I traced the message in /usr/local/share/cmake-3.18/Modules/Compiler/ARMClang.cmake:104, and print the CMAKE_SYSTEM_PROCESSOR and CMAKE_SYSTEM_ARCH in this file. It comes the result:
-- The C compiler identification is ARMClang 6.16.1
============================================
CMAKE_SYSTEM_PROCESSOR is x86_64
CMAKE_SYSTEM_ARCHITECTURE is armv8-m.main
============================================
-- Check for working C compiler: /home/sjl/software/ARMCLANG/bin/armclang
============================================
CMAKE_SYSTEM_PROCESSOR is x86_64
CMAKE_SYSTEM_ARCHITECTURE is
============================================
CMake Error at /usr/local/share/cmake-3.18/Modules/Compiler/ARMClang.cmake:104 (message):
Atleast one of the variables CMAKE_SYSTEM_PROCESSOR or CMAKE_SYSTEM_ARCH
must be set for ARMClang
My question is why the CMAKE_SYSTEM_PROCESSOR and CMAKE_SYSTEM_ARCHITECTURE are not my expected value?
With the toolchain file, cmake configuration passed, but make process failed, the CMAKE_SYSTEM_PROCESSOR is still X86_64:
-- The C compiler identification is ARMClang 6.16.1
============================================
CMAKE_SYSTEM_PROCESSOR is x86_64
CMAKE_SYSTEM_ARCHITECTURE is armv8-m.main
============================================
-- Detecting C compiler ABI info
============================================
CMAKE_SYSTEM_PROCESSOR is x86_64
CMAKE_SYSTEM_ARCHITECTURE is armv8-m.main
============================================
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/sjl/software/ARMCLANG/bin/armclang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python3: /usr/bin/python3.8 (found version "3.8.10") found components: Interpreter
-- Looking for pthread.h
============================================
CMAKE_SYSTEM_PROCESSOR is x86_64
CMAKE_SYSTEM_ARCHITECTURE is armv8-m.main
============================================
-- Looking for pthread.h - not found
-- Could NOT find Threads (missing: Threads_FOUND)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sjl/work/tf-m/1.4.0/mbedtls/build