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

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Tue Jul 23 11:20:34 PDT 2024


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

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 `:`.


>From e41232567203570a396ed32123d705413d257023 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Tue, 23 Jul 2024 13:19:01 -0500
Subject: [PATCH] [libc] Fix missing default value for errno config

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 `:`.
---
 libc/cmake/modules/LibcConfig.cmake | 2 +-
 libc/config/config.json             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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."
     }
   },



More information about the libc-commits mailing list