From 3403a5813748065877552f8c220ba5e9b726cbd4 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Thu, 19 May 2022 09:25:59 +0800 Subject: intel-graphics-compiler: LLVM 13 fixes Backport LLVM 13 fixes from upstream. This fixes the crashes when invoking ocloc after enabling built-ins in compute-runtime. Also see: https://github.com/intel/intel-graphics-compiler/issues/204 Signed-off-by: Anuj Mittal --- ...0002-LLVM13-changed-MCContext-constructor.patch | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch (limited to 'dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch') diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch new file mode 100644 index 00000000..df6fa613 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch @@ -0,0 +1,41 @@ +From 049cbc1bf259ab109160987cbd43a485069957a6 Mon Sep 17 00:00:00 2001 +From: Marcin Naczk +Date: Tue, 17 May 2022 09:50:31 +0000 +Subject: [PATCH 2/2] LLVM13 changed MCContext constructor + +For LLVM13, MCContext constructor changed. +In the list of arguments appeared MCSubtargetInfo which is not used by us. +ObjectFileInfo was removed from the list of arguments, so we need to set +it in the next command. + +Upstream-Status: Backport +Signed-off-by: Anuj Mittal +--- + IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h b/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h +index 3725864ef..f3e7e2b4e 100644 +--- a/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h ++++ b/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h +@@ -24,10 +24,13 @@ namespace IGCLLVM + bool DoAutoReset = true) + { + #if LLVM_VERSION_MAJOR >= 13 +- std::string Err; +- const llvm::Target *T = llvm::TargetRegistry::lookupTarget(TheTriple.str(), Err); +- std::unique_ptr STI(T->createMCSubtargetInfo(TheTriple.str(), "", "")); +- return new llvm::MCContext(TheTriple, MAI, MRI, STI.get(), Mgr, TargetOpts, DoAutoReset); ++// Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo ++// ++// Differential Revision: https://reviews.llvm.org/D101921 ++ ++ auto *Context = new llvm::MCContext(TheTriple, MAI, MRI, nullptr, Mgr, TargetOpts, DoAutoReset); ++ Context->setObjectFileInfo(MOFI); ++ return Context; + #elif LLVM_VERSION_MAJOR >= 10 + return new llvm::MCContext(MAI, MRI, MOFI, Mgr, TargetOpts, DoAutoReset); + #else +-- +2.35.3 + -- cgit v1.2.3-54-g00ecf