summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2022-05-19 09:25:59 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2022-05-19 12:02:58 +0800
commit3403a5813748065877552f8c220ba5e9b726cbd4 (patch)
tree888bcf5d9ffafab73449684fc464bfeb0a93e573 /dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch
parentc4222554c750749ce324482236cac138b467f3c6 (diff)
downloadmeta-intel-3403a5813748065877552f8c220ba5e9b726cbd4.tar.gz
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 <anuj.mittal@intel.com>
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch')
-rw-r--r--dynamic-layers/clang-layer/recipes-opencl/igc/files/0002-LLVM13-changed-MCContext-constructor.patch41
1 files changed, 41 insertions, 0 deletions
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 @@
1From 049cbc1bf259ab109160987cbd43a485069957a6 Mon Sep 17 00:00:00 2001
2From: Marcin Naczk <marcin.naczk@intel.com>
3Date: Tue, 17 May 2022 09:50:31 +0000
4Subject: [PATCH 2/2] LLVM13 changed MCContext constructor
5
6For LLVM13, MCContext constructor changed.
7In the list of arguments appeared MCSubtargetInfo which is not used by us.
8ObjectFileInfo was removed from the list of arguments, so we need to set
9it in the next command.
10
11Upstream-Status: Backport
12Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
13---
14 IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h | 11 +++++++----
15 1 file changed, 7 insertions(+), 4 deletions(-)
16
17diff --git a/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h b/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h
18index 3725864ef..f3e7e2b4e 100644
19--- a/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h
20+++ b/IGC/WrapperLLVM/include/llvmWrapper/MC/MCContext.h
21@@ -24,10 +24,13 @@ namespace IGCLLVM
22 bool DoAutoReset = true)
23 {
24 #if LLVM_VERSION_MAJOR >= 13
25- std::string Err;
26- const llvm::Target *T = llvm::TargetRegistry::lookupTarget(TheTriple.str(), Err);
27- std::unique_ptr<llvm::MCSubtargetInfo> STI(T->createMCSubtargetInfo(TheTriple.str(), "", ""));
28- return new llvm::MCContext(TheTriple, MAI, MRI, STI.get(), Mgr, TargetOpts, DoAutoReset);
29+// Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo
30+//
31+// Differential Revision: https://reviews.llvm.org/D101921
32+
33+ auto *Context = new llvm::MCContext(TheTriple, MAI, MRI, nullptr, Mgr, TargetOpts, DoAutoReset);
34+ Context->setObjectFileInfo(MOFI);
35+ return Context;
36 #elif LLVM_VERSION_MAJOR >= 10
37 return new llvm::MCContext(MAI, MRI, MOFI, Mgr, TargetOpts, DoAutoReset);
38 #else
39--
402.35.3
41