[libc-commits] [libc] [libc] Add 'strings.h' header on the GPU (PR #109661)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Mon Sep 23 06:25:09 PDT 2024


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

Summary:
These are GNU extensions but still show up, the entrypoints were enabled
but we weren't emitting the header so they couldn't be used.


>From cdb815862d008387084de3db91561efbcf9ad5f6 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Mon, 23 Sep 2024 07:51:10 -0500
Subject: [PATCH] [libc] Add 'strings.h' header on the GPU

Summary:
These are GNU extensions but still show up, the entrypoints were enabled
but we weren't emitting the header so they couldn't be used.
---
 libc/config/gpu/headers.txt |  1 +
 libc/docs/gpu/support.rst   | 24 +++++++++++++++++-------
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/libc/config/gpu/headers.txt b/libc/config/gpu/headers.txt
index fc952c40f4daa2..adbd014fba6c18 100644
--- a/libc/config/gpu/headers.txt
+++ b/libc/config/gpu/headers.txt
@@ -2,6 +2,7 @@ set(TARGET_PUBLIC_HEADERS
     libc.include.assert
     libc.include.ctype
     libc.include.string
+    libc.include.strings
     libc.include.signal
     libc.include.float
     libc.include.stdint
diff --git a/libc/docs/gpu/support.rst b/libc/docs/gpu/support.rst
index c8b1052ce16895..01280498a800f8 100644
--- a/libc/docs/gpu/support.rst
+++ b/libc/docs/gpu/support.rst
@@ -47,7 +47,6 @@ Function Name  Available  RPC Required
 bcmp           |check|
 bcopy          |check|
 bzero          |check|
-index          |check|
 memccpy        |check|
 memchr         |check|
 memcmp         |check|
@@ -57,11 +56,8 @@ memmove        |check|
 mempcpy        |check|
 memrchr        |check|
 memset         |check|
-rindex         |check|
 stpcpy         |check|
 stpncpy        |check|
-strcasecmp     |check|
-strcasestr     |check|
 strcat         |check|
 strchr         |check|
 strchrnul      |check|
@@ -74,7 +70,6 @@ strerror       |check|
 strlcat        |check|
 strlcpy        |check|
 strlen         |check|
-strncasecmp    |check|
 strncat        |check|
 strncmp        |check|
 strncpy        |check|
@@ -90,6 +85,21 @@ strtok_r       |check|
 strxfrm        |check|
 =============  =========  ============
 
+strings.h
+--------
+
+=============  =========  ============
+Function Name  Available  RPC Required
+=============  =========  ============
+bcmp           |check|
+bcopy          |check|
+bzero          |check|
+strcasecmp     |check|
+strcasestr     |check|
+index          |check|
+rindex         |check|
+=============  =========  ============
+
 stdbit.h
 --------
 
@@ -239,8 +249,8 @@ snprintf       |check|
 vsprintf       |check|
 vsnprintf      |check|
 sscanf         |check|
-scanf          |check|
-fscanf         |check|
+scanf          |check|    |check|
+fscanf         |check|    |check|
 putchar        |check|    |check|
 fclose         |check|    |check|
 fopen          |check|    |check|



More information about the libc-commits mailing list