From da83b70a6fe602f047c8007009cfd646a2166cce Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 19 Aug 2021 13:17:35 +1000 Subject: [PATCH] [examples] Fix Kaleidoscope for Windows This fixes "Resolving symbol with incorrect flags" errors when running the Kaleidoscope tutorials on Windows. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D108348 --- llvm/examples/Kaleidoscope/include/KaleidoscopeJIT.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/examples/Kaleidoscope/include/KaleidoscopeJIT.h b/llvm/examples/Kaleidoscope/include/KaleidoscopeJIT.h index 18a4c11..457a2d4 100644 --- a/llvm/examples/Kaleidoscope/include/KaleidoscopeJIT.h +++ b/llvm/examples/Kaleidoscope/include/KaleidoscopeJIT.h @@ -54,6 +54,10 @@ public: MainJD.addGenerator( cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess( DL.getGlobalPrefix()))); + if (JTMB.getTargetTriple().isOSBinFormatCOFF()) { + ObjectLayer.setOverrideObjectFlagsWithResponsibilityFlags(true); + ObjectLayer.setAutoClaimResponsibilityForObjectSymbols(true); + } } ~KaleidoscopeJIT() { -- 2.7.4