aboutsummaryrefslogtreecommitdiff
path: root/tools/driver
diff options
context:
space:
mode:
Diffstat (limited to 'tools/driver')
-rw-r--r--tools/driver/EmbeddedRunner.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/driver/EmbeddedRunner.cc b/tools/driver/EmbeddedRunner.cc
index 7f0b763..8bfeccb 100644
--- a/tools/driver/EmbeddedRunner.cc
+++ b/tools/driver/EmbeddedRunner.cc
@@ -325,6 +325,12 @@ static llvm::Error defineRuntimeSymbols(llvm::orc::LLJIT &J) {
ExecutorSymbolDef::fromPtr(&std::strtoll);
#endif
#ifdef _WIN32
+ // Generated diagnostics write to stderr through __acrt_iob_func(2). The
+ // msvcrt DLL only exports __iob_func, so bind the host's shim directly.
+ Symbols[Intern("__acrt_iob_func")] =
+ ExecutorSymbolDef::fromPtr(&__acrt_iob_func);
+#endif
+#ifdef _WIN32
// The JIT-generated main references __main on MinGW; provide a no-op so
// the host CRT is not initialized a second time.
Symbols[Intern("__main")] =