[libc-commits] [libc] 39c24c5 - [libc] Allow libc to build on Red Hat (#83517)

via libc-commits libc-commits at lists.llvm.org
Thu Feb 29 19:04:06 PST 2024


Author: jameshu15869
Date: 2024-02-29T21:04:02-06:00
New Revision: 39c24c52f641849a648e3b01310ed7c3f2c8d91b

URL: https://github.com/llvm/llvm-project/commit/39c24c52f641849a648e3b01310ed7c3f2c8d91b
DIFF: https://github.com/llvm/llvm-project/commit/39c24c52f641849a648e3b01310ed7c3f2c8d91b.diff

LOG: [libc] Allow libc to build on Red Hat (#83517)

Currently, `libc` fails when building on redhat because the triple
format uses `redhat` instead of `linux` (The same problem as openSUSE).
This PR changes `libc` to accept `redhat` as a valid Linux triple.

---------

Co-authored-by: Joseph Huber <huberjn at outlook.com>

Added: 
    

Modified: 
    libc/cmake/modules/LLVMLibCArchitectures.cmake

Removed: 
    


################################################################################
diff  --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 0dbc59ad643ac4..dacb4db75d3374 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -167,13 +167,14 @@ 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 
diff erent triple format which causes LIBC_TARGET_OS to be
-  # computed as "suse" instead of "linux".
+  # openSUSE and redhat use 
diff erent 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")


        


More information about the libc-commits mailing list