1 |
commit: 210c89aa96a37f55c74cc4691ff1e4eaf1c1737c |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 2 16:15:23 2012 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 2 16:15:23 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/x11.git;a=commit;h=210c89aa |
7 |
|
8 |
sys-devel/llvm: Add a patched version of LLVM-3.1 for r600 OpenCL. |
9 |
|
10 |
(Portage version: 2.2.0_alpha108_p12/git/Linux x86_64, unsigned Manifest commit) |
11 |
|
12 |
--- |
13 |
.../0001-r600-Add-some-intrinsic-definitions.patch | 64 +++++++ |
14 |
...t_global_size-and-get_local_size-intrinsi.patch | 27 +++ |
15 |
.../llvm/files/llvm-2.6-commandguide-nops.patch | 30 ++++ |
16 |
sys-devel/llvm/files/llvm-2.9-nodoctargz.patch | 39 +++++ |
17 |
sys-devel/llvm/files/llvm-3.0-PPC_macro.patch | 43 +++++ |
18 |
sys-devel/llvm/llvm-3.1.ebuild | 180 ++++++++++++++++++++ |
19 |
sys-devel/llvm/metadata.xml | 22 +++ |
20 |
7 files changed, 405 insertions(+), 0 deletions(-) |
21 |
|
22 |
diff --git a/sys-devel/llvm/files/cl-patches/0001-r600-Add-some-intrinsic-definitions.patch b/sys-devel/llvm/files/cl-patches/0001-r600-Add-some-intrinsic-definitions.patch |
23 |
new file mode 100644 |
24 |
index 0000000..9d99c9c |
25 |
--- /dev/null |
26 |
+++ b/sys-devel/llvm/files/cl-patches/0001-r600-Add-some-intrinsic-definitions.patch |
27 |
@@ -0,0 +1,64 @@ |
28 |
+From e25389b66b5ced3a2b5461077dcc9a505d334e3d Mon Sep 17 00:00:00 2001 |
29 |
+From: Tom Stellard <thomas.stellard@×××.com> |
30 |
+Date: Tue, 13 Mar 2012 14:12:21 -0400 |
31 |
+Subject: [PATCH 1/2] r600: Add some intrinsic definitions |
32 |
+ |
33 |
+--- |
34 |
+ include/llvm/Intrinsics.td | 1 + |
35 |
+ include/llvm/IntrinsicsR600.td | 35 +++++++++++++++++++++++++++++++++++ |
36 |
+ 2 files changed, 36 insertions(+), 0 deletions(-) |
37 |
+ create mode 100644 include/llvm/IntrinsicsR600.td |
38 |
+ |
39 |
+diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td |
40 |
+index 069f907..e90dd85 100644 |
41 |
+--- a/include/llvm/Intrinsics.td |
42 |
++++ b/include/llvm/Intrinsics.td |
43 |
+@@ -441,3 +441,4 @@ include "llvm/IntrinsicsCellSPU.td" |
44 |
+ include "llvm/IntrinsicsXCore.td" |
45 |
+ include "llvm/IntrinsicsPTX.td" |
46 |
+ include "llvm/IntrinsicsHexagon.td" |
47 |
++include "llvm/IntrinsicsR600.td" |
48 |
+diff --git a/include/llvm/IntrinsicsR600.td b/include/llvm/IntrinsicsR600.td |
49 |
+new file mode 100644 |
50 |
+index 0000000..789fecb |
51 |
+--- /dev/null |
52 |
++++ b/include/llvm/IntrinsicsR600.td |
53 |
+@@ -0,0 +1,35 @@ |
54 |
++//===- IntrinsicsR600.td - Defines R600 intrinsics ---------*- tablegen -*-===// |
55 |
++// |
56 |
++// The LLVM Compiler Infrastructure |
57 |
++// |
58 |
++// This file is distributed under the University of Illinois Open Source |
59 |
++// License. See LICENSE.TXT for details. |
60 |
++// |
61 |
++//===----------------------------------------------------------------------===// |
62 |
++// |
63 |
++// This file defines all of the R600-specific intrinsics. |
64 |
++// |
65 |
++//===----------------------------------------------------------------------===// |
66 |
++// |
67 |
++// Authors: Tom Stellard <thomas.stellard@×××.com> |
68 |
++// |
69 |
++ |
70 |
++let TargetPrefix = "r600" in { |
71 |
++ |
72 |
++class R600ReadPreloadRegisterIntrinsic<string name> |
73 |
++ : Intrinsic<[llvm_i32_ty], [], [IntrNoMem]>, |
74 |
++ GCCBuiltin<name>; |
75 |
++ |
76 |
++multiclass R600ReadPreloadRegisterIntrinsic_xyz<string prefix> { |
77 |
++ def _x : R600ReadPreloadRegisterIntrinsic<!strconcat(prefix, "_x")>; |
78 |
++ def _y : R600ReadPreloadRegisterIntrinsic<!strconcat(prefix, "_y")>; |
79 |
++ def _z : R600ReadPreloadRegisterIntrinsic<!strconcat(prefix, "_z")>; |
80 |
++} |
81 |
++ |
82 |
++defm int_r600_read_ngroups : R600ReadPreloadRegisterIntrinsic_xyz < |
83 |
++ "__builtin_r600_read_ngroups">; |
84 |
++defm int_r600_read_tgid : R600ReadPreloadRegisterIntrinsic_xyz < |
85 |
++ "__builtin_r600_read_tgid">; |
86 |
++defm int_r600_read_tidig : R600ReadPreloadRegisterIntrinsic_xyz < |
87 |
++ "__builtin_r600_read_tidig">; |
88 |
++} // End TargetPrefix = "r600" |
89 |
+-- |
90 |
+1.7.7.6 |
91 |
+ |
92 |
|
93 |
diff --git a/sys-devel/llvm/files/cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch b/sys-devel/llvm/files/cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch |
94 |
new file mode 100644 |
95 |
index 0000000..db176dd |
96 |
--- /dev/null |
97 |
+++ b/sys-devel/llvm/files/cl-patches/0002-r600-Add-get_global_size-and-get_local_size-intrinsi.patch |
98 |
@@ -0,0 +1,27 @@ |
99 |
+From 17667fa3450470f7c89fc2ba4631d908cf510749 Mon Sep 17 00:00:00 2001 |
100 |
+From: Tom Stellard <thomas.stellard@×××.com> |
101 |
+Date: Wed, 14 Mar 2012 11:19:35 -0400 |
102 |
+Subject: [PATCH 2/2] r600: Add get_global_size and get_local_size intrinsics |
103 |
+ |
104 |
+--- |
105 |
+ include/llvm/IntrinsicsR600.td | 4 ++++ |
106 |
+ 1 files changed, 4 insertions(+), 0 deletions(-) |
107 |
+ |
108 |
+diff --git a/include/llvm/IntrinsicsR600.td b/include/llvm/IntrinsicsR600.td |
109 |
+index 789fecb..0473acb 100644 |
110 |
+--- a/include/llvm/IntrinsicsR600.td |
111 |
++++ b/include/llvm/IntrinsicsR600.td |
112 |
+@@ -26,6 +26,10 @@ multiclass R600ReadPreloadRegisterIntrinsic_xyz<string prefix> { |
113 |
+ def _z : R600ReadPreloadRegisterIntrinsic<!strconcat(prefix, "_z")>; |
114 |
+ } |
115 |
+ |
116 |
++defm int_r600_read_global_size : R600ReadPreloadRegisterIntrinsic_xyz < |
117 |
++ "__builtin_r600_read_global_size">; |
118 |
++defm int_r600_read_local_size : R600ReadPreloadRegisterIntrinsic_xyz < |
119 |
++ "__builtin_r600_read_local_size">; |
120 |
+ defm int_r600_read_ngroups : R600ReadPreloadRegisterIntrinsic_xyz < |
121 |
+ "__builtin_r600_read_ngroups">; |
122 |
+ defm int_r600_read_tgid : R600ReadPreloadRegisterIntrinsic_xyz < |
123 |
+-- |
124 |
+1.7.7.6 |
125 |
+ |
126 |
|
127 |
diff --git a/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch b/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch |
128 |
new file mode 100644 |
129 |
index 0000000..583fdf9 |
130 |
--- /dev/null |
131 |
+++ b/sys-devel/llvm/files/llvm-2.6-commandguide-nops.patch |
132 |
@@ -0,0 +1,30 @@ |
133 |
+--- docs/CommandGuide/Makefile.orig 2009-10-26 16:54:33.000000000 +0100 |
134 |
++++ docs/CommandGuide/Makefile 2009-10-26 17:32:03.000000000 +0100 |
135 |
+@@ -19,7 +19,7 @@ |
136 |
+ DST_PS_DIR=ps/ |
137 |
+ |
138 |
+ # If we are in BUILD_FOR_WEBSITE mode, default to the all target. |
139 |
+-all:: html man ps |
140 |
++all:: html man |
141 |
+ |
142 |
+ clean: |
143 |
+ rm -f pod2htm*.*~~ $(HTML) $(MAN) $(PS) |
144 |
+@@ -81,7 +81,7 @@ |
145 |
+ MAN_DIR := $(PROJ_mandir)/man1 |
146 |
+ PS_DIR := $(PROJ_docsdir)/ps |
147 |
+ |
148 |
+-install-local:: $(HTML) $(INSTALL_MANS) $(PS) |
149 |
++install-local:: $(HTML) $(INSTALL_MANS) |
150 |
+ $(Echo) Installing HTML CommandGuide Documentation |
151 |
+ $(Verb) $(MKDIR) $(HTML_DIR) |
152 |
+ $(Verb) $(DataInstall) $(HTML) $(HTML_DIR) |
153 |
+@@ -90,9 +90,6 @@ |
154 |
+ $(Echo) Installing MAN CommandGuide Documentation |
155 |
+ $(Verb) $(MKDIR) $(MAN_DIR) |
156 |
+ $(Verb) $(DataInstall) $(INSTALL_MANS) $(MAN_DIR) |
157 |
+- $(Echo) Installing PS CommandGuide Documentation |
158 |
+- $(Verb) $(MKDIR) $(PS_DIR) |
159 |
+- $(Verb) $(DataInstall) $(PS) $(PS_DIR) |
160 |
+ |
161 |
+ uninstall-local:: |
162 |
+ $(Echo) Uninstalling CommandGuide Documentation |
163 |
|
164 |
diff --git a/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch b/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch |
165 |
new file mode 100644 |
166 |
index 0000000..9507817 |
167 |
--- /dev/null |
168 |
+++ b/sys-devel/llvm/files/llvm-2.9-nodoctargz.patch |
169 |
@@ -0,0 +1,39 @@ |
170 |
+--- docs/Makefile.orig 2011-02-28 21:30:46.000000000 +0100 |
171 |
++++ docs/Makefile 2011-02-28 21:35:22.000000000 +0100 |
172 |
+@@ -53,13 +53,12 @@ |
173 |
+ # 'make generated BUILD_FOR_WEBSITE=1' |
174 |
+ generated:: $(generated_targets) |
175 |
+ |
176 |
+-install-html: $(PROJ_OBJ_DIR)/html.tar.gz |
177 |
++install-html: |
178 |
+ $(Echo) Installing HTML documentation |
179 |
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html |
180 |
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/img |
181 |
+ $(Verb) $(DataInstall) $(HTML) $(DESTDIR)$(PROJ_docsdir)/html |
182 |
+ $(Verb) $(DataInstall) $(IMAGES) $(DESTDIR)$(PROJ_docsdir)/html/img |
183 |
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/html.tar.gz $(DESTDIR)$(PROJ_docsdir) |
184 |
+ |
185 |
+ $(PROJ_OBJ_DIR)/html.tar.gz: $(HTML) |
186 |
+ $(Echo) Packaging HTML documentation |
187 |
+@@ -71,12 +70,11 @@ |
188 |
+ install-doxygen: doxygen |
189 |
+ $(Echo) Installing doxygen documentation |
190 |
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/html/doxygen |
191 |
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(DESTDIR)$(PROJ_docsdir) |
192 |
+ $(Verb) cd $(PROJ_OBJ_DIR)/doxygen && \ |
193 |
+ $(FIND) . -type f -exec \ |
194 |
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/html/doxygen \; |
195 |
+ |
196 |
+-doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz |
197 |
++doxygen: regendoc |
198 |
+ |
199 |
+ regendoc: |
200 |
+ $(Echo) Building doxygen documentation |
201 |
+@@ -102,7 +100,6 @@ |
202 |
+ install-ocamldoc: ocamldoc |
203 |
+ $(Echo) Installing ocamldoc documentation |
204 |
+ $(Verb) $(MKDIR) $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html |
205 |
+- $(Verb) $(DataInstall) $(PROJ_OBJ_DIR)/ocamldoc.tar.gz $(DESTDIR)$(PROJ_docsdir) |
206 |
+ $(Verb) cd $(PROJ_OBJ_DIR)/ocamldoc && \ |
207 |
+ $(FIND) . -type f -exec \ |
208 |
+ $(DataInstall) {} $(DESTDIR)$(PROJ_docsdir)/ocamldoc/html \; |
209 |
|
210 |
diff --git a/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch b/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch |
211 |
new file mode 100644 |
212 |
index 0000000..c485e9b |
213 |
--- /dev/null |
214 |
+++ b/sys-devel/llvm/files/llvm-3.0-PPC_macro.patch |
215 |
@@ -0,0 +1,43 @@ |
216 |
+Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h |
217 |
+=================================================================== |
218 |
+--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h 2011-07-25 23:24:55.000000000 +0000 |
219 |
++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h 2011-12-02 13:06:48.000000000 +0000 |
220 |
+@@ -34,6 +34,10 @@ |
221 |
+ |
222 |
+ } // End llvm namespace |
223 |
+ |
224 |
++// Generated files will use "namespace PPC". To avoid symbol clash, |
225 |
++// undefine PPC here. PPC may be predefined on some hosts. |
226 |
++#undef PPC |
227 |
++ |
228 |
+ // Defines symbolic names for PowerPC registers. This defines a mapping from |
229 |
+ // register name to register number. |
230 |
+ // |
231 |
+Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h |
232 |
+=================================================================== |
233 |
+--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h 2011-07-26 00:24:13.000000000 +0000 |
234 |
++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h 2011-12-02 13:06:48.000000000 +0000 |
235 |
+@@ -14,6 +14,10 @@ |
236 |
+ #ifndef LLVM_TARGET_POWERPC_PPCPREDICATES_H |
237 |
+ #define LLVM_TARGET_POWERPC_PPCPREDICATES_H |
238 |
+ |
239 |
++// Generated files will use "namespace PPC". To avoid symbol clash, |
240 |
++// undefine PPC here. PPC may be predefined on some hosts. |
241 |
++#undef PPC |
242 |
++ |
243 |
+ namespace llvm { |
244 |
+ namespace PPC { |
245 |
+ /// Predicate - These are "(BI << 5) | BO" for various predicates. |
246 |
+Index: llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h |
247 |
+=================================================================== |
248 |
+--- llvm-3.0-3.0.orig/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h 2011-07-25 19:53:23.000000000 +0000 |
249 |
++++ llvm-3.0-3.0/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h 2011-12-02 16:21:23.000000000 +0000 |
250 |
+@@ -12,6 +12,8 @@ |
251 |
+ |
252 |
+ #include "llvm/MC/MCFixup.h" |
253 |
+ |
254 |
++#undef PPC |
255 |
++ |
256 |
+ namespace llvm { |
257 |
+ namespace PPC { |
258 |
+ enum Fixups { |
259 |
|
260 |
diff --git a/sys-devel/llvm/llvm-3.1.ebuild b/sys-devel/llvm/llvm-3.1.ebuild |
261 |
new file mode 100644 |
262 |
index 0000000..c4ab2f6 |
263 |
--- /dev/null |
264 |
+++ b/sys-devel/llvm/llvm-3.1.ebuild |
265 |
@@ -0,0 +1,180 @@ |
266 |
+# Copyright 1999-2012 Gentoo Foundation |
267 |
+# Distributed under the terms of the GNU General Public License v2 |
268 |
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.1.ebuild,v 1.2 2012/05/26 17:23:56 aballier Exp $ |
269 |
+ |
270 |
+EAPI="4" |
271 |
+PYTHON_DEPEND="2" |
272 |
+inherit eutils flag-o-matic multilib toolchain-funcs python |
273 |
+ |
274 |
+DESCRIPTION="Low Level Virtual Machine" |
275 |
+HOMEPAGE="http://llvm.org/" |
276 |
+SRC_URI="http://llvm.org/releases/${PV}/${P}.src.tar.gz" |
277 |
+ |
278 |
+LICENSE="UoI-NCSA" |
279 |
+SLOT="0" |
280 |
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos" |
281 |
+IUSE="debug gold +libffi multitarget ocaml test udis86 vim-syntax" |
282 |
+ |
283 |
+DEPEND="dev-lang/perl |
284 |
+ >=sys-devel/make-3.79 |
285 |
+ >=sys-devel/flex-2.5.4 |
286 |
+ >=sys-devel/bison-1.875d |
287 |
+ || ( >=sys-devel/gcc-3.0 >=sys-devel/gcc-apple-4.2.1 ) |
288 |
+ || ( >=sys-devel/binutils-2.18 >=sys-devel/binutils-apple-3.2.3 ) |
289 |
+ gold? ( >=sys-devel/binutils-2.22 ) |
290 |
+ libffi? ( virtual/pkgconfig |
291 |
+ virtual/libffi ) |
292 |
+ ocaml? ( dev-lang/ocaml ) |
293 |
+ udis86? ( amd64? ( dev-libs/udis86[pic] ) |
294 |
+ !amd64? ( dev-libs/udis86 ) )" |
295 |
+RDEPEND="dev-lang/perl |
296 |
+ libffi? ( virtual/libffi ) |
297 |
+ vim-syntax? ( || ( app-editors/vim app-editors/gvim ) )" |
298 |
+ |
299 |
+S=${WORKDIR}/${P}.src |
300 |
+ |
301 |
+pkg_setup() { |
302 |
+ # Required for test and build |
303 |
+ python_set_active_version 2 |
304 |
+ python_pkg_setup |
305 |
+ |
306 |
+ # need to check if the active compiler is ok |
307 |
+ |
308 |
+ broken_gcc=" 3.2.2 3.2.3 3.3.2 4.1.1 " |
309 |
+ broken_gcc_x86=" 3.4.0 3.4.2 " |
310 |
+ broken_gcc_amd64=" 3.4.6 " |
311 |
+ |
312 |
+ gcc_vers=$(gcc-fullversion) |
313 |
+ |
314 |
+ if [[ ${broken_gcc} == *" ${version} "* ]] ; then |
315 |
+ elog "Your version of gcc is known to miscompile llvm." |
316 |
+ elog "Check http://www.llvm.org/docs/GettingStarted.html for" |
317 |
+ elog "possible solutions." |
318 |
+ die "Your currently active version of gcc is known to miscompile llvm" |
319 |
+ fi |
320 |
+ |
321 |
+ if [[ ${CHOST} == i*86-* && ${broken_gcc_x86} == *" ${version} "* ]] ; then |
322 |
+ elog "Your version of gcc is known to miscompile llvm on x86" |
323 |
+ elog "architectures. Check" |
324 |
+ elog "http://www.llvm.org/docs/GettingStarted.html for possible" |
325 |
+ elog "solutions." |
326 |
+ die "Your currently active version of gcc is known to miscompile llvm" |
327 |
+ fi |
328 |
+ |
329 |
+ if [[ ${CHOST} == x86_64-* && ${broken_gcc_amd64} == *" ${version} "* ]]; |
330 |
+ then |
331 |
+ elog "Your version of gcc is known to miscompile llvm in amd64" |
332 |
+ elog "architectures. Check" |
333 |
+ elog "http://www.llvm.org/docs/GettingStarted.html for possible" |
334 |
+ elog "solutions." |
335 |
+ die "Your currently active version of gcc is known to miscompile llvm" |
336 |
+ fi |
337 |
+} |
338 |
+ |
339 |
+src_prepare() { |
340 |
+ # unfortunately ./configure won't listen to --mandir and the-like, so take |
341 |
+ # care of this. |
342 |
+ einfo "Fixing install dirs" |
343 |
+ sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \ |
344 |
+ -e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \ |
345 |
+ -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \ |
346 |
+ -i Makefile.config.in || die "Makefile.config sed failed" |
347 |
+ sed -e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \ |
348 |
+ -i tools/llvm-config/llvm-config.cpp || die "llvm-config sed failed" |
349 |
+ |
350 |
+ einfo "Fixing rpath and CFLAGS" |
351 |
+ sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \ |
352 |
+ -e '/OmitFramePointer/s/-fomit-frame-pointer//' \ |
353 |
+ -i Makefile.rules || die "rpath sed failed" |
354 |
+ if use gold; then |
355 |
+ sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \ |
356 |
+ -i tools/gold/Makefile || die "gold rpath sed failed" |
357 |
+ fi |
358 |
+ |
359 |
+ # Specify python version |
360 |
+ python_convert_shebangs -r 2 test/Scripts |
361 |
+ |
362 |
+ epatch "${FILESDIR}"/${PN}-2.6-commandguide-nops.patch |
363 |
+ epatch "${FILESDIR}"/${PN}-2.9-nodoctargz.patch |
364 |
+ epatch "${FILESDIR}"/${PN}-3.0-PPC_macro.patch |
365 |
+ |
366 |
+ # Apply r600 OpenCL-related patches |
367 |
+ epatch "${FILESDIR}"/cl-patches/*.patch |
368 |
+ |
369 |
+ # User patches |
370 |
+ epatch_user |
371 |
+} |
372 |
+ |
373 |
+src_configure() { |
374 |
+ local CONF_FLAGS="--enable-shared |
375 |
+ --with-optimize-option= |
376 |
+ $(use_enable !debug optimized) |
377 |
+ $(use_enable debug assertions) |
378 |
+ $(use_enable debug expensive-checks)" |
379 |
+ |
380 |
+ if use multitarget; then |
381 |
+ CONF_FLAGS="${CONF_FLAGS} --enable-targets=all" |
382 |
+ else |
383 |
+ CONF_FLAGS="${CONF_FLAGS} --enable-targets=host-only" |
384 |
+ fi |
385 |
+ |
386 |
+ if use amd64; then |
387 |
+ CONF_FLAGS="${CONF_FLAGS} --enable-pic" |
388 |
+ fi |
389 |
+ |
390 |
+ if use gold; then |
391 |
+ CONF_FLAGS="${CONF_FLAGS} --with-binutils-include=${EPREFIX}/usr/include/" |
392 |
+ fi |
393 |
+ if use ocaml; then |
394 |
+ CONF_FLAGS="${CONF_FLAGS} --enable-bindings=ocaml" |
395 |
+ else |
396 |
+ CONF_FLAGS="${CONF_FLAGS} --enable-bindings=none" |
397 |
+ fi |
398 |
+ |
399 |
+ if use udis86; then |
400 |
+ CONF_FLAGS="${CONF_FLAGS} --with-udis86" |
401 |
+ fi |
402 |
+ |
403 |
+ if use libffi; then |
404 |
+ append-cppflags "$(pkg-config --cflags libffi)" |
405 |
+ fi |
406 |
+ CONF_FLAGS="${CONF_FLAGS} $(use_enable libffi)" |
407 |
+ econf ${CONF_FLAGS} |
408 |
+} |
409 |
+ |
410 |
+src_compile() { |
411 |
+ emake VERBOSE=1 KEEP_SYMBOLS=1 REQUIRES_RTTI=1 |
412 |
+} |
413 |
+ |
414 |
+src_install() { |
415 |
+ emake KEEP_SYMBOLS=1 DESTDIR="${D}" install |
416 |
+ |
417 |
+ if use vim-syntax; then |
418 |
+ insinto /usr/share/vim/vimfiles/syntax |
419 |
+ doins utils/vim/*.vim |
420 |
+ fi |
421 |
+ |
422 |
+ # Fix install_names on Darwin. The build system is too complicated |
423 |
+ # to just fix this, so we correct it post-install |
424 |
+ local lib= f= odylib= |
425 |
+ if [[ ${CHOST} == *-darwin* ]] ; then |
426 |
+ for lib in lib{EnhancedDisassembly,LLVM-${PV},LTO,profile_rt}.dylib {BugpointPasses,LLVMHello}.dylib ; do |
427 |
+ # libEnhancedDisassembly is Darwin10 only, so non-fatal |
428 |
+ [[ -f ${ED}/usr/lib/${PN}/${lib} ]] || continue |
429 |
+ ebegin "fixing install_name of $lib" |
430 |
+ install_name_tool \ |
431 |
+ -id "${EPREFIX}"/usr/lib/${PN}/${lib} \ |
432 |
+ "${ED}"/usr/lib/${PN}/${lib} |
433 |
+ eend $? |
434 |
+ done |
435 |
+ for f in "${ED}"/usr/bin/* "${ED}"/usr/lib/${PN}/libLTO.dylib ; do |
436 |
+ odylib=$(scanmacho -BF'%n#f' "${f}" | tr ',' '\n' | grep libLLVM-${PV}.dylib) |
437 |
+ ebegin "fixing install_name reference to ${odylib} of ${f##*/}" |
438 |
+ install_name_tool \ |
439 |
+ -change "${odylib}" \ |
440 |
+ "${EPREFIX}"/usr/lib/${PN}/libLLVM-${PV}.dylib \ |
441 |
+ "${f}" |
442 |
+ eend $? |
443 |
+ done |
444 |
+ fi |
445 |
+} |
446 |
|
447 |
diff --git a/sys-devel/llvm/metadata.xml b/sys-devel/llvm/metadata.xml |
448 |
new file mode 100644 |
449 |
index 0000000..38e16d8 |
450 |
--- /dev/null |
451 |
+++ b/sys-devel/llvm/metadata.xml |
452 |
@@ -0,0 +1,22 @@ |
453 |
+<?xml version="1.0" encoding="UTF-8"?> |
454 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
455 |
+<pkgmetadata> |
456 |
+ <maintainer> |
457 |
+ <email>voyageur@g.o</email> |
458 |
+ <name>Bernard Cafarelli</name> |
459 |
+ </maintainer> |
460 |
+ <maintainer> |
461 |
+ <email>mgorny@g.o</email> |
462 |
+ <name>Michał Górny</name> |
463 |
+ </maintainer> |
464 |
+ <longdescription>Low Level Virtual Machine (LLVM) is: |
465 |
+ 1. A compilation strategy designed to enable effective program optimization across the entire lifetime of a program. LLVM supports effective optimization at compile time, link-time (particularly interprocedural), run-time and offline (i.e., after software is installed), while remaining transparent to developers and maintaining compatibility with existing build scripts. |
466 |
+ 2. A virtual instruction set - LLVM is a low-level object code representation that uses simple RISC-like instructions, but provides rich, language-independent, type information and dataflow (SSA) information about operands. This combination enables sophisticated transformations on object code, while remaining light-weight enough to be attached to the executable. This combination is key to allowing link-time, run-time, and offline transformations. |
467 |
+ 3. A compiler infrastructure - LLVM is also a collection of source code that implements the language and compilation strategy. The primary components of the LLVM infrastructure are a GCC-based C and C++ front-end, a link-time optimization framework with a growing set of global and interprocedural analyses and transformations, static back-ends for many popular (and some obscure) architectures, a back-end which emits portable C code, and a Just-In-Time compilers for several architectures. |
468 |
+ 4. LLVM does not imply things that you would expect from a high-level virtual machine. It does not require garbage collection or run-time code generation (In fact, LLVM makes a great static compiler!). Note that optional LLVM components can be used to build high-level virtual machines and other systems that need these services.</longdescription> |
469 |
+ <use> |
470 |
+ <flag name='gold'>Build the gold linker plugin</flag> |
471 |
+ <flag name='multitarget'>Build all host targets (default: host only)</flag> |
472 |
+ <flag name='udis86'>Enable support for <pkg>dev-libs/udis86</pkg> disassembler library</flag> |
473 |
+ </use> |
474 |
+</pkgmetadata> |