From 12b968f47078e33f43611a8e47df28df1643a4de Mon Sep 17 00:00:00 2001 From: Artem Belevich Date: Mon, 10 Feb 2020 17:01:07 -0800 Subject: [PATCH] Add __chkstk to the list of host symbols known to XLA/CPU on windows. PiperOrigin-RevId: 294337304 Change-Id: I61f0a386d2a2dbd7cd68c105d3081448bc639ddf --- tensorflow/compiler/xla/service/cpu/simple_orc_jit.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; }