Skip to content

Commit f9e117b

Browse files
author
Islam Amer
committed
[packaging] import mer packaging adapted to newer version and subtree building
1 parent bb12b5d commit f9e117b

File tree

5 files changed

+137
-0
lines changed

5 files changed

+137
-0
lines changed

rpm/LLVMBuild.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
;===- ./projects/LLVMBuild.txt ---------------------------------*- Conf -*--===;
2+
;
3+
; The LLVM Compiler Infrastructure
4+
;
5+
; This file is distributed under the University of Illinois Open Source
6+
; License. See LICENSE.TXT for details.
7+
;
8+
;===------------------------------------------------------------------------===;
9+
;
10+
; This is an LLVMBuild description file for the components in this subdirectory.
11+
;
12+
; For more information on the LLVMBuild system, please see:
13+
;
14+
; http://llvm.org/docs/LLVMBuild.html
15+
;
16+
;===------------------------------------------------------------------------===;
17+
18+
[component_0]
19+
type = Group
20+
name = Projects
21+
parent = $ROOT

rpm/llvm-3.0-rpmlintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
addFilter("llvm-devel.*spurious-executable-perm")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/lib/Support/Unix/Path.inc
2+
+++ b/lib/Support/Unix/Path.inc
3+
@@ -335,7 +335,7 @@
4+
5+
if (getprogpath(exe_path, argv0) != NULL)
6+
return Path(exe_path);
7+
-#elif defined(__linux__) || defined(__CYGWIN__)
8+
+#elif 0 // defined(__linux__) || defined(__CYGWIN__)
9+
char exe_path[MAXPATHLEN];
10+
ssize_t len = readlink("/proc/self/exe", exe_path, sizeof(exe_path));
11+
if (len >= 0)

rpm/llvm.spec

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Name: llvm
2+
Version: 3.3
3+
Release: 0
4+
Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
5+
License: University of Illinois/NCSA Open Source License
6+
Group: Development/Tools
7+
URL: http://llvm.org/
8+
Source: %{version}/%{name}-%{version}.tar.gz
9+
Source1: LLVMBuild.txt
10+
Source100: llvm-3.0-rpmlintrc
11+
Patch0: llvm-3.1-sb2-build-workaround.patch
12+
Patch1: nosse4-avx.patch
13+
Requires(post): /sbin/ldconfig
14+
Requires(postun): /sbin/ldconfig
15+
BuildRequires: gcc >= 3.4, python
16+
17+
%description
18+
LLVM is a compiler infrastructure designed for compile-time, link-time, runtime,
19+
and idle-time optimization of programs from arbitrary programming languages.
20+
LLVM is written in C++ and has been developed since 2000 at the University of
21+
Illinois and Apple. It currently supports compilation of C and C++ programs,
22+
using front-ends derived from GCC 4.0.1. A new front-end for the C family of
23+
languages is in development. The compiler infrastructure
24+
includes mirror sets of programming tools as well as libraries with equivalent
25+
functionality.
26+
27+
%package devel
28+
Summary: Libraries and Header Files for LLVM
29+
Group: Development/Tools
30+
Requires: %{name} = %{version}
31+
32+
%description devel
33+
LLVM Header files
34+
35+
%prep
36+
%setup -q -n %{name}-%{version}/%{name}
37+
%patch0 -p1
38+
#%patch1 -p1
39+
cp %{_sourcedir}/LLVMBuild.txt projects/
40+
41+
%build
42+
./configure \
43+
--prefix=%{_prefix} \
44+
--bindir=%{_bindir} \
45+
--datadir=%{_datadir} \
46+
--includedir=%{_includedir} \
47+
--libdir=%{_libdir} \
48+
--enable-optimized \
49+
--enable-assertions \
50+
--disable-docs
51+
make tools-only
52+
53+
%install
54+
rm -rf %{buildroot}
55+
make install DESTDIR=%{buildroot}
56+
57+
%post -p /sbin/ldconfig
58+
59+
%postun -p /sbin/ldconfig
60+
61+
%files
62+
%defattr(-, root, root)
63+
%doc CREDITS.TXT LICENSE.TXT README.txt
64+
%{_bindir}/*
65+
%attr(744,-,-) %{_libdir}/*.so
66+
67+
%files devel
68+
%defattr(-, root, root)
69+
%attr(744,-,-) %{_libdir}/*.a
70+
%{_includedir}/llvm
71+
%{_includedir}/llvm-c
72+

rpm/nosse4-avx.patch

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
diff -ru llvm-3.1.src/lib/Target/X86/X86Subtarget.cpp llvm-3.1.src-noavxsse4/lib/Target/X86/X86Subtarget.cpp
2+
--- llvm-3.1.src/lib/Target/X86/X86Subtarget.cpp 2012-06-12 14:35:17.000000000 +0200
3+
+++ llvm-3.1.src-noavxsse4/lib/Target/X86/X86Subtarget.cpp 2013-02-13 14:01:46.918216857 +0100
4+
@@ -194,10 +194,11 @@
5+
if ((EDX >> 26) & 1) { X86SSELevel = SSE2; ToggleFeature(X86::FeatureSSE2); }
6+
if (ECX & 0x1) { X86SSELevel = SSE3; ToggleFeature(X86::FeatureSSE3); }
7+
if ((ECX >> 9) & 1) { X86SSELevel = SSSE3; ToggleFeature(X86::FeatureSSSE3);}
8+
+#if 0
9+
if ((ECX >> 19) & 1) { X86SSELevel = SSE41; ToggleFeature(X86::FeatureSSE41);}
10+
if ((ECX >> 20) & 1) { X86SSELevel = SSE42; ToggleFeature(X86::FeatureSSE42);}
11+
if ((ECX >> 28) & 1) { X86SSELevel = AVX; ToggleFeature(X86::FeatureAVX); }
12+
-
13+
+#endif
14+
bool IsIntel = memcmp(text.c, "GenuineIntel", 12) == 0;
15+
bool IsAMD = !IsIntel && memcmp(text.c, "AuthenticAMD", 12) == 0;
16+
17+
@@ -301,6 +302,7 @@
18+
HasBMI = true;
19+
ToggleFeature(X86::FeatureBMI);
20+
}
21+
+#if 0
22+
if (IsIntel && ((EBX >> 5) & 0x1)) {
23+
X86SSELevel = AVX2;
24+
ToggleFeature(X86::FeatureAVX2);
25+
@@ -309,6 +311,7 @@
26+
HasBMI2 = true;
27+
ToggleFeature(X86::FeatureBMI2);
28+
}
29+
+#endif
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)