[libc-commits] [libc] 4cc6a08 - Update LLVMLibCArchitectures.cmake (#112464)
via libc-commits
libc-commits at lists.llvm.org
Tue Oct 15 20:22:48 PDT 2024
Author: westtide
Date: 2024-10-15T22:22:44-05:00
New Revision: 4cc6a08142129d351840c3c63d9372a2b66930b2
URL: https://github.com/llvm/llvm-project/commit/4cc6a08142129d351840c3c63d9372a2b66930b2
DIFF: https://github.com/llvm/llvm-project/commit/4cc6a08142129d351840c3c63d9372a2b66930b2.diff
LOG: Update LLVMLibCArchitectures.cmake (#112464)
Hi there,
When building llvm-libc on the openEuler system, I encountered an issue
as shown in the image below:
![image](https://github.com/user-attachments/assets/75667de4-5bea-4a95-be28-ed34db0e05b9)
This issue happens because the regular expression used in
`libc/cmake/modules/LLVMLibCArchitectures.cmake`: `string(REGEX MATCH
"Target: [-_a-z0-9.]+[ \r\n]+")` does not handle capital letters
properly in `openEuler`.
To fix this, I modified the regular expression to: `string(REGEX MATCH
"Target: [-_a-zA-Z0-9.]+[ \r\n]+")`. This change makes it compatible
with capital letters.
Added:
Modified:
libc/cmake/modules/LLVMLibCArchitectures.cmake
Removed:
################################################################################
diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 7711127c1a81e1..1e5ed723194a26 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -84,7 +84,7 @@ if(NOT (libc_compiler_info_result EQUAL "0"))
message(FATAL_ERROR "libc build: error querying compiler info from the "
"compiler: ${libc_compiler_info}")
endif()
-string(REGEX MATCH "Target: [-_a-z0-9.]+[ \r\n]+"
+string(REGEX MATCH "Target: [-_a-zA-Z0-9.]+[ \r\n]+"
libc_compiler_target_info ${libc_compiler_info})
if(NOT libc_compiler_target_info)
message(FATAL_ERROR "libc build: could not read compiler target info from:\n"
More information about the libc-commits
mailing list