diff --git a/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc b/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc index bcc01ef8254..a43007aba73 100644 --- a/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc +++ b/tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc @@ -212,6 +212,12 @@ llvm::JITSymbol SimpleOrcJIT::FindCompiledSymbol(const std::string& name) { return nullptr; } +#if defined(PLATFORM_WINDOWS) +// This function is used by compiler-generated code on windows, but it's not +// declared anywhere. The signature does not matter, we just need the address. +extern "C" void __chkstk(size_t); +#endif + namespace { // Register some known symbols with the CustomCallTargetRegistry. bool RegisterKnownJITSymbols() { @@ -364,6 +370,10 @@ bool RegisterKnownJITSymbols() { reinterpret_cast(__msan_unpoison), "Host"); #endif +#if defined(PLATFORM_WINDOWS) + registry->Register("__chkstk", reinterpret_cast(__chkstk), "Host"); +#endif + return true; }