-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Include empty remove in baremetal stdio.h #85336
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
Conversation
This is required to avoid compilation error in libc++. See llvm#85335 for more details.
@llvm/pr-subscribers-libc Author: Petr Hosek (petrhosek) ChangesThis is required to avoid compilation error in libc++. See #85335 for more details. Full diff: https://github.com/llvm/llvm-project/pull/85336.diff 4 Files Affected:
diff --git a/libc/config/baremetal/arm/entrypoints.txt b/libc/config/baremetal/arm/entrypoints.txt
index 589ec5237e98da..d97c8d75fe309a 100644
--- a/libc/config/baremetal/arm/entrypoints.txt
+++ b/libc/config/baremetal/arm/entrypoints.txt
@@ -79,6 +79,7 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.inttypes.strtoumax
# stdio.h entrypoints
+ libc.src.stdio.remove
libc.src.stdio.sprintf
libc.src.stdio.snprintf
libc.src.stdio.vsprintf
diff --git a/libc/config/baremetal/riscv/entrypoints.txt b/libc/config/baremetal/riscv/entrypoints.txt
index 09de1b416e0e94..19c9ac7fbe8515 100644
--- a/libc/config/baremetal/riscv/entrypoints.txt
+++ b/libc/config/baremetal/riscv/entrypoints.txt
@@ -79,6 +79,7 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.inttypes.strtoumax
# stdio.h entrypoints
+ libc.src.stdio.remove
libc.src.stdio.sprintf
libc.src.stdio.snprintf
libc.src.stdio.vsprintf
diff --git a/libc/src/stdio/baremetal/CMakeLists.txt b/libc/src/stdio/baremetal/CMakeLists.txt
new file mode 100644
index 00000000000000..734a66f72ecf6f
--- /dev/null
+++ b/libc/src/stdio/baremetal/CMakeLists.txt
@@ -0,0 +1,7 @@
+add_entrypoint_object(
+ remove
+ SRCS
+ remove.cpp
+ HDRS
+ ../remove.h
+)
diff --git a/libc/src/stdio/baremetal/remove.cpp b/libc/src/stdio/baremetal/remove.cpp
new file mode 100644
index 00000000000000..c1c834d13952bf
--- /dev/null
+++ b/libc/src/stdio/baremetal/remove.cpp
@@ -0,0 +1,22 @@
+//===-- Linux implementation of remove ------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/stdio/remove.h"
+
+#include "src/__support/common.h"
+
+namespace LIBC_NAMESPACE {
+
+// TODO: See https://github.com/llvm/llvm-project/issues/85335 for more details
+// on why this is needed.
+
+LLVM_LIBC_FUNCTION(int, remove, (const char *)) {
+ return -1;
+}
+
+} // namespace LIBC_NAMESPACE
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
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
@@ -0,0 +1,22 @@ | |||
//===-- Linux implementation of remove ------------------------------------===// |
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.
nit: Update comment and formatting.
I'm curious, does this become a problem for other cases of Or is this specifically because |
I expect this to be only a temporary workaround until we address #85335.
This is only an issue for |
This is required to avoid compilation error in libc++.
See #85335 for more details.