[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
This commit is contained in:
Lang Hames 2021-08-19 13:17:35 +10:00
parent e4888be74e
commit da83b70a6f
1 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,10 @@ public:
MainJD.addGenerator(
cantFail(DynamicLibrarySearchGenerator::GetForCurrentProcess(
DL.getGlobalPrefix())));
if (JTMB.getTargetTriple().isOSBinFormatCOFF()) {
ObjectLayer.setOverrideObjectFlagsWithResponsibilityFlags(true);
ObjectLayer.setAutoClaimResponsibilityForObjectSymbols(true);
}
}
~KaleidoscopeJIT() {