summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-12-19 15:10:59 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-12-19 15:10:59 +0000
commit24c6d1edf1b52d72a48d013826650c9dd13b6492 (patch)
treea50baedb66655522099b7cf978fdf73195d54757
parent0674315cfc65b4630581976336615acceb21f6b6 (diff)
parentd73d15596971d1271b19edd2e90f2b4ce47646a6 (diff)
downloadaports-24c6d1edf1b52d72a48d013826650c9dd13b6492.tar.bz2
aports-24c6d1edf1b52d72a48d013826650c9dd13b6492.tar.xz
Merge http://home.dereferenced.org/~nenolod/aports
-rw-r--r--testing/llvm/APKBUILD57
-rw-r--r--testing/llvm/llvm-uclibc-errno-fsckery.patch86
2 files changed, 143 insertions, 0 deletions
diff --git a/testing/llvm/APKBUILD b/testing/llvm/APKBUILD
new file mode 100644
index 000000000..610b153ca
--- /dev/null
+++ b/testing/llvm/APKBUILD
@@ -0,0 +1,57 @@
+# Contributor: William Pitcock <nenolod@dereferenced.org>
+# Maintainer: William Pitcock <nenolod@dereferenced.org>
+pkgname=llvm
+pkgver=2.8
+pkgrel=0
+pkgdesc="low level virtual machine compiler system"
+arch="all"
+url="http://llvm.org/"
+license="UOI-NCSA"
+depends=
+makedepends="groff"
+install=
+subpackages="$pkgname-dev $pkgname-doc"
+source="http://llvm.org/releases/$pkgver/llvm-$pkgver.tgz
+ http://llvm.org/releases/$pkgver/clang-$pkgver.tgz
+ llvm-uclibc-errno-fsckery.patch"
+
+_builddir="$srcdir"/build
+
+prepare() {
+ mkdir "$_builddir"
+
+ msg "Preparing CLANG sources..."
+
+ mv "$srcdir"/clang-$pkgver "$srcdir"/$pkgname-$pkgver/tools/clang
+
+ msg "Patching LLVM core..."
+
+ cd "$srcdir"/$pkgname-$pkgver
+
+ for i in $source; do
+ case $i in
+ *.patch)
+ msg "Applying $i..."
+ patch -s -p1 -N -i "$srcdir"/$i || return 1
+ ;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ../$pkgname-$pkgver/configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install
+}
+
+md5sums="220d361b4d17051ff4bb21c64abe05ba llvm-2.8.tgz
+10e14c901fc3728eecbd5b829e011b59 clang-2.8.tgz
+089441aa2369c90a0fd0edaa311cb7d6 llvm-uclibc-errno-fsckery.patch"
diff --git a/testing/llvm/llvm-uclibc-errno-fsckery.patch b/testing/llvm/llvm-uclibc-errno-fsckery.patch
new file mode 100644
index 000000000..a7335f268
--- /dev/null
+++ b/testing/llvm/llvm-uclibc-errno-fsckery.patch
@@ -0,0 +1,86 @@
+--- llvm-2.8/lib/Support/CommandLine.cpp
++++ llvm-2.8.mod/lib/Support/CommandLine.cpp
+@@ -31,7 +31,10 @@
+ #include "llvm/ADT/StringMap.h"
+ #include "llvm/ADT/Twine.h"
+ #include "llvm/Config/config.h"
+-#include <cerrno>
++
++#include <asm-generic/errno-base.h>
++extern __thread int errno;
++
+ #include <cstdlib>
+ using namespace llvm;
+ using namespace cl;
+--- llvm-2.8/lib/Support/raw_ostream.cpp
++++ llvm-2.8.mod/lib/Support/raw_ostream.cpp
+@@ -22,7 +22,10 @@
+ #include "llvm/System/Signals.h"
+ #include "llvm/ADT/STLExtras.h"
+ #include <cctype>
+-#include <cerrno>
++
++#include <asm-generic/errno-base.h>
++extern __thread int errno;
++
+ #include <sys/stat.h>
+ #include <sys/types.h>
+
+--- llvm-2.8/lib/System/Errno.cpp
++++ llvm-2.8.mod/lib/System/Errno.cpp
+@@ -14,13 +14,11 @@
+ #include "llvm/System/Errno.h"
+ #include "llvm/Config/config.h" // Get autoconf configuration settings
+
++extern __thread int errno;
++
+ #if HAVE_STRING_H
+ #include <string.h>
+
+-#if HAVE_ERRNO_H
+-#include <errno.h>
+-#endif
+-
+ //===----------------------------------------------------------------------===//
+ //=== WARNING: Implementation here must contain only TRULY operating system
+ //=== independent code.
+@@ -29,11 +27,9 @@
+ namespace llvm {
+ namespace sys {
+
+-#if HAVE_ERRNO_H
+ std::string StrError() {
+ return StrError(errno);
+ }
+-#endif // HAVE_ERRNO_H
+
+ std::string StrError(int errnum) {
+ const int MaxErrStrLen = 2000;
+--- llvm-2.8/lib/System/Unix/Unix.h
++++ llvm-2.8.mod/lib/System/Unix/Unix.h
+@@ -24,7 +24,10 @@
+ #include <cstdlib>
+ #include <cstdio>
+ #include <cstring>
+-#include <cerrno>
++
++#include <asm-generic/errno-base.h>
++extern __thread int errno;
++
+ #include <string>
+ #include <algorithm>
+
+--- llvm-2.8/utils/TableGen/TGLexer.cpp
++++ llvm-2.8.mod/utils/TableGen/TGLexer.cpp
+@@ -19,7 +19,10 @@
+ #include <cstdio>
+ #include <cstdlib>
+ #include <cstring>
+-#include <cerrno>
++
++#include <asm-generic/errno-base.h>
++extern __thread int errno;
++
+ using namespace llvm;
+
+ TGLexer::TGLexer(SourceMgr &SM) : SrcMgr(SM) {