[libc-commits] [libc] 860d38b - [libc] Support poky system

Mikhail R. Gadelha via libc-commits libc-commits at lists.llvm.org
Wed Aug 9 06:42:40 PDT 2023


Author: Mikhail R. Gadelha
Date: 2023-08-09T10:40:19-03:00
New Revision: 860d38bf57470de2b94ffec1cfe2c7d7e65fbbdc

URL: https://github.com/llvm/llvm-project/commit/860d38bf57470de2b94ffec1cfe2c7d7e65fbbdc
DIFF: https://github.com/llvm/llvm-project/commit/860d38bf57470de2b94ffec1cfe2c7d7e65fbbdc.diff

LOG: [libc] Support poky system

This patch adds support for yocto images, which are custom Linux-base
systems created by yocto.

$CMAKE_HOST_SYSTEM_NAME returns "poky" as the system name, but it is a
linux image, so we just replace the name with "linux", so libc can use
the correct path.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D157404

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCArchitectures.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 1e53e1a2b60bf8..89b5f2d38fb36a 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -163,6 +163,12 @@ if(LIBC_TARGET_OS STREQUAL "baremetal")
   set(LIBC_TARGET_OS_IS_BAREMETAL TRUE)
 elseif(LIBC_TARGET_OS STREQUAL "linux")
   set(LIBC_TARGET_OS_IS_LINUX TRUE)
+elseif(LIBC_TARGET_OS STREQUAL "poky")
+  # poky are ustom Linux-base systems created by yocto. Since these are Linux
+  # images, we change the LIBC_TARGET_OS to linux. This define is used to
+  # include the right directories during compilation.
+  set(LIBC_TARGET_OS_IS_LINUX TRUE)
+  set(LIBC_TARGET_OS "linux")
 elseif(LIBC_TARGET_OS STREQUAL "darwin")
   set(LIBC_TARGET_OS_IS_DARWIN TRUE)
 elseif(LIBC_TARGET_OS STREQUAL "windows")


        


More information about the libc-commits mailing list