1 |
commit: 4f6e677ca64557ef18d1245a893df206ac89d735 |
2 |
Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jun 3 10:17:57 2012 +0000 |
4 |
Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jun 3 10:17:57 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/x11.git;a=commit;h=4f6e677c |
7 |
|
8 |
add few patches to make opencl work |
9 |
|
10 |
(Portage version: 2.2.0_alpha109/git/Linux x86_64, RepoMan options: --force, unsigned Manifest commit) |
11 |
|
12 |
--- |
13 |
...adeong-clover-add-clang-path-to-configure.patch | 48 ++++++++++++++++++++ |
14 |
...ncl-rename-target-from-r600-to-r600-amd-n.patch | 26 +++++++++++ |
15 |
...building-and-add-standart-locations-for-l.patch | 48 ++++++++++++++++++++ |
16 |
media-libs/mesa/mesa-9999.ebuild | 8 +++ |
17 |
4 files changed, 130 insertions(+), 0 deletions(-) |
18 |
|
19 |
diff --git a/media-libs/mesa/files/0001-radeong-clover-add-clang-path-to-configure.patch b/media-libs/mesa/files/0001-radeong-clover-add-clang-path-to-configure.patch |
20 |
new file mode 100644 |
21 |
index 0000000..bcfd425 |
22 |
--- /dev/null |
23 |
+++ b/media-libs/mesa/files/0001-radeong-clover-add-clang-path-to-configure.patch |
24 |
@@ -0,0 +1,48 @@ |
25 |
+From 932b4a03d17aad57090835d9559b99475f504d31 Mon Sep 17 00:00:00 2001 |
26 |
+From: Alexey Shvetsov <alexxy@g.o> |
27 |
+Date: Sun, 3 Jun 2012 14:05:35 +0400 |
28 |
+Subject: [PATCH 1/3] radeong/clover add clang path to configure |
29 |
+ |
30 |
+--- |
31 |
+ configure.ac | 11 +++++++++++ |
32 |
+ src/gallium/state_trackers/clover/Makefile.am | 2 +- |
33 |
+ 2 files changed, 12 insertions(+), 1 deletion(-) |
34 |
+ |
35 |
+diff --git a/configure.ac b/configure.ac |
36 |
+index fc1c28e..3414a66 100644 |
37 |
+--- a/configure.ac |
38 |
++++ b/configure.ac |
39 |
+@@ -1629,6 +1629,17 @@ AC_ARG_WITH([libclc-path], |
40 |
+ |
41 |
+ AC_SUBST([LIBCLC_PATH]) |
42 |
+ |
43 |
++dnl |
44 |
++dnl Also we need path to clang includes |
45 |
++dnl |
46 |
++ |
47 |
++AC_ARG_WITH([clang-path], |
48 |
++ [AS_HELP_STRING([--with-clang-path], |
49 |
++ [Path to clang base dir. Example: --with-clang-path=/usr/lib])], |
50 |
++ [CLANG_PATH="$withval"], |
51 |
++ [CLANG_PATH=""]) |
52 |
++AC_SUBST([CLANG_PATH]) |
53 |
++ |
54 |
+ if test "x$enable_opencl" = xyes; then |
55 |
+ if test "x$with_gallium_drivers" = x; then |
56 |
+ AC_MSG_ERROR([cannot enable OpenCL without Gallium]) |
57 |
+diff --git a/src/gallium/state_trackers/clover/Makefile.am b/src/gallium/state_trackers/clover/Makefile.am |
58 |
+index 818ced6..bc37c4e 100644 |
59 |
+--- a/src/gallium/state_trackers/clover/Makefile.am |
60 |
++++ b/src/gallium/state_trackers/clover/Makefile.am |
61 |
+@@ -24,7 +24,7 @@ libclllvm_la_CXXFLAGS = \ |
62 |
+ $(LLVM_CPPFLAGS) \ |
63 |
+ $(DEFINES) \ |
64 |
+ -DLIBCLC_PATH=\"$(LIBCLC_PATH)/\" \ |
65 |
+- -DCLANG_RESOURCE_DIR=\"$(LLVM_LIBDIR)/clang/$(LLVM_VERSION)/\" |
66 |
++ -DCLANG_RESOURCE_DIR=\"$(CLANG_PATH)/clang/$(LLVM_VERSION)/\" |
67 |
+ |
68 |
+ libclllvm_la_SOURCES = \ |
69 |
+ llvm/invocation.cpp |
70 |
+-- |
71 |
+1.7.10.2 |
72 |
+ |
73 |
|
74 |
diff --git a/media-libs/mesa/files/0002-radeong-opencl-rename-target-from-r600-to-r600-amd-n.patch b/media-libs/mesa/files/0002-radeong-opencl-rename-target-from-r600-to-r600-amd-n.patch |
75 |
new file mode 100644 |
76 |
index 0000000..2eebc9c |
77 |
--- /dev/null |
78 |
+++ b/media-libs/mesa/files/0002-radeong-opencl-rename-target-from-r600-to-r600-amd-n.patch |
79 |
@@ -0,0 +1,26 @@ |
80 |
+From 7c4d0a88c45acedfd47eba93646bf5ea7435472c Mon Sep 17 00:00:00 2001 |
81 |
+From: Alexey Shvetsov <alexxy@g.o> |
82 |
+Date: Sun, 3 Jun 2012 13:52:00 +0400 |
83 |
+Subject: [PATCH 2/3] radeong/opencl rename target from r600-- to |
84 |
+ r600-amd-none |
85 |
+ |
86 |
+--- |
87 |
+ src/gallium/drivers/r600/r600_pipe.c | 2 +- |
88 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
89 |
+ |
90 |
+diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c |
91 |
+index e0ee823..790afcc 100644 |
92 |
+--- a/src/gallium/drivers/r600/r600_pipe.c |
93 |
++++ b/src/gallium/drivers/r600/r600_pipe.c |
94 |
+@@ -582,7 +582,7 @@ static int r600_get_compute_param(struct pipe_screen *screen, |
95 |
+ switch (param) { |
96 |
+ case PIPE_COMPUTE_CAP_IR_TARGET: |
97 |
+ if (ret) { |
98 |
+- strcpy(ret, "r600--"); |
99 |
++ strcpy(ret, "r600-amd-none"); |
100 |
+ } |
101 |
+ return 7 * sizeof(char); |
102 |
+ |
103 |
+-- |
104 |
+1.7.10.2 |
105 |
+ |
106 |
|
107 |
diff --git a/media-libs/mesa/files/0003-clover-fix-building-and-add-standart-locations-for-l.patch b/media-libs/mesa/files/0003-clover-fix-building-and-add-standart-locations-for-l.patch |
108 |
new file mode 100644 |
109 |
index 0000000..3a78505 |
110 |
--- /dev/null |
111 |
+++ b/media-libs/mesa/files/0003-clover-fix-building-and-add-standart-locations-for-l.patch |
112 |
@@ -0,0 +1,48 @@ |
113 |
+From 3d4239edd2c89d3b67aef11786f0846fba96d718 Mon Sep 17 00:00:00 2001 |
114 |
+From: Alexey Shvetsov <alexxy@g.o> |
115 |
+Date: Sun, 3 Jun 2012 04:35:51 +0400 |
116 |
+Subject: [PATCH 3/3] clover fix building and add standart locations for |
117 |
+ libclc |
118 |
+ |
119 |
+--- |
120 |
+ src/gallium/state_trackers/clover/llvm/invocation.cpp | 4 ++-- |
121 |
+ src/gallium/targets/opencl/Makefile.am | 1 + |
122 |
+ 2 files changed, 3 insertions(+), 2 deletions(-) |
123 |
+ |
124 |
+diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp |
125 |
+index 27276bc..78c8670 100644 |
126 |
+--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp |
127 |
++++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp |
128 |
+@@ -107,7 +107,7 @@ namespace { |
129 |
+ c.getHeaderSearchOpts().ResourceDir = CLANG_RESOURCE_DIR; |
130 |
+ |
131 |
+ // Add libclc generic search path |
132 |
+- c.getHeaderSearchOpts().AddPath(LIBCLC_PATH "/generic/include/", |
133 |
++ c.getHeaderSearchOpts().AddPath(LIBCLC_PATH "/include/", |
134 |
+ clang::frontend::Angled, |
135 |
+ false, false, false); |
136 |
+ |
137 |
+@@ -142,7 +142,7 @@ namespace { |
138 |
+ llvm::Linker linker("clover", mod); |
139 |
+ |
140 |
+ // Link the kernel with libclc |
141 |
+- linker.LinkInFile(llvm::sys::Path(LIBCLC_PATH + triple + "/lib/builtins.bc"), isNative); |
142 |
++ linker.LinkInFile(llvm::sys::Path(LIBCLC_PATH + "/lib/clc/" +triple + "/builtins.bc"), isNative); |
143 |
+ mod = linker.releaseModule(); |
144 |
+ |
145 |
+ // Run link time optimizations |
146 |
+diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am |
147 |
+index d55b21e..4c89e36 100644 |
148 |
+--- a/src/gallium/targets/opencl/Makefile.am |
149 |
++++ b/src/gallium/targets/opencl/Makefile.am |
150 |
+@@ -3,6 +3,7 @@ AUTOMAKE_OPTIONS = subdir-objects |
151 |
+ lib_LTLIBRARIES = libOpenCL.la |
152 |
+ |
153 |
+ libOpenCL_la_LDFLAGS = \ |
154 |
++ $(LLVM_LDFLAGS) \ |
155 |
+ -version-number 1:0 |
156 |
+ |
157 |
+ libOpenCL_la_LIBADD = \ |
158 |
+-- |
159 |
+1.7.10.2 |
160 |
+ |
161 |
|
162 |
diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild |
163 |
index 7e39bae..46d4861 100644 |
164 |
--- a/media-libs/mesa/mesa-9999.ebuild |
165 |
+++ b/media-libs/mesa/mesa-9999.ebuild |
166 |
@@ -147,6 +147,12 @@ DEPEND="${RDEPEND} |
167 |
|
168 |
S="${WORKDIR}/${MY_P}" |
169 |
|
170 |
+PATCHES=( |
171 |
+ "${FILESDIR}/0001-radeong-clover-add-clang-path-to-configure.patch" |
172 |
+ "${FILESDIR}/0002-radeong-opencl-rename-target-from-r600-to-r600-amd-n.patch" |
173 |
+ "${FILESDIR}/0003-clover-fix-building-and-add-standart-locations-for-l.patch" |
174 |
+ ) |
175 |
+ |
176 |
# It is slow without texrels, if someone wants slow |
177 |
# mesa without texrels +pic use is worth the shot |
178 |
QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*" |
179 |
@@ -256,6 +262,8 @@ src_configure() { |
180 |
myconf+=" |
181 |
$(use_enable opencl) |
182 |
--with-opencl-libdir="${EPREFIX}/usr/$(get_libdir)/OpenCL/vendors/mesa" |
183 |
+ --with-libclc-path="${EPREFIX}/usr" |
184 |
+ --with-clang-path="${EPREFIX}/usr/$(get_libdir)" |
185 |
" |
186 |
fi |
187 |
fi |