[libc-commits] [libc] [llvm] [libc] Clean up libc_errno implementation, dependencies, and add __errno_location alias (PR #235421)

Pavel Labath via libc-commits libc-commits at lists.llvm.org
Mon Oct 26 00:29:15 PDT 2026


================
@@ -36,6 +36,7 @@
 __BEGIN_C_DECLS
 
 int *__llvm_libc_errno(void) __NOEXCEPT;
+int *__errno_location(void) __NOEXCEPT;
----------------
labath wrote:

This will always provide a declaration for the __errno_location symbol, but function itself will only be available in the config option is enabled -- which doesn't sound optimal.

It might be better to implement __errno_location as a regular entry point (that just happens to be implemented as an alias to __llvm_libc_errno), and let the regular entry point machinery decide when it should be emitted in the header.

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


More information about the libc-commits mailing list