[libc-commits] [libc] 9ba9e48 - [libc] Mark external baremetal I/O symbols as extern "C" (#98871)
via libc-commits
libc-commits at lists.llvm.org
Mon Jul 15 07:27:26 PDT 2024
Author: Petr Hosek
Date: 2024-07-15T07:27:23-07:00
New Revision: 9ba9e480fa4ef1f37a2b6b51603ac8e446cca5ff
URL: https://github.com/llvm/llvm-project/commit/9ba9e480fa4ef1f37a2b6b51603ac8e446cca5ff
DIFF: https://github.com/llvm/llvm-project/commit/9ba9e480fa4ef1f37a2b6b51603ac8e446cca5ff.diff
LOG: [libc] Mark external baremetal I/O symbols as extern "C" (#98871)
These need to use C ABI.
Added:
Modified:
libc/src/__support/OSUtil/baremetal/io.cpp
Removed:
################################################################################
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,
More information about the libc-commits
mailing list