Skip to content

Commit 39c24c5

Browse files
[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 <[email protected]>
1 parent 5b6e58c commit 39c24c5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libc/cmake/modules/LLVMLibCArchitectures.cmake

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,14 @@ if(LIBC_TARGET_OS STREQUAL "baremetal")
167167
set(LIBC_TARGET_OS_IS_BAREMETAL TRUE)
168168
elseif(LIBC_TARGET_OS STREQUAL "linux")
169169
set(LIBC_TARGET_OS_IS_LINUX TRUE)
170-
elseif(LIBC_TARGET_OS STREQUAL "poky" OR LIBC_TARGET_OS STREQUAL "suse")
171-
# poky are ustom Linux-base systems created by yocto. Since these are Linux
170+
elseif(LIBC_TARGET_OS STREQUAL "poky" OR LIBC_TARGET_OS STREQUAL "suse" OR
171+
LIBC_TARGET_OS STREQUAL "redhat")
172+
# poky are custom Linux-base systems created by yocto. Since these are Linux
172173
# images, we change the LIBC_TARGET_OS to linux. This define is used to
173174
# include the right directories during compilation.
174175
#
175-
# openSUSE uses different triple format which causes LIBC_TARGET_OS to be
176-
# computed as "suse" instead of "linux".
176+
# openSUSE and redhat use different triple format which causes LIBC_TARGET_OS
177+
# to be computed as "suse" or "redhat" instead of "linux".
177178
set(LIBC_TARGET_OS_IS_LINUX TRUE)
178179
set(LIBC_TARGET_OS "linux")
179180
elseif(LIBC_TARGET_OS STREQUAL "darwin")

0 commit comments

Comments
 (0)