Skip to content

Commit

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

See #85335 for more details.
  • Loading branch information
petrhosek committed Mar 17, 2024
1 parent 252d019 commit 5a75242
Show file tree
Hide file tree
Showing 4 changed files with 28 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
)
19 changes: 19 additions & 0 deletions libc/src/stdio/baremetal/remove.cpp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5a75242

Please sign in to comment.