[packages/Mesa] - rel 2; fix build with llvm 3.3 (final)

arekm arekm at pld-linux.org
Wed Jun 19 12:35:07 CEST 2013


commit 49e00572d120ccb163b37283a8af53c8899cc3dc
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Jun 19 12:35:03 2013 +0200

    - rel 2; fix build with llvm 3.3 (final)

 Mesa-llvm.patch | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Mesa.spec       |   2 +-
 2 files changed, 103 insertions(+), 1 deletion(-)
---
diff --git a/Mesa.spec b/Mesa.spec
index d372422..fe49d54 100644
--- a/Mesa.spec
+++ b/Mesa.spec
@@ -33,7 +33,7 @@ Summary:	Free OpenGL implementation
 Summary(pl.UTF-8):	Wolnodostępna implementacja standardu OpenGL
 Name:		Mesa
 Version:	9.1.3
-Release:	1
+Release:	2
 License:	MIT (core) and others - see license.html file
 Group:		X11/Libraries
 Source0:	ftp://ftp.freedesktop.org/pub/mesa/%{version}/%{name}Lib-%{version}.tar.bz2
diff --git a/Mesa-llvm.patch b/Mesa-llvm.patch
index 3c7f4f8..ea4095f 100644
--- a/Mesa-llvm.patch
+++ b/Mesa-llvm.patch
@@ -299,3 +299,105 @@ index 86617d4..1c886ea 100644
     OwningPtr<const MCAsmInfo> AsmInfo(T->createAsmInfo(Triple));
 -- 
 1.8.2.1
+--- x/src/gallium/state_trackers/clover/llvm/invocation.cpp.org	2013-06-19 12:06:31.055563544 +0200
++++ x/src/gallium/state_trackers/clover/llvm/invocation.cpp	2013-06-19 12:16:58.645029877 +0200
+@@ -28,10 +28,18 @@
+ #include <clang/CodeGen/CodeGenAction.h>
+ #include <llvm/Bitcode/BitstreamWriter.h>
+ #include <llvm/Bitcode/ReaderWriter.h>
++#if HAVE_LLVM < 0x0303
+ #include <llvm/DerivedTypes.h>
+-#include <llvm/Linker.h>
+ #include <llvm/LLVMContext.h>
+ #include <llvm/Module.h>
++#else
++#include <llvm/IR/DerivedTypes.h>
++#include <llvm/IR/LLVMContext.h>
++#include <llvm/IR/Module.h>
++#include <llvm/Support/SourceMgr.h>
++#include <llvm/IRReader/IRReader.h>
++#endif
++#include <llvm/Linker.h>
+ #include <llvm/PassManager.h>
+ #include <llvm/Support/TargetSelect.h>
+ #include <llvm/Support/MemoryBuffer.h>
+@@ -41,8 +49,10 @@
+ 
+ #if HAVE_LLVM < 0x0302
+ #include <llvm/Target/TargetData.h>
+-#else
++#elif HAVE_LLVM < 0x0303
+ #include <llvm/DataLayout.h>
++#else
++#include <llvm/IR/DataLayout.h>
+ #endif
+ 
+ #include "pipe/p_state.h"
+@@ -151,7 +161,11 @@
+       // Add libclc generic search path
+       c.getHeaderSearchOpts().AddPath(LIBCLC_INCLUDEDIR,
+                                       clang::frontend::Angled,
+-                                      false, false, false);
++                                      false, false
++#if HAVE_LLVM < 0x0303
++                                      , false
++#endif
++                                      );
+ 
+       // Add libclc include
+       c.getPreprocessorOpts().Includes.push_back("clc/clc.h");
+@@ -167,8 +181,12 @@
+       c.getInvocation().setLangDefaults(c.getLangOpts(), clang::IK_OpenCL,
+                                         clang::LangStandard::lang_opencl11);
+ #endif
+-      c.createDiagnostics(0, NULL, new clang::TextDiagnosticPrinter(
+-                          s_log,
++      c.createDiagnostics(
++#if HAVE_LLVM < 0x0303
++                          0, NULL,
++#endif
++                          new clang::TextDiagnosticPrinter(
++                                 s_log,
+ #if HAVE_LLVM <= 0x0301
+                                  c.getDiagnosticOpts()));
+ #else
+@@ -201,12 +219,26 @@
+ 
+       llvm::PassManager PM;
+       llvm::PassManagerBuilder Builder;
+-      bool isNative;
+-      llvm::Linker linker("clover", mod);
++      llvm::sys::Path libclc_path =
++                            llvm::sys::Path(LIBCLC_LIBEXECDIR + triple + ".bc");
+ 
+       // Link the kernel with libclc
+-      linker.LinkInFile(llvm::sys::Path(LIBCLC_LIBEXECDIR + triple + ".bc"), isNative);
++#if HAVE_LLVM < 0x0303
++      bool isNative;
++      llvm::Linker linker("clover", mod);
++      linker.LinkInFile(libclc_path, isNative);
+       mod = linker.releaseModule();
++#else
++      std::string err_str;
++      llvm::SMDiagnostic err;
++      llvm::Module *libclc_mod = llvm::ParseIRFile(libclc_path.str(), err,
++                                                   mod->getContext());
++      if (llvm::Linker::LinkModules(mod, libclc_mod,
++                                    llvm::Linker::DestroySource,
++                                    &err_str)) {
++         throw build_error(err_str);
++      }
++#endif
+ 
+       // Add a function internalizer pass.
+       //
+--- ./src/gallium/drivers/r600/llvm_wrapper.cpp~	2013-06-19 12:24:15.000000000 +0200
++++ ./src/gallium/drivers/r600/llvm_wrapper.cpp	2013-06-19 12:29:10.363799511 +0200
+@@ -11,6 +11,7 @@
+ #else
+ #include <llvm/IRReader/IRReader.h>
+ #include <llvm/Support/CBindingWrapping.h>
++#include <llvm/LinkAllIR.h>
+ #endif /* HAVE_LLVM < 0x0303 */
+ #include <llvm/Support/MemoryBuffer.h>
+ #include <llvm/Support/SourceMgr.h>
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/Mesa.git/commitdiff/49e00572d120ccb163b37283a8af53c8899cc3dc



More information about the pld-cvs-commit mailing list