Skip to content

Commit

Permalink
[libc] Allow libc to build on Red Hat (#83517)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jameshu15869 and jhuber6 authored Mar 1, 2024
1 parent 5b6e58c commit 39c24c5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libc/cmake/modules/LLVMLibCArchitectures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 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")
Expand Down

0 comments on commit 39c24c5

Please sign in to comment.