[libc] Normalize LIBC_TARGET_MACHINE
authorGuillaume Chatelet <gchatelet@google.com>
Wed, 5 May 2021 15:52:42 +0000 (15:52 +0000)
committerGuillaume Chatelet <gchatelet@google.com>
Wed, 5 May 2021 15:52:42 +0000 (15:52 +0000)
commit7c2ece523d7ff74f3eeabce1b9685f3eaae8cff4
treeb4bc5dc399344b7a4e7d1583a96afc903c3f72ee
parentefc31be7f8e8487c774dd9052980b67f0d5e70e2
[libc] Normalize LIBC_TARGET_MACHINE

Current implementation defines LIBC_TARGET_MACHINE with the use of CMAKE_SYSTEM_PROCESSOR.
Unfortunately CMAKE_SYSTEM_PROCESSOR is OS dependent and can produce different results.
An evidence of this is the various matchers used to detect whether the architecture is x86.

This patch normalizes LIBC_TARGET_MACHINE and renames it LIBC_TARGET_ARCHITECTURE.
I've added many architectures but we may want to limit ourselves to x86 and ARM.

Differential Revision: https://reviews.llvm.org/D101524
17 files changed:
libc/CMakeLists.txt
libc/cmake/modules/LLVMLibCArchitectures.cmake [new file with mode: 0644]
libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake
libc/config/linux/CMakeLists.txt
libc/loader/linux/CMakeLists.txt
libc/src/math/CMakeLists.txt
libc/src/string/CMakeLists.txt
libc/src/string/aarch64/CMakeLists.txt
libc/src/string/x86/CMakeLists.txt [deleted file]
libc/src/string/x86_64/CMakeLists.txt [new file with mode: 0644]
libc/src/string/x86_64/memcpy.cpp [moved from libc/src/string/x86/memcpy.cpp with 100% similarity]
libc/src/threads/linux/CMakeLists.txt
libc/test/config/linux/CMakeLists.txt
libc/test/loader/linux/CMakeLists.txt
libc/test/src/math/CMakeLists.txt
libc/test/utils/FPUtil/CMakeLists.txt
libc/utils/FPUtil/CMakeLists.txt