[libc-commits] [libc] [libc][CMake] fix CMake configure issues on openSUSE (PR #79751)

Sirui Mu via libc-commits libc-commits at lists.llvm.org
Sun Jan 28 06:13:56 PST 2024


https://github.com/Lancern created https://github.com/llvm/llvm-project/pull/79751

libc cannot be configured on openSUSE because openSUSE toolchain changes the triple format. This PR fixes this issue.

>From eb6772b25c20a0b8b0252fc2d58eff476c95ff1a Mon Sep 17 00:00:00 2001
From: Sirui Mu <msrlancern at gmail.com>
Date: Sun, 28 Jan 2024 21:39:01 +0800
Subject: [PATCH] [libc][CMake] fix CMake configure issues on openSUSE

---
 libc/cmake/modules/LLVMLibCArchitectures.cmake | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 10571101a34178..dbd3ea7293b243 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -171,6 +171,11 @@ elseif(LIBC_TARGET_OS STREQUAL "poky")
   # include the right directories during compilation.
   set(LIBC_TARGET_OS_IS_LINUX TRUE)
   set(LIBC_TARGET_OS "linux")
+elseif(LIBC_TARGET_OS STREQUAL "suse")
+  # openSUSE uses different triple format which causes LIBC_TARGET_OS to be
+  # computed as "suse" instead of "linux".
+  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