[libc-commits] [libc] 5a75242 - [libc] Include empty remove in baremetal stdio.h (#85336)

via libc-commits libc-commits at lists.llvm.org
Sat Mar 16 23:17:21 PDT 2024


Author: Petr Hosek
Date: 2024-03-16T23:17:19-07:00
New Revision: 5a75242bc898886b9833e328ad5f656246424a81

URL: https://github.com/llvm/llvm-project/commit/5a75242bc898886b9833e328ad5f656246424a81
DIFF: https://github.com/llvm/llvm-project/commit/5a75242bc898886b9833e328ad5f656246424a81.diff

LOG: [libc] Include empty remove in baremetal stdio.h (#85336)

This is required to avoid compilation error in libc++.

See #85335 for more details.

Added: 
    libc/src/stdio/baremetal/CMakeLists.txt
    libc/src/stdio/baremetal/remove.cpp

Modified: 
    libc/config/baremetal/arm/entrypoints.txt
    libc/config/baremetal/riscv/entrypoints.txt

Removed: 
    


################################################################################
diff  --git a/libc/config/baremetal/arm/entrypoints.txt b/libc/config/baremetal/arm/entrypoints.txt
index 9670c8e48b29f4..17ce56e228a6ac 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 a30b08b7e02fcf..39756e1ee29f54 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..f4f2cdca7c69b5
--- /dev/null
+++ b/libc/src/stdio/baremetal/remove.cpp
@@ -0,0 +1,19 @@
+//===-- 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: This is a temporary workaround for issue #85335.
+
+LLVM_LIBC_FUNCTION(int, remove, (const char *)) { return -1; }
+
+} // namespace LIBC_NAMESPACE


        


More information about the libc-commits mailing list