[llvm] [libc][bazel] Set LIBC_ERRNO_MODE_SYSTEM_INLINE by default. (PR #152946)

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 10 17:22:26 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Alexey Samsonov (vonosmas)

<details>
<summary>Changes</summary>

Bazel only supports overlay build currently, so there's always system libc (and system errno_ present. Use the new
LIBC_ERRNO_MODE_SYSTEM_INLINE by default, instead of using thread-local one in the unit tests and system errno for "public packaging" (i.e. prod build). This way, we can ensure that we're testing the same configuration as the one that will be used in production.

This is the second attempt to do that after f9146cc was reverted in 279e82f. Since then, many tests have been migrated to ErrnoCheckingTest so the change should be safe even for those downstream customers that clobber system errno value before unit tests are being called.

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


1 Files Affected:

- (modified) utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl (+3) 


``````````diff
diff --git a/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl b/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl
index b49e7c3fad954..179fc83e67298 100644
--- a/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl
+++ b/utils/bazel/llvm-project-overlay/libc/libc_configure_options.bzl
@@ -49,4 +49,7 @@ LIBC_CONFIGURE_OPTIONS = [
 
     # Documentation in libc/docs/configure.rst
     "LIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM",
+
+    # Documentation in libc/src/__support/libc_errno.h
+    "LIBC_ERRNO_MODE=LIBC_ERRNO_MODE_SYSTEM_INLINE",
 ]

``````````

</details>


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


More information about the llvm-commits mailing list