[libc-commits] [libc] [libc] Allow libc to build on Red Hat (PR	#83517)
    via libc-commits 
    libc-commits at lists.llvm.org
       
    Thu Feb 29 18:38:37 PST 2024
    
    
  
https://github.com/jameshu15869 updated https://github.com/llvm/llvm-project/pull/83517
>From 0f1b57990bbb86b4f65fb77f10e7cf74e5f0a659 Mon Sep 17 00:00:00 2001
From: James Hu <jhudson15869 at gmail.com>
Date: Thu, 29 Feb 2024 21:27:22 -0500
Subject: [PATCH 1/2] [libc] allow libc to build on redhat
---
 libc/cmake/modules/LLVMLibCArchitectures.cmake | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 0dbc59ad643ac4..66acf95058bcb3 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -167,13 +167,13 @@ 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" OR LIBC_TARGET_OS STREQUAL "suse")
-  # poky are ustom Linux-base systems created by yocto. Since these are Linux
+elseif(LIBC_TARGET_OS STREQUAL "poky" OR LIBC_TARGET_OS STREQUAL "suse" OR LIBC_TARGET_OS STREQUAL "redhat")
+  # poky are custom 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.
   #
-  # openSUSE uses different triple format which causes LIBC_TARGET_OS to be
-  # computed as "suse" instead of "linux".
+  # openSUSE and redhat use different triple format which causes LIBC_TARGET_OS
+  # to be computed as "suse" or "redhat" instead of "linux".
   set(LIBC_TARGET_OS_IS_LINUX TRUE)
   set(LIBC_TARGET_OS "linux")
 elseif(LIBC_TARGET_OS STREQUAL "darwin")
>From 8ed9d5568889637f6137fe43d4cc4028a7f81f69 Mon Sep 17 00:00:00 2001
From: jameshu15869 <55058507+jameshu15869 at users.noreply.github.com>
Date: Thu, 29 Feb 2024 21:38:32 -0500
Subject: [PATCH 2/2] Update libc/cmake/modules/LLVMLibCArchitectures.cmake
Co-authored-by: Joseph Huber <huberjn at outlook.com>
---
 libc/cmake/modules/LLVMLibCArchitectures.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 66acf95058bcb3..dacb4db75d3374 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -167,7 +167,8 @@ 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" OR LIBC_TARGET_OS STREQUAL "suse" OR LIBC_TARGET_OS STREQUAL "redhat")
+elseif(LIBC_TARGET_OS STREQUAL "poky" OR LIBC_TARGET_OS STREQUAL "suse" OR
+       LIBC_TARGET_OS STREQUAL "redhat")
   # poky are custom 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.
    
    
More information about the libc-commits
mailing list