[libc-commits] [libc] [libc] Enable 'wchar.h' for the GPU (PR #98973)

via libc-commits libc-commits at lists.llvm.org
Mon Jul 15 15:17:04 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

<details>
<summary>Changes</summary>

Summary:
This file is not really well populated, but is required for some targets
to configure. Enable it on the GPU for now.


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


3 Files Affected:

- (modified) libc/config/gpu/entrypoints.txt (+3) 
- (modified) libc/config/gpu/headers.txt (+2) 
- (modified) libc/include/wchar.h.def (+1) 


``````````diff
diff --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt
index 624ac2715579f..63228216c85ec 100644
--- a/libc/config/gpu/entrypoints.txt
+++ b/libc/config/gpu/entrypoints.txt
@@ -218,6 +218,9 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.time.clock
     libc.src.time.nanosleep
 
+    # wchar.h entrypoints
+    libc.src.wchar.wctob
+
     # gpu/rpc.h entrypoints
     libc.src.gpu.rpc_host_call
     libc.src.gpu.rpc_fprintf
diff --git a/libc/config/gpu/headers.txt b/libc/config/gpu/headers.txt
index dd16938da8a44..1d4038d5eb45a 100644
--- a/libc/config/gpu/headers.txt
+++ b/libc/config/gpu/headers.txt
@@ -12,6 +12,8 @@ set(TARGET_PUBLIC_HEADERS
     libc.include.errno
     libc.include.stdlib
     libc.include.stdio
+    libc.include.wchar
+    libc.include.uchar
 
     # Header for RPC extensions
     libc.include.gpu_rpc
diff --git a/libc/include/wchar.h.def b/libc/include/wchar.h.def
index 4c25de700d606..58cad90d3bb43 100644
--- a/libc/include/wchar.h.def
+++ b/libc/include/wchar.h.def
@@ -11,6 +11,7 @@
 
 #include "__llvm-libc-common.h"
 #include "llvm-libc-macros/wchar-macros.h"
+#include "llvm-libc-types/wint_t.h"
 
 %%public_api()
 

``````````

</details>


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


More information about the libc-commits mailing list