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

via libc-commits libc-commits at lists.llvm.org
Sun Jan 28 06:14:25 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Sirui Mu (Lancern)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/79751.diff


1 Files Affected:

- (modified) libc/cmake/modules/LLVMLibCArchitectures.cmake (+5) 


``````````diff
diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 10571101a341785..dbd3ea7293b2437 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")

``````````

</details>


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


More information about the libc-commits mailing list