[libc-commits] [libc] [libc] Fix missing default value for errno config (PR #100175)

via libc-commits libc-commits at lists.llvm.org
Tue Jul 23 11:21:12 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

<details>
<summary>Changes</summary>

Summary:
The configs all need default values which targets then override. This
one was an empty string which made the logic report an error. The only
reason it wasn't a build failure was because of a stray `:`.


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


2 Files Affected:

- (modified) libc/cmake/modules/LibcConfig.cmake (+1-1) 
- (modified) libc/config/config.json (+1-1) 


``````````diff
diff --git a/libc/cmake/modules/LibcConfig.cmake b/libc/cmake/modules/LibcConfig.cmake
index 7a3e6066b3cc0..da166dd6cc3fc 100644
--- a/libc/cmake/modules/LibcConfig.cmake
+++ b/libc/cmake/modules/LibcConfig.cmake
@@ -113,7 +113,7 @@ function(load_libc_config config_file)
       message(FATAL_ERROR ${json_error})
     endif()
     if(NOT DEFINED ${opt_name})
-      message(FATAL_ERROR: " Option ${opt_name} defined in ${config_file} is invalid.")
+      message(FATAL_ERROR " Option ${opt_name} defined in ${config_file} is invalid.")
     endif()
     if(ARGN)
       list(FIND ARGN ${opt_name} optname_exists)
diff --git a/libc/config/config.json b/libc/config/config.json
index 2005f4297bfc1..f134a0f41cf56 100644
--- a/libc/config/config.json
+++ b/libc/config/config.json
@@ -1,7 +1,7 @@
 {
   "errno": {
     "LIBC_CONF_ERRNO_MODE": {
-      "value": "",
+      "value": "LIBC_ERRNO_MODE_THREAD_LOCAL",
       "doc": "The implementation used for errno, acceptable values are LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM."
     }
   },

``````````

</details>


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


More information about the libc-commits mailing list