Skip to content

Commit

Permalink
[libc] Include empty remove in baremetal stdio.h
Browse files Browse the repository at this point in the history
This is required to avoid compilation error in libc++.

See llvm#85335 for more details.
  • Loading branch information
petrhosek committed Mar 14, 2024
1 parent 4d62929 commit b9482de
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc/config/baremetal/arm/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions libc/config/baremetal/riscv/entrypoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions libc/src/stdio/baremetal/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
add_entrypoint_object(
remove
SRCS
remove.cpp
HDRS
../remove.h
)
22 changes: 22 additions & 0 deletions libc/src/stdio/baremetal/remove.cpp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b9482de

Please sign in to comment.