[libc-commits] [libc] [libc] Mark external baremetal I/O symbols as extern "C" (PR #98871)
via libc-commits
libc-commits at lists.llvm.org
Mon Jul 15 01:21:59 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Petr Hosek (petrhosek)
<details>
<summary>Changes</summary>
These need to use C ABI.
---
Full diff: https://github.com/llvm/llvm-project/pull/98871.diff
1 Files Affected:
- (modified) libc/src/__support/OSUtil/baremetal/io.cpp (+3-3)
``````````diff
diff --git a/libc/src/__support/OSUtil/baremetal/io.cpp b/libc/src/__support/OSUtil/baremetal/io.cpp
index f8ec603568936..2a9ef6bfa6579 100644
--- a/libc/src/__support/OSUtil/baremetal/io.cpp
+++ b/libc/src/__support/OSUtil/baremetal/io.cpp
@@ -44,9 +44,9 @@ namespace LIBC_NAMESPACE_DECL {
struct __llvm_libc_stdio_cookie;
-extern struct __llvm_libc_stdio_cookie __llvm_libc_stdin_cookie;
-extern struct __llvm_libc_stdio_cookie __llvm_libc_stdout_cookie;
-extern struct __llvm_libc_stdio_cookie __llvm_libc_stderr_cookie;
+extern "C" struct __llvm_libc_stdio_cookie __llvm_libc_stdin_cookie;
+extern "C" struct __llvm_libc_stdio_cookie __llvm_libc_stdout_cookie;
+extern "C" struct __llvm_libc_stdio_cookie __llvm_libc_stderr_cookie;
extern "C" ssize_t __llvm_libc_stdio_read(void *cookie, char *buf, size_t size);
extern "C" ssize_t __llvm_libc_stdio_write(void *cookie, const char *buf,
``````````
</details>
https://github.com/llvm/llvm-project/pull/98871
More information about the libc-commits
mailing list