[libc-commits] [libc] [libc] Fix missing strings symbols in string.h (PR #192640)

via libc-commits libc-commits at lists.llvm.org
Fri Apr 17 04:49:21 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Michael Jones (michaelrj-google)

<details>
<summary>Changes</summary>

The glibc string.h includes strings.h if it's in the default mode. Added
to allow more programs to be built.


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


2 Files Affected:

- (added) libc/include/string.h.def (+21) 
- (modified) libc/include/string.yaml (+1) 


``````````diff
diff --git a/libc/include/string.h.def b/libc/include/string.h.def
new file mode 100644
index 0000000000000..3c6a9ac90dee1
--- /dev/null
+++ b/libc/include/string.h.def
@@ -0,0 +1,21 @@
+//===-- stdc header string.h ----------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_STRING_H
+#define LLVM_LIBC_STRING_H
+
+#include "__llvm-libc-common.h"
+
+// TODO: Needed for compatibility with glibc which provides these symbols by
+// default. Would be better in the yaml file but there's no way to represent
+// including another header in yaml right now.
+#include <strings.h>
+
+%%public_api()
+
+#endif // LLVM_LIBC_STRING_H
diff --git a/libc/include/string.yaml b/libc/include/string.yaml
index 7711b0d148a98..c0a96e58dbc94 100644
--- a/libc/include/string.yaml
+++ b/libc/include/string.yaml
@@ -1,4 +1,5 @@
 header: string.h
+header_template: string.h.def
 standards:
   - stdc
 macros:

``````````

</details>


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


More information about the libc-commits mailing list