[libc-commits] [libc] [libc] fix getchar_unlocked (PR #73874)

via libc-commits libc-commits at lists.llvm.org
Wed Nov 29 16:08:42 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

<details>
<summary>Changes</summary>

A typo was leading to getc_unlocked.cpp.o being included into libc.a twice.

I only noticed because I was trying to convert libc.a to a shared object via

$ ld.lld -o libc.so --whole-archive libc.a

which errored since getc_unlocked was being defined twice.


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


1 Files Affected:

- (modified) libc/src/stdio/generic/CMakeLists.txt (+1-1) 


``````````diff
diff --git a/libc/src/stdio/generic/CMakeLists.txt b/libc/src/stdio/generic/CMakeLists.txt
index 2ecef879eb4bbfe..67fd1337c90a134 100644
--- a/libc/src/stdio/generic/CMakeLists.txt
+++ b/libc/src/stdio/generic/CMakeLists.txt
@@ -319,7 +319,7 @@ add_entrypoint_object(
 add_entrypoint_object(
   getchar_unlocked
   SRCS
-    getc_unlocked.cpp
+    getchar_unlocked.cpp
   HDRS
     ../getc_unlocked.h
   DEPENDS

``````````

</details>


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


More information about the libc-commits mailing list