Skip to content

[libc] Mark external baremetal I/O symbols as extern "C" #98871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

petrhosek
Copy link
Member

These need to use C ABI.

@llvmbot
Copy link
Member

llvmbot commented Jul 15, 2024

@llvm/pr-subscribers-libc

Author: Petr Hosek (petrhosek)

Changes

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 --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,

@petrhosek petrhosek merged commit 9ba9e48 into llvm:main Jul 15, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants