]> git.pld-linux.org Git - packages/Mesa.git/blob - Mesa-llvm.patch
- up to 9.1.6
[packages/Mesa.git] / Mesa-llvm.patch
1 From 7cd248aa7938a068663fcd605169b7d4e21636bf Mon Sep 17 00:00:00 2001
2 From: Tom Stellard <thomas.stellard@amd.com>
3 Date: Wed, 13 Feb 2013 20:59:41 +0000
4 Subject: radeon/llvm: Fix build with LLVM 3.3
5
6 ---
7 diff --git a/src/gallium/drivers/r600/llvm_wrapper.cpp b/src/gallium/drivers/r600/llvm_wrapper.cpp
8 index 81f5397..ae2f4d2 100644
9 --- a/src/gallium/drivers/r600/llvm_wrapper.cpp
10 +++ b/src/gallium/drivers/r600/llvm_wrapper.cpp
11 @@ -1,6 +1,10 @@
12  #include <llvm/ADT/OwningPtr.h>
13  #include <llvm/ADT/StringRef.h>
14 +#if HAVE_LLVM < 0x0303
15  #include <llvm/LLVMContext.h>
16 +#else
17 +#include <llvm/IR/LLVMContext.h>
18 +#endif
19  #include <llvm/PassManager.h>
20  #include <llvm/Support/IRReader.h>
21  #include <llvm/Support/MemoryBuffer.h>
22 diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
23 index 903e102..0491e64 100644
24 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
25 +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
26 @@ -25,8 +25,16 @@
27   */
28  #include "radeon_llvm_emit.h"
29  
30 +#if HAVE_LLVM < 0x0303
31  #include <llvm/LLVMContext.h>
32  #include <llvm/Module.h>
33 +#include <llvm/DataLayout.h>
34 +#else
35 +#include <llvm/IR/LLVMContext.h>
36 +#include <llvm/IR/Module.h>
37 +#include <llvm/IR/DataLayout.h>
38 +#endif
39 +
40  #include <llvm/PassManager.h>
41  #include <llvm/ADT/Triple.h>
42  #include <llvm/Support/FormattedStream.h>
43 @@ -39,7 +47,6 @@
44  #include <llvm/Target/TargetMachine.h>
45  #include <llvm/Transforms/Scalar.h>
46  #include <llvm-c/Target.h>
47 -#include <llvm/DataLayout.h>
48  
49  #include <iostream>
50  #include <stdlib.h>
51 --
52 cgit v0.9.0.2-2-gbebe
53 From 1f006717db5258e703d83b37772b85ad25bf3319 Mon Sep 17 00:00:00 2001
54 From: Tom Stellard <thomas.stellard@amd.com>
55 Date: Wed, 13 Feb 2013 20:57:25 +0000
56 Subject: r600g: Add $(DEFINES) to AM_CXXFLAGS
57
58 This way llvm_wrapper.cpp is compiled with -DHAVE_LLVM=0x....
59 ---
60 (limited to 'src/gallium')
61
62 diff --git a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am
63 index 6f48b56..e1c8574 100644
64 --- a/src/gallium/drivers/r600/Makefile.am
65 +++ b/src/gallium/drivers/r600/Makefile.am
66 @@ -26,7 +26,8 @@ AM_CFLAGS += \
67         -I$(top_srcdir)/src/gallium/drivers/radeon/
68  
69  AM_CXXFLAGS= \
70 -       $(LLVM_CXXFLAGS)
71 +       $(LLVM_CXXFLAGS) \
72 +       $(DEFINES)
73  endif
74  
75  if USE_R600_LLVM_COMPILER
76 --
77 cgit v0.9.0.2-2-gbebe
78 From ead4db420e9e5408f41c70768a290592a384aedb Mon Sep 17 00:00:00 2001
79 From: Tom Stellard <thomas.stellard@amd.com>
80 Date: Tue, 23 Apr 2013 14:57:54 +0000
81 Subject: gallivm: Fix build with LLVM >= r180063
82
83 ---
84 diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
85 index 024819e..717afa7 100644
86 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
87 +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
88 @@ -67,6 +67,10 @@
89  #include <llvm/Target/TargetSelect.h>
90  #endif /* HAVE_LLVM < 0x0300 */
91  
92 +#if HAVE_LLVM >= 0x0303
93 +#include <llvm/Wrap.h>
94 +#endif
95 +
96  #include "pipe/p_config.h"
97  #include "util/u_debug.h"
98  #include "util/u_cpu_detect.h"
99 --
100 cgit v0.9.0.2-2-gbebe
101 From a0c8942bb4742b4bd22f494cea4dcd59d9ca99ab Mon Sep 17 00:00:00 2001
102 From: Tom Stellard <thomas.stellard@amd.com>
103 Date: Tue, 23 Apr 2013 14:58:38 +0000
104 Subject: radeon/llvm:  Fix build with LLVM >= r180063
105
106 ---
107 diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
108 index d2dc035..5b770d0 100644
109 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
110 +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
111 @@ -47,6 +47,7 @@
112  #include <llvm/Support/Threading.h>
113  #include <llvm/Target/TargetMachine.h>
114  #include <llvm/Transforms/Scalar.h>
115 +#include <llvm/Wrap.h>
116  #include <llvm-c/Target.h>
117  
118  #include <iostream>
119 --
120 cgit v0.9.0.2-2-gbebe
121 From 6249db73ea580e6a54874235ffb3a7d42ac63bb4 Mon Sep 17 00:00:00 2001
122 From: Christian König <christian.koenig@amd.com>
123 Date: Tue, 26 Mar 2013 10:37:45 +0000
124 Subject: radeon/llvm: remove uneeded inclusion
125
126 The include isn't needed and the file has moved with LLVM master.
127
128 Signed-off-by: Christian König <christian.koenig@amd.com>
129 Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
130 ---
131 (limited to 'src/gallium/drivers/radeon/radeon_llvm_emit.cpp')
132
133 diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
134 index ee82a90..a23532b 100644
135 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
136 +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
137 @@ -41,7 +41,6 @@
138  #include <llvm/ADT/Triple.h>
139  #include <llvm/Support/FormattedStream.h>
140  #include <llvm/Support/Host.h>
141 -#include <llvm/Support/IRReader.h>
142  #include <llvm/Support/SourceMgr.h>
143  #include <llvm/Support/TargetRegistry.h>
144  #include <llvm/Support/TargetSelect.h>
145 --
146 cgit v0.9.0.2-2-gbebe
147 diff -ur a/src/gallium/drivers/r600/llvm_wrapper.cpp b/src/gallium/drivers/r600/llvm_wrapper.cpp
148 --- a/src/gallium/drivers/r600/llvm_wrapper.cpp 2013-03-05 23:54:28.000000000 +0100
149 +++ b/src/gallium/drivers/r600/llvm_wrapper.cpp 2013-05-02 17:46:36.411226826 +0200
150 @@ -2,7 +2,12 @@
151  #include <llvm/ADT/StringRef.h>
152  #include <llvm/LLVMContext.h>
153  #include <llvm/PassManager.h>
154 +#if HAVE_LLVM < 0x0303
155  #include <llvm/Support/IRReader.h>
156 +#else
157 +#include <llvm/IRReader/IRReader.h>
158 +#include <llvm/Support/CBindingWrapping.h>
159 +#endif /* HAVE_LLVM < 0x0303 */
160  #include <llvm/Support/MemoryBuffer.h>
161  #include <llvm/Support/SourceMgr.h>
162  #include <llvm/Transforms/IPO.h>
163 diff -ur a/src/gallium/drivers/r600/Makefile.am b/src/gallium/drivers/r600/Makefile.am
164 --- a/src/gallium/drivers/r600/Makefile.am      2013-03-05 23:54:28.000000000 +0100
165 +++ b/src/gallium/drivers/r600/Makefile.am      2013-05-02 18:00:20.035242047 +0200
166 @@ -23,6 +23,7 @@
167  
168  AM_CFLAGS += \
169         $(LLVM_CFLAGS) \
170 +       -lLLVMIRReader \
171         -I$(top_srcdir)/src/gallium/drivers/radeon/
172  
173  AM_CXXFLAGS= \
174 From 4742f9b00b804dd01eb9955dd386a2373cd8eb36 Mon Sep 17 00:00:00 2001
175 From: Armin K <krejzi@email.com>
176 Date: Thu, 02 May 2013 10:55:04 +0000
177 Subject: gallivm: Fix build with LLVM 3.3
178
179 Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
180 ---
181 diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
182 index 717afa7..a531d98 100644
183 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
184 +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
185 @@ -68,7 +68,9 @@
186  #endif /* HAVE_LLVM < 0x0300 */
187  
188  #if HAVE_LLVM >= 0x0303
189 -#include <llvm/Wrap.h>
190 +#include <llvm/IR/IRBuilder.h>
191 +#include <llvm/IR/Module.h>
192 +#include <llvm/Support/CBindingWrapping.h>
193  #endif
194  
195  #include "pipe/p_config.h"
196 --
197 cgit v0.9.0.2-2-gbebe
198 From cd84353d576246273d1c6ae8e96b65217be15ebc Mon Sep 17 00:00:00 2001
199 From: Armin K <krejzi@email.com>
200 Date: Thu, 02 May 2013 10:55:05 +0000
201 Subject: radeon: Fix build with LLVM 3.3
202
203 Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
204 ---
205 diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
206 index 55dad9b..fb974f9 100644
207 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
208 +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
209 @@ -39,6 +39,7 @@
210  
211  #include <llvm/PassManager.h>
212  #include <llvm/ADT/Triple.h>
213 +#include <llvm/Support/CBindingWrapping.h>
214  #include <llvm/Support/FormattedStream.h>
215  #include <llvm/Support/Host.h>
216  #include <llvm/Support/SourceMgr.h>
217 @@ -47,7 +48,6 @@
218  #include <llvm/Support/Threading.h>
219  #include <llvm/Target/TargetMachine.h>
220  #include <llvm/Transforms/Scalar.h>
221 -#include <llvm/Wrap.h>
222  #include <llvm-c/Target.h>
223  
224  #include <iostream>
225  # Provide compatibility with scripts for the old Mesa build system for
226 -- 
227 1.8.1.5
228
229 Signed-off-by: Vinson Lee <vlee at freedesktop.org>
230 ---
231  src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 4 +++-
232  1 file changed, 3 insertions(+), 1 deletion(-)
233
234 diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
235 index 86617d4..1c886ea 100644
236 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
237 +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
238 @@ -212,7 +212,9 @@ disassemble(const void* func, llvm::raw_ostream & Out)
239     std::string Error;
240     const Target *T = TargetRegistry::lookupTarget(Triple, Error);
241  
242 -#if HAVE_LLVM >= 0x0300
243 +#if HAVE_LLVM >= 0x0304
244 +   OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(*T->createMCRegInfo(Triple), Triple));
245 +#elif HAVE_LLVM >= 0x0300
246     OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(Triple));
247  #else
248     OwningPtr<const MCAsmInfo> AsmInfo(T->createAsmInfo(Triple));
249 -- 
250 1.8.2.1
251 --- x/src/gallium/state_trackers/clover/llvm/invocation.cpp.org 2013-06-19 12:06:31.055563544 +0200
252 +++ x/src/gallium/state_trackers/clover/llvm/invocation.cpp     2013-06-19 12:16:58.645029877 +0200
253 @@ -28,10 +28,18 @@
254  #include <clang/CodeGen/CodeGenAction.h>
255  #include <llvm/Bitcode/BitstreamWriter.h>
256  #include <llvm/Bitcode/ReaderWriter.h>
257 +#if HAVE_LLVM < 0x0303
258  #include <llvm/DerivedTypes.h>
259 -#include <llvm/Linker.h>
260  #include <llvm/LLVMContext.h>
261  #include <llvm/Module.h>
262 +#else
263 +#include <llvm/IR/DerivedTypes.h>
264 +#include <llvm/IR/LLVMContext.h>
265 +#include <llvm/IR/Module.h>
266 +#include <llvm/Support/SourceMgr.h>
267 +#include <llvm/IRReader/IRReader.h>
268 +#endif
269 +#include <llvm/Linker.h>
270  #include <llvm/PassManager.h>
271  #include <llvm/Support/TargetSelect.h>
272  #include <llvm/Support/MemoryBuffer.h>
273 @@ -41,8 +49,10 @@
274  
275  #if HAVE_LLVM < 0x0302
276  #include <llvm/Target/TargetData.h>
277 -#else
278 +#elif HAVE_LLVM < 0x0303
279  #include <llvm/DataLayout.h>
280 +#else
281 +#include <llvm/IR/DataLayout.h>
282  #endif
283  
284  #include "pipe/p_state.h"
285 @@ -151,7 +161,11 @@
286        // Add libclc generic search path
287        c.getHeaderSearchOpts().AddPath(LIBCLC_INCLUDEDIR,
288                                        clang::frontend::Angled,
289 -                                      false, false, false);
290 +                                      false, false
291 +#if HAVE_LLVM < 0x0303
292 +                                      , false
293 +#endif
294 +                                      );
295  
296        // Add libclc include
297        c.getPreprocessorOpts().Includes.push_back("clc/clc.h");
298 @@ -167,8 +181,12 @@
299        c.getInvocation().setLangDefaults(c.getLangOpts(), clang::IK_OpenCL,
300                                          clang::LangStandard::lang_opencl11);
301  #endif
302 -      c.createDiagnostics(0, NULL, new clang::TextDiagnosticPrinter(
303 -                          s_log,
304 +      c.createDiagnostics(
305 +#if HAVE_LLVM < 0x0303
306 +                          0, NULL,
307 +#endif
308 +                          new clang::TextDiagnosticPrinter(
309 +                                 s_log,
310  #if HAVE_LLVM <= 0x0301
311                                   c.getDiagnosticOpts()));
312  #else
313 @@ -201,12 +219,26 @@
314  
315        llvm::PassManager PM;
316        llvm::PassManagerBuilder Builder;
317 -      bool isNative;
318 -      llvm::Linker linker("clover", mod);
319 +      llvm::sys::Path libclc_path =
320 +                            llvm::sys::Path(LIBCLC_LIBEXECDIR + triple + ".bc");
321  
322        // Link the kernel with libclc
323 -      linker.LinkInFile(llvm::sys::Path(LIBCLC_LIBEXECDIR + triple + ".bc"), isNative);
324 +#if HAVE_LLVM < 0x0303
325 +      bool isNative;
326 +      llvm::Linker linker("clover", mod);
327 +      linker.LinkInFile(libclc_path, isNative);
328        mod = linker.releaseModule();
329 +#else
330 +      std::string err_str;
331 +      llvm::SMDiagnostic err;
332 +      llvm::Module *libclc_mod = llvm::ParseIRFile(libclc_path.str(), err,
333 +                                                   mod->getContext());
334 +      if (llvm::Linker::LinkModules(mod, libclc_mod,
335 +                                    llvm::Linker::DestroySource,
336 +                                    &err_str)) {
337 +         throw build_error(err_str);
338 +      }
339 +#endif
340  
341        // Add a function internalizer pass.
342        //
343 --- ./src/gallium/drivers/r600/llvm_wrapper.cpp~        2013-06-19 12:24:15.000000000 +0200
344 +++ ./src/gallium/drivers/r600/llvm_wrapper.cpp 2013-06-19 12:29:10.363799511 +0200
345 @@ -11,6 +11,7 @@
346  #else
347  #include <llvm/IRReader/IRReader.h>
348  #include <llvm/Support/CBindingWrapping.h>
349 +#include <llvm/LinkAllIR.h>
350  #endif /* HAVE_LLVM < 0x0303 */
351  #include <llvm/Support/MemoryBuffer.h>
352  #include <llvm/Support/SourceMgr.h>
353 --- Mesa-9.1.3/src/gallium/targets/opencl/Makefile.am~  2013-03-05 23:54:28.000000000 +0100
354 +++ Mesa-9.1.3/src/gallium/targets/opencl/Makefile.am   2013-06-19 12:38:56.722221012 +0200
355 @@ -21,9 +21,9 @@
356         -lclangSema \
357         -lclangAnalysis \
358         -lclangAST \
359 +       -lclangEdit \
360         -lclangLex \
361         -lclangBasic \
362 -       -lclangEdit \
363         $(LLVM_LIBS)
364  
365  
366 --- Mesa-9.1.6/configure.ac~    2013-08-01 23:14:58.000000000 +0200
367 +++ Mesa-9.1.6/configure.ac     2013-08-02 09:44:02.661826293 +0200
368 @@ -1779,7 +1779,7 @@
369  
370  radeon_llvm_check() {
371      LLVM_REQUIRED_VERSION_MAJOR="3"
372 -    LLVM_REQUIRED_VERSION_MINOR="2"
373 +    LLVM_REQUIRED_VERSION_MINOR="3"
374      if test "$LLVM_VERSION_INT" -ne "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
375          AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR with R600 target enabled is required.
376                       To use the r600/radeonsi LLVM backend, you need to fetch the LLVM source from:
This page took 0.129838 seconds and 3 git commands to generate.