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

via libc-commits libc-commits at lists.llvm.org
Fri Apr 17 05:42:29 PDT 2026


Author: Michael Jones
Date: 2026-04-17T13:42:22+01:00
New Revision: c74c4a8bf6f7663e1fc645e3bd43935791f33123

URL: https://github.com/llvm/llvm-project/commit/c74c4a8bf6f7663e1fc645e3bd43935791f33123
DIFF: https://github.com/llvm/llvm-project/commit/c74c4a8bf6f7663e1fc645e3bd43935791f33123.diff

LOG: [libc] Fix missing strings symbols in string.h (#192640)

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

Added: 
    libc/include/string.h.def

Modified: 
    libc/include/string.yaml

Removed: 
    


################################################################################
diff  --git a/libc/include/string.h.def b/libc/include/string.h.def
new file mode 100644
index 0000000000000..d70254193dafe
--- /dev/null
+++ b/libc/include/string.h.def
@@ -0,0 +1,21 @@
+//===-- C standard library header 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:


        


More information about the libc-commits mailing list