[packages/Mesa] - updated to 9.0.2 - updated link patch - added llvm3.2-support patch (libclc, which is now required

qboosh qboosh at pld-linux.org
Sat Jan 26 11:28:51 CET 2013


commit bec14093048eeb512d931d56bacc8e51f62ae9f5
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Jan 26 11:29:36 2013 +0100

    - updated to 9.0.2
    - updated link patch
    - added llvm3.2-support patch (libclc, which is now required, needs llvm 3.2+,
      so we want to use llvm 3.2 instead of 3.1 for Mesa too)

 Mesa-link.patch            | 106 ++++++++---------
 Mesa-llvm3.2-support.patch | 282 +++++++++++++++++++++++++++++++++++++++++++++
 Mesa.spec                  |  10 +-
 3 files changed, 342 insertions(+), 56 deletions(-)
---
diff --git a/Mesa.spec b/Mesa.spec
index 4bdb046..1615f93 100644
--- a/Mesa.spec
+++ b/Mesa.spec
@@ -31,13 +31,14 @@
 Summary:	Free OpenGL implementation
 Summary(pl.UTF-8):	Wolnodostępna implementacja standardu OpenGL
 Name:		Mesa
-Version:	9.0.1
-Release:	2
+Version:	9.0.2
+Release:	1
 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
-# Source0-md5:	97d6554c05ea7449398afe3a0ede7018
+# Source0-md5:	dc45d1192203e418163e0017640e1cfc
 Patch0:		%{name}-link.patch
+Patch1:		%{name}-llvm3.2-support.patch
 URL:		http://www.mesa3d.org/
 BuildRequires:	autoconf >= 2.60
 BuildRequires:	automake
@@ -53,6 +54,7 @@ BuildRequires:	libtool >= 2:2.2
 BuildRequires:	libvdpau-devel >= 0.4.1
 BuildRequires:	libxcb-devel >= 1.9
 BuildRequires:	llvm-devel >= 3.1
+%{?with_opencl:BuildRequires:	llvm-libclc}
 BuildRequires:	perl-base
 BuildRequires:	pixman-devel
 BuildRequires:	pkgconfig
@@ -359,6 +361,7 @@ Summary(pl.UTF-8):	Implementacja Mesa API OpenCL (języka obliczeń)
 License:	MIT
 Group:		Libraries
 Requires:	libdrm >= %{libdrm_ver}
+Requires:	llvm-libclc
 Requires:	udev-libs >= 1:150
 Provides:	OpenCL = 1.1
 
@@ -1062,6 +1065,7 @@ Sterownik Mesa softpipe dla API vdpau.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{__libtoolize}
diff --git a/Mesa-link.patch b/Mesa-link.patch
index 471bb42..fc7fc01 100644
--- a/Mesa-link.patch
+++ b/Mesa-link.patch
@@ -9,6 +9,50 @@
  
  LINK_WITH_CXX=1
  
+--- Mesa-9.0.2/src/gallium/targets/vdpau-r300/Makefile.orig	2013-01-26 10:33:04.632271133 +0100
++++ Mesa-9.0.2/src/gallium/targets/vdpau-r300/Makefile	2013-01-26 10:37:16.755599223 +0100
+@@ -21,7 +21,7 @@
+ 	$(COMMON_GALLIUM_SOURCES) \
+ 	$(DRIVER_SOURCES)
+ 
+-DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes
++DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes -lxcb
+ 
+ include ../Makefile.vdpau
+ 
+--- Mesa-9.0.2/src/gallium/targets/vdpau-r600/Makefile.orig	2013-01-26 10:33:04.635604465 +0100
++++ Mesa-9.0.2/src/gallium/targets/vdpau-r600/Makefile	2013-01-26 10:38:39.152264160 +0100
+@@ -17,7 +17,7 @@
+ 	$(COMMON_GALLIUM_SOURCES) \
+ 	$(DRIVER_SOURCES)
+ 
+-DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes
++DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes -lxcb
+ 
+ include ../Makefile.vdpau
+ 
+--- Mesa-9.0.2/src/gallium/targets/vdpau-radeonsi/Makefile.orig	2013-01-26 10:33:04.638937797 +0100
++++ Mesa-9.0.2/src/gallium/targets/vdpau-radeonsi/Makefile	2013-01-26 10:39:56.732262545 +0100
+@@ -23,7 +23,7 @@
+ DRIVER_DEFINES = \
+ 	-DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_NOOP
+ 
+-DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes
++DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes -lxcb
+ 
+ include ../Makefile.vdpau
+ 
+--- p/src/gallium/targets/vdpau-softpipe/Makefile~	2012-05-10 22:56:51.000000000 +0200
++++ p/src/gallium/targets/vdpau-softpipe/Makefile	2012-05-11 09:27:05.364159093 +0200
+@@ -14,7 +14,7 @@
+ C_SOURCES = \
+ 	$(TOP)/src/gallium/auxiliary/vl/vl_winsys_xsp.c
+ 
+-DRIVER_LIBS =
++DRIVER_LIBS = -lX11 -lXext
+ 
+ include ../Makefile.vdpau
+
 --- Mesa-9.0.1/src/gallium/targets/xvmc-nouveau/Makefile.orig	2012-09-01 01:33:41.000000000 +0200
 +++ Mesa-9.0.1/src/gallium/targets/xvmc-nouveau/Makefile	2012-11-21 19:29:27.218929817 +0100
 @@ -5,6 +5,7 @@
@@ -28,25 +72,25 @@
  
  DRIVER_INCLUDES = $(shell $(PKG_CONFIG) libdrm --cflags-only-I)
  
---- Mesa-8.0.1/src/gallium/targets/xvmc-r300/Makefile.orig	2012-02-15 00:44:00.000000000 +0100
-+++ Mesa-8.0.1/src/gallium/targets/xvmc-r300/Makefile	2012-03-11 12:34:46.519728247 +0100
+--- Mesa-9.0.2/src/gallium/targets/xvmc-r300/Makefile.orig	2013-01-26 10:33:04.628937800 +0100
++++ Mesa-9.0.2/src/gallium/targets/xvmc-r300/Makefile	2013-01-26 10:36:06.578934005 +0100
 @@ -17,7 +17,7 @@
  	$(COMMON_GALLIUM_SOURCES) \
  	$(DRIVER_SOURCES)
  
--DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon
-+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -lXvMC -ldrm_radeon -lX11 -lxcb
+-DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes
++DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes -lXvMC -lX11 -lxcb
  
  include ../Makefile.xvmc
  
---- Mesa-8.0.1/src/gallium/targets/xvmc-r600/Makefile.orig	2012-02-15 00:44:00.000000000 +0100
-+++ Mesa-8.0.1/src/gallium/targets/xvmc-r600/Makefile	2012-03-11 12:35:23.323061190 +0100
+--- Mesa-9.0.2/src/gallium/targets/xvmc-r600/Makefile.orig	2013-01-26 10:33:04.632271133 +0100
++++ Mesa-9.0.2/src/gallium/targets/xvmc-r600/Makefile	2013-01-26 10:36:34.075600100 +0100
 @@ -17,7 +17,7 @@
  	$(COMMON_GALLIUM_SOURCES) \
  	$(DRIVER_SOURCES)
  
--DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon
-+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -lXvMC -ldrm_radeon -lX11 -lxcb
+-DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes
++DRIVER_LIBS = $(LIBDRM_LIBS) $(RADEON_LIBS) -lXfixes -lXvMC -lX11 -lxcb
  
  include ../Makefile.xvmc
  
@@ -83,50 +127,6 @@
  # xa pkgconfig file
  pcedit = sed \
 
---- m/src/gallium/targets/vdpau-r300/Makefile~	2012-05-10 22:56:51.000000000 +0200
-+++ m/src/gallium/targets/vdpau-r300/Makefile	2012-05-11 09:25:42.791993195 +0200
-@@ -21,7 +21,7 @@
- 	$(COMMON_GALLIUM_SOURCES) \
- 	$(DRIVER_SOURCES)
- 
--DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon
-+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon -lxcb
- 
- include ../Makefile.vdpau
-
---- m/src/gallium/targets/vdpau-r600/Makefile~	2012-05-10 22:56:51.000000000 +0200
-+++ m/src/gallium/targets/vdpau-r600/Makefile	2012-05-11 09:26:14.899501899 +0200
-@@ -17,7 +17,7 @@
- 	$(COMMON_GALLIUM_SOURCES) \
- 	$(DRIVER_SOURCES)
- 
--DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon
-+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon -lxcb
- 
- include ../Makefile.vdpau
- 
---- p/src/gallium/targets/vdpau-softpipe/Makefile~	2012-05-10 22:56:51.000000000 +0200
-+++ p/src/gallium/targets/vdpau-softpipe/Makefile	2012-05-11 09:27:05.364159093 +0200
-@@ -14,7 +14,7 @@
- C_SOURCES = \
- 	$(TOP)/src/gallium/auxiliary/vl/vl_winsys_xsp.c
- 
--DRIVER_LIBS =
-+DRIVER_LIBS = -lX11 -lXext
- 
- include ../Makefile.vdpau
-
---- p/src/gallium/targets/vdpau-radeonsi/Makefile~	2012-08-06 18:56:40.000000000 +0200
-+++ p/src/gallium/targets/vdpau-radeonsi/Makefile	2012-09-07 22:44:07.304997361 +0200
-@@ -23,7 +23,7 @@
- DRIVER_DEFINES = \
- 	-DGALLIUM_RBUG -DGALLIUM_TRACE -DGALLIUM_NOOP
- 
--DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon
-+DRIVER_LIBS = $(shell $(PKG_CONFIG) libdrm --libs) -lXfixes -ldrm_radeon -lxcb
- 
- include ../Makefile.vdpau
- 
 --- p/src/mesa/libdricore/Makefile.am~	2012-08-26 21:00:26.000000000 +0200
 +++ p/src/mesa/libdricore/Makefile.am	2012-09-07 22:45:58.210981683 +0200
 @@ -46,7 +46,7 @@
@@ -134,7 +134,7 @@
  	$(top_builddir)/src/glsl/builtin_function.cpp
  libdricore at VERSION@_la_LDFLAGS = -version-number 1:0
 -libdricore at VERSION@_la_LIBADD = libdricore-asm.la
-+libdricore at VERSION@_la_LIBADD = libdricore-asm.la -ldl
++libdricore at VERSION@_la_LIBADD = libdricore-asm.la $(DLOPEN_LIBS)
  
  # This is separated from libdricore to avoid conflics in object
  # outputs between main/clip.c and sparc/clip.c.  The documented way to
diff --git a/Mesa-llvm3.2-support.patch b/Mesa-llvm3.2-support.patch
new file mode 100644
index 0000000..84e8e1f
--- /dev/null
+++ b/Mesa-llvm3.2-support.patch
@@ -0,0 +1,282 @@
+From: Tom Stellard <thomas.stell... at amd.com>
+
+LLVM 3.2 and newer requires that the R600/SI backend be part of the
+LLVM tree.
+---
+ configure.ac                                    | 26 +++++++++++++++++++------
+ src/gallium/drivers/radeon/Makefile             |  6 ++++++
+ src/gallium/drivers/radeon/Makefile.sources     |  7 ++++---
+ src/gallium/drivers/radeon/radeon_llvm_emit.cpp |  1 +
+ 4 files changed, 31 insertions(+), 9 deletions(-)</pre><pre>
+
+diff --git a/configure.ac b/configure.ac
+index b83078f..a942621 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1667,6 +1667,7 @@
+             if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
+                 LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
+             fi
++            LLVM_COMPONENTS="${LLVM_COMPONENTS} all-targets"
+             if test "x$enable_opencl" = xyes; then
+                 LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
+             fi
+@@ -1788,6 +1789,23 @@
+     fi
+ }
+ 
++radeon_llvm_check() {
++    LLVM_VERSION_MAJOR=`echo $LLVM_VERSION | cut -d. -f1`
++    if test "$LLVM_VERSION_MAJOR" -lt "3" -o "x$LLVM_VERSION" = "x3.0"; then
++        AC_MSG_ERROR([LLVM 3.1 or newer is required for the r600/radeonsi llvm compiler.])
++    fi
++    if test "$LLVM_VERSION_MAJOR" -ge "3" -a "x$LLVM_VERSION" != "x3.1" && $LLVM_CONFIG --targets-built | grep -qv '\<AMDGPU\>' ; then
++        AC_MSG_ERROR([To use the r600/radeonsi LLVM backend with LLVM 3.2 and newer, you need to fetch the LLVM source from:
++                      git://people.freedesktop.org/~tstellar/llvm master
++                      and build with --enable-experimental-targets==AMDGPU])
++    fi
++    if test "$LLVM_VERSION" = "3.2"; then
++        dnl LLVM 3.2 does not add experimental libraries to llvm-config's
++        dnl library list.
++        LLVM_LIBS="$LLVM_LIBS -lLLVMAMDGPUCodeGen -lLLVMAMDGPUDesc -lLLVMAMDGPUAsmPrinter -lLLVMAMDGPUInfo `$LLVM_CONFIG --libs mc`"
++    fi
++}
++
+ dnl Gallium drivers
+ dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
+ if test "x$with_gallium_drivers" != x; then
+@@ -1818,9 +1836,7 @@
+             gallium_require_drm_loader
+             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
+             if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
+-                if test "x$LLVM_VERSION" != "x3.1"; then
+-                    AC_MSG_ERROR([LLVM 3.1 is required for the r600 llvm compiler.])
+-                fi
++                radeon_llvm_check
+                 NEED_RADEON_GALLIUM=yes;
+             fi
+             if test "x$enable_r600_llvm" = xyes; then
+@@ -1835,9 +1851,7 @@
+             PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
+             gallium_require_drm_loader
+             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
+-            if test "x$LLVM_VERSION" != "x3.1"; then
+-                AC_MSG_ERROR([LLVM 3.1 is required to build the radeonsi driver.])
+-            fi
++	    radeon_llvm_check
+ 	    NEED_RADEON_GALLIUM=yes;
+             gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
+             ;;
+diff --git a/src/gallium/drivers/radeon/Makefile b/src/gallium/drivers/radeon/Makefile
+index 7f1c613..bcc2646 100644
+--- a/src/gallium/drivers/radeon/Makefile
++++ b/src/gallium/drivers/radeon/Makefile
+@@ -12,6 +12,12 @@ TBLGEN = $(LLVM_BINDIR)/llvm-tblgen
+ 
+ CXXFLAGS+= $(LLVM_CXXFLAGS)
+ 
++ifeq ($(LLVM_VERSION),3.1)
++       CPP_SOURCES += $(LLVM_CPP_SOURCES)
++else
++       CXXFLAGS+= -DEXTERNAL_LLVM
++endif
++
+ include ../../Makefile.template
+ 
+ CXXFLAGS := $(filter-out -DDEBUG, $(CXXFLAGS))
+diff --git a/src/gallium/drivers/radeon/Makefile.sources b/src/gallium/drivers/radeon/Makefile.sources
+index c5d1207..5e79342 100644
+--- a/src/gallium/drivers/radeon/Makefile.sources
++++ b/src/gallium/drivers/radeon/Makefile.sources
+@@ -24,7 +24,7 @@
+ 	SISchedule.td
+ 
+ 
+-GENERATED_SOURCES := \
++LLVM_GENERATED_SOURCES := \
+ 	R600Intrinsics.td		\
+ 	R600RegisterInfo.td		\
+ 	SIRegisterInfo.td		\
+@@ -41,7 +41,7 @@
+ 	AMDGPUGenMCCodeEmitter.inc	\
+ 	AMDGPUGenDFAPacketizer.inc
+ 
+-CPP_SOURCES := \
++LLVM_CPP_SOURCES := \
+ 	AMDIL7XXDevice.cpp		\
+ 	AMDILCFGStructurizer.cpp	\
+ 	AMDILDevice.cpp			\
+@@ -80,6 +80,8 @@
+ 	MCTargetDesc/SIMCCodeEmitter.cpp \
+ 	MCTargetDesc/R600MCCodeEmitter.cpp \
+ 	TargetInfo/AMDGPUTargetInfo.cpp	\
++
++CPP_SOURCES := \
+ 	radeon_llvm_emit.cpp
+ 
+ C_SOURCES := \
+diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
+index 1b67bfe..625b0b4 100644
+--- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
++++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
+@@ -90,6 +90,7 @@ radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes,
+    /* XXX: Can we just initialize the AMDGPU target here? */
+    InitializeAllTargets();
+    InitializeAllTargetMCs();
++   InitializeAllAsmPrinters();
+ #else
+    LLVMInitializeAMDGPUTargetInfo();
+    LLVMInitializeAMDGPUTarget();
+-- 
+1.7.11.4
+Adjusted hacks for R600 rename
+
+---
+ configure.ac                                    | 12 ++++++------
+ src/gallium/drivers/radeon/radeon_llvm_emit.cpp |  7 +++++++
+ 2 files changed, 13 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 228f464..b848503 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1794,15 +1794,15 @@
+     if test "$LLVM_VERSION_MAJOR" -lt "3" -o "x$LLVM_VERSION" = "x3.0"; then
+         AC_MSG_ERROR([LLVM 3.1 or newer is required for the r600/radeonsi llvm compiler.])
+     fi
+-    if test "$LLVM_VERSION_MAJOR" -ge "3" -a "x$LLVM_VERSION" != "x3.1" && $LLVM_CONFIG --targets-built | grep -qv '\<AMDGPU\>' ; then
++    if test "$LLVM_VERSION_MAJOR" -ge "3" -a "x$LLVM_VERSION" != "x3.1" && $LLVM_CONFIG --targets-built | grep -qv '\<R600\>' ; then
+         AC_MSG_ERROR([To use the r600/radeonsi LLVM backend with LLVM 3.2 and newer, you need to fetch the LLVM source from:
+                       git://people.freedesktop.org/~tstellar/llvm master
+-                      and build with --enable-experimental-targets==AMDGPU])
++                      and build with --enable-experimental-targets=R600])
+     fi
+     if test "$LLVM_VERSION" = "3.2"; then
+         dnl LLVM 3.2 does not add experimental libraries to llvm-config's
+         dnl library list.
+-        LLVM_LIBS="$LLVM_LIBS -lLLVMAMDGPUCodeGen -lLLVMAMDGPUDesc -lLLVMAMDGPUAsmPrinter -lLLVMAMDGPUInfo `$LLVM_CONFIG --libs mc`"
++        LLVM_LIBS="$LLVM_LIBS `$LLVM_CONFIG --libs R600`"
+     fi
+ }
+ 
+diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
+index 21661a0..9914228 100644
+--- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
++++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp
+@@ -86,17 +86,11 @@
+ 
+    Triple AMDGPUTriple(sys::getDefaultTargetTriple());
+ 
+-#ifdef EXTERNAL_LLVM
+-   /* XXX: Can we just initialize the AMDGPU target here? */
+-   InitializeAllTargets();
+-   InitializeAllTargetMCs();
+-   InitializeAllAsmPrinters();
+-#else
+-   LLVMInitializeAMDGPUTargetInfo();
+-   LLVMInitializeAMDGPUTarget();
+-   LLVMInitializeAMDGPUTargetMC();
+-   LLVMInitializeAMDGPUAsmPrinter();
+-#endif
++   LLVMInitializeR600TargetInfo();
++   LLVMInitializeR600Target();
++   LLVMInitializeR600TargetMC();
++   LLVMInitializeR600AsmPrinter();
++
+    std::string err;
+    const Target * AMDGPUTarget = TargetRegistry::lookupTarget("r600", err);
+    if(!AMDGPUTarget) {
+-- 
+1.7.11.4
+--- Mesa-9.0.2/src/gallium/drivers/radeon/radeon_llvm_emit.cpp.orig	2013-01-25 22:40:57.939828359 +0100
++++ Mesa-9.0.2/src/gallium/drivers/radeon/radeon_llvm_emit.cpp	2013-01-26 07:58:59.045797173 +0100
+@@ -36,12 +36,14 @@
+ #include <llvm/Support/TargetRegistry.h>
+ #include <llvm/Support/TargetSelect.h>
+ #include <llvm/Support/Threading.h>
+-#include <llvm/Target/TargetData.h>
+ #include <llvm/Target/TargetMachine.h>
+-
+ #include <llvm/Transforms/Scalar.h>
+-
+ #include <llvm-c/Target.h>
++#if HAVE_LLVM < 0x0302
++#include <llvm/Target/TargetData.h>
++#else
++#include <llvm/DataLayout.h>
++#endif
+ 
+ #include <iostream>
+ #include <stdlib.h>
+@@ -120,7 +122,11 @@
+                      ));
+    TargetMachine &AMDGPUTargetMachine = *tm.get();
+    PassManager PM;
++#if HAVE_LLVM < 0x0302
+    PM.add(new TargetData(*AMDGPUTargetMachine.getTargetData()));
++#else
++   PM.add(new DataLayout(*AMDGPUTargetMachine.getDataLayout()));
++#endif
+    PM.add(createPromoteMemoryToRegisterPass());
+    AMDGPUTargetMachine.setAsmVerbosityDefault(true);
+ 
+--- Mesa-9.0.2/src/gallium/state_trackers/clover/llvm/invocation.cpp.orig	2013-01-22 19:09:32.000000000 +0100
++++ Mesa-9.0.2/src/gallium/state_trackers/clover/llvm/invocation.cpp	2013-01-26 08:53:17.405729259 +0100
+@@ -35,9 +35,13 @@
+ #include <llvm/Support/TargetSelect.h>
+ #include <llvm/Support/MemoryBuffer.h>
+ #include <llvm/Support/PathV1.h>
+-#include <llvm/Target/TargetData.h>
+ #include <llvm/Transforms/IPO.h>
+ #include <llvm/Transforms/IPO/PassManagerBuilder.h>
++#if HAVE_LLVM < 0x0302
++#include <llvm/Target/TargetData.h>
++#else
++#include <llvm/DataLayout.h>
++#endif
+ 
+ #include "pipe/p_state.h"
+ #include "util/u_memory.h"
+@@ -120,9 +124,19 @@
+ 
+       c.getLangOpts().NoBuiltin = true;
+       c.getTargetOpts().Triple = triple;
++#if HAVE_LLVM < 0x0302
+       c.getInvocation().setLangDefaults(clang::IK_OpenCL);
++#else
++      c.getInvocation().setLangDefaults(c.getLangOpts(), clang::IK_OpenCL, clang::LangStandard::lang_opencl11);
++#endif
+       c.createDiagnostics(0, NULL, new clang::TextDiagnosticPrinter(
+-                          s_log, c.getDiagnosticOpts()));
++                          s_log,
++#if HAVE_LLVM < 0x0302
++			  c.getDiagnosticOpts()
++#else
++			  &c.getDiagnosticOpts()
++#endif
++			  ));
+ 
+       c.getPreprocessorOpts().addRemappedFile(name,
+                                       llvm::MemoryBuffer::getMemBuffer(source));
+@@ -213,7 +227,11 @@
+                                    E = kernel_func->arg_end(); I != E; ++I) {
+          llvm::Argument &arg = *I;
+          llvm::Type *arg_type = arg.getType();
++#if HAVE_LLVM < 0x0302
+          llvm::TargetData TD(kernel_func->getParent());
++#else
++         llvm::DataLayout TD(kernel_func->getParent()->getDataLayout());
++#endif
+          unsigned arg_size = TD.getTypeStoreSize(arg_type);
+ 
+          if (llvm::isa<llvm::PointerType>(arg_type) && arg.hasByValAttr()) {
+--- Mesa-9.0.2/src/gallium/targets/opencl/Makefile.am.orig	2013-01-22 19:09:32.000000000 +0100
++++ Mesa-9.0.2/src/gallium/targets/opencl/Makefile.am	2013-01-26 09:32:36.189013426 +0100
+@@ -20,7 +20,6 @@
+ 	-lclangParse \
+ 	-lclangSema \
+ 	-lclangAnalysis \
+-	-lclangRewrite \
+ 	-lclangAST \
+ 	-lclangLex \
+ 	-lclangBasic \
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list