[libc] Add support for standalone cross compilation of libc.
authorSiva Chandra Reddy <sivachandra@google.com>
Sat, 17 Dec 2022 00:04:23 +0000 (00:04 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Tue, 20 Dec 2022 00:33:35 +0000 (00:33 +0000)
commit4f9c10eb48a3725ecfd844d44ccf3068fbadbb85
tree390b3d16b65324839ee10a57a32174c6d8acb33a
parentee3d9ee49c2ea08ea40b95d2e6159a027740c1aa
[libc] Add support for standalone cross compilation of libc.

One should be able to do a cross build of the libc now. For example, using
clang on a x86_64 linux host, one can build for an aarch64 linux target by
specifying -DLIBC_TARGET_TRIPLE=aarch64-linux-gnu.

Follow up changes will add a baremetal config and also appropriate
documentation about cross compiling the libc for CPU targets.

Reviewed By: jhuber6

Differential Revision: https://reviews.llvm.org/D140351
libc/CMakeLists.txt
libc/cmake/modules/LLVMLibCArchitectures.cmake
libc/cmake/modules/prepare_libc_gpu_build.cmake
libc/docs/gpu_mode.rst