Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] fix getchar_unlocked #73874

Merged
merged 2 commits into from
Nov 30, 2023
Merged

Conversation

nickdesaulniers
Copy link
Member

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.

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.
@llvmbot llvmbot added the libc label Nov 30, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 30, 2023

@llvm/pr-subscribers-libc

Author: Nick Desaulniers (nickdesaulniers)

Changes

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 --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

Copy link
Contributor

@michaelrj-google michaelrj-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nickdesaulniers nickdesaulniers merged commit cc84a14 into llvm:main Nov 30, 2023
3 checks passed
@nickdesaulniers nickdesaulniers deleted the getchar branch November 30, 2023 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants