[libc-commits] [libc] Fix libc building compfail for SPIRV target (PR #197381)

via libc-commits libc-commits at lists.llvm.org
Wed May 13 00:18:03 PDT 2026


https://github.com/jinge90 created https://github.com/llvm/llvm-project/pull/197381

None

>From 5c41e5e45b8f664eda82d537db39717b7e7a448a Mon Sep 17 00:00:00 2001
From: jinge90 <ge.jin at intel.com>
Date: Wed, 13 May 2026 15:15:43 +0800
Subject: [PATCH] Fix libc building compfail for SPIRV target

Signed-off-by: jinge90 <ge.jin at intel.com>
---
 libc/CMakeLists.txt                   | 2 +-
 libc/config/gpu/spirv/entrypoints.txt | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index e796598e48924..cf2a8cad42154 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -412,7 +412,7 @@ add_subdirectory(hdr)
 add_subdirectory(src)
 add_subdirectory(utils)
 
-if(LLVM_LIBC_FULL_BUILD)
+if(LLVM_LIBC_FULL_BUILD AND NOT LIBC_TARGET_ARCHITECTURE_IS_SPIRV)
   # The startup system can potentially depend on the library components so add
   # it after the library implementation directories.
   add_subdirectory(startup)
diff --git a/libc/config/gpu/spirv/entrypoints.txt b/libc/config/gpu/spirv/entrypoints.txt
index 11edc358339b7..36c98339582cd 100644
--- a/libc/config/gpu/spirv/entrypoints.txt
+++ b/libc/config/gpu/spirv/entrypoints.txt
@@ -31,6 +31,9 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.ctype.toupper
     libc.src.ctype.toupper_l
 
+    # errno.h entrypoints
+    libc.src.errno.errno
+
     # string.h entrypoints
     libc.src.string.memccpy
     libc.src.string.memchr



More information about the libc-commits mailing list