-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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] Additional check for File support in scanf_core #128079
Conversation
This adds a check for `TARGET libc.src.__support.File.file` before appending ` libc.src.__support.File.file` to file_deps.
@llvm/pr-subscribers-libc Author: Caslyn Tonelli (Caslyn) ChangesThis adds a check for Full diff: https://github.com/llvm/llvm-project/pull/128079.diff 1 Files Affected:
diff --git a/libc/src/stdio/scanf_core/CMakeLists.txt b/libc/src/stdio/scanf_core/CMakeLists.txt
index ce639fe65a106..813f4213d160a 100644
--- a/libc/src/stdio/scanf_core/CMakeLists.txt
+++ b/libc/src/stdio/scanf_core/CMakeLists.txt
@@ -16,7 +16,7 @@ if(LIBC_TARGET_OS_IS_GPU)
libc.src.stdio.ungetc
libc.src.stdio.ferror
)
-elseif(LLVM_LIBC_FULL_BUILD)
+elseif(TARGET libc.src.__support.File.file AND LLVM_LIBC_FULL_BUILD)
list(APPEND file_deps
libc.src.__support.File.file
)
|
@michaelrj-google - I ought to have tested your previous patch locally. I think this might be the missing piece to resolve the error on our Fuchsia builder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I'm not sure if this will work for baremetal, since right now the fscanf scanner requires either the system's FILE or our own FILE. We might need to add a hook similar to what's in https://github.com/llvm/llvm-project/blob/main/libc/src/stdio/baremetal/printf.cpp, or alternately just add baremetal versions of |
I have a WIP implementation of that locally, I'll clean it up and send it for review. |
Would it make sense to turn off |
It's not included in any of the baremetal |
Ah, in that case this might fix the build. These aren't entrypoints so they're being built unconditionally, and if nothing is providing |
A temporary fix based on discussions in llvm#128079 Currently, baremetal targets are failing to build because the scanf internals require FILE* (either from the system's libc or our libc). Normally we'd just turn off the broken entrypoint, but since the scanf internals are built separately that doesn't work. This patch adds extra conditions to building those internals, which we can hopefully remove once we have a proper way to build scanf for embedded.
See #128097 |
A temporary fix based on discussions in #128079 Currently, baremetal targets are failing to build because the scanf internals require FILE* (either from the system's libc or our libc). Normally we'd just turn off the broken entrypoint, but since the scanf internals are built separately that doesn't work. This patch adds extra conditions to building those internals, which we can hopefully remove once we have a proper way to build scanf for embedded.
This adds a check for
TARGET libc.src.__support.File.file
before appendinglibc.src.__support.File.file
to file_deps.