[libc-commits] [libc] [libc] Enable 'wchar.h' for the GPU (PR #98973)
Joseph Huber via libc-commits
libc-commits at lists.llvm.org
Mon Jul 15 18:49:32 PDT 2024
https://github.com/jhuber6 updated https://github.com/llvm/llvm-project/pull/98973
>From 2016f90298495782a6e86d756fcd835c23e79a17 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Mon, 15 Jul 2024 17:15:23 -0500
Subject: [PATCH] [libc] Enable 'wchar.h' for the GPU
Summary:
This file is not really well populated, but is required for some targets
to configure. Enable it on the GPU for now.
---
libc/config/gpu/entrypoints.txt | 3 +++
libc/config/gpu/headers.txt | 2 ++
libc/include/uchar.h.def | 1 +
libc/include/wchar.h.def | 2 ++
4 files changed, 8 insertions(+)
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/uchar.h.def b/libc/include/uchar.h.def
index 31b7fcb73ded6..83400f4aba2ee 100644
--- a/libc/include/uchar.h.def
+++ b/libc/include/uchar.h.def
@@ -10,6 +10,7 @@
#define LLVM_LIBC_UCHAR_H
#include "__llvm-libc-common.h"
+#include "llvm-libc-types/mbstate_t.h"
%%public_api()
diff --git a/libc/include/wchar.h.def b/libc/include/wchar.h.def
index 4c25de700d606..d0de1a6762a39 100644
--- a/libc/include/wchar.h.def
+++ b/libc/include/wchar.h.def
@@ -11,6 +11,8 @@
#include "__llvm-libc-common.h"
#include "llvm-libc-macros/wchar-macros.h"
+#include "llvm-libc-types/wint_t.h"
+#include "llvm-libc-types/mbstate_t.h"
%%public_api()
More information about the libc-commits
mailing list