Skip to content

Commit 5a75242

Browse files
authored
[libc] Include empty remove in baremetal stdio.h (#85336)
This is required to avoid compilation error in libc++. See #85335 for more details.
1 parent 252d019 commit 5a75242

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

libc/config/baremetal/arm/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ set(TARGET_LIBC_ENTRYPOINTS
7979
libc.src.inttypes.strtoumax
8080

8181
# stdio.h entrypoints
82+
libc.src.stdio.remove
8283
libc.src.stdio.sprintf
8384
libc.src.stdio.snprintf
8485
libc.src.stdio.vsprintf

libc/config/baremetal/riscv/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ set(TARGET_LIBC_ENTRYPOINTS
7979
libc.src.inttypes.strtoumax
8080

8181
# stdio.h entrypoints
82+
libc.src.stdio.remove
8283
libc.src.stdio.sprintf
8384
libc.src.stdio.snprintf
8485
libc.src.stdio.vsprintf
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
add_entrypoint_object(
2+
remove
3+
SRCS
4+
remove.cpp
5+
HDRS
6+
../remove.h
7+
)

libc/src/stdio/baremetal/remove.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//===-- Linux implementation of remove ------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "src/stdio/remove.h"
10+
11+
#include "src/__support/common.h"
12+
13+
namespace LIBC_NAMESPACE {
14+
15+
// TODO: This is a temporary workaround for issue #85335.
16+
17+
LLVM_LIBC_FUNCTION(int, remove, (const char *)) { return -1; }
18+
19+
} // namespace LIBC_NAMESPACE

0 commit comments

Comments
 (0)