Commit c1655279 authored by Neophytos's avatar Neophytos

rebuilding llvm with new patches

parent 41c8edff
......@@ -3,29 +3,32 @@
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
pkgname=('llvm' 'llvm-ocaml' 'clang' 'clang-analyzer')
pkgver=2.9
_gcc_ver=4.5.3
pkgrel=3
_gcc_ver=4.6.2
pkgrel=4
arch=('i686' 'x86_64')
url="http://llvm.org/"
license=('custom:University of Illinois/NCSA Open Source License')
makedepends=('gcc-libs' 'libffi' 'python2' 'ocaml' "gcc=$_gcc_ver")
source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.tgz
http://llvm.org/releases/$pkgver/clang-$pkgver.tgz
ftp://ftp.archlinux.org/other/community/clang/gcc-headers-4.5.2.tar.xz
clang-plugin-loader-registry.patch
cindexer-clang-path.patch
clang-toolchains-gcc-versions.patch
clang-pure64.patch
enable-lto.patch)
md5sums=('793138412d2af2c7c7f54615f8943771'
'634de18d04b7a4ded19ec4c17d23cfca'
'02c23b4aaca3445b8bf39fddb2f9906e'
'87a7162dbe99e9ffce6c40bd09f5f4f0'
'c233e77e25e0cac6d87e6bcaa458a183'
'225ee6b531f8327f34f344a18cb4ec81'
'8f7582d7440e4a8342c3aea9ec714fb4')
enable-lto.patch
bug-9869-operator-h-c++0x.patch)
sha256sums=('661236cfa17428b48cfa9cbb9909f7569c64b8ecd219fd91dbc00e3b557b3779'
'70c41f3f782a71cbaa7bc8d6ea29fce4263ad3e8558dfecc6dc11cdef17909df'
'12cf0bfb128cd8bd2a308c3c03cf0e607aa47bd87d9a58b422b96bd387e476c1'
'a0a4494f2a692789670be37fd390906dcaa37b1824f740bdaaea21182f2f3a9c'
'3074df5322900e087377a8e03a02115463ccc0011c25917c2f06df11facd9b92'
'aa7e1a954af75e475a26f64bfb9bef794c9f5ceb557d433ed467ca098600e7cf'
'5bba4964d0d832c9e97308beb45244ff6ed4e16ed3f9f771babe571f1b82fa33'
'1a308679edf3078b8f0c33c94d4e6d0c0db6d3baad91babce08bf5370aa052ef'
'1c37346b0f412556dc979fd510585f3e20d2d45319ec095dbdec37a582d590c7')
build() {
cd "$srcdir/$pkgname-$pkgver"
......@@ -54,7 +57,7 @@ build() {
# Fix clang path in CIndexer.cpp (https://bugs.archlinux.org/task/22799)
patch -d tools/clang -Np0 -i "$srcdir/cindexer-clang-path.patch"
# Add GCC 4.5.3 to GccVersions (FS#23631)
# Add GCC 4.6.1 to GccVersions (FS#23631)
patch -d tools/clang -Np1 -i "$srcdir/clang-toolchains-gcc-versions.patch"
if [[ $CARCH == x86_64 ]]; then
......@@ -66,6 +69,10 @@ build() {
# Use gold instead of default linker, and always use the plugin
patch -d tools/clang -Np0 -i "$srcdir/enable-lto.patch"
# Fix upstream bug #9869:
# Operator.h incompatibility with GCC 4.6 in C++0x mode
patch -Np2 -i "$srcdir/bug-9869-operator-h-c++0x.patch"
# Apply strip option to configure
_optimized_switch="enable"
[[ $(check_option strip) == n ]] && _optimized_switch="disable"
......@@ -73,10 +80,18 @@ build() {
# Include location of libffi headers in CPPFLAGS
export CPPFLAGS="$CPPFLAGS $(pkg-config --cflags libffi)"
_cxx_headers="/usr/include/c++/$_gcc_ver"
if [[ ! -d $_cxx_headers ]]; then
error "Couldn't find the C++ headers, PKGBUILD needs fixing!"
return 1
# TODO: Uncomment when clang works with GCC 4.6+
#_cxx_headers="/usr/include/c++/$_gcc_ver"
#if [[ ! -d $_cxx_headers ]]; then
# error "Couldn't find the C++ headers, PKGBUILD needs fixing!"
# return 1
#fi
_cxx_headers="/usr/include/c++/clang-$pkgver"
_32bit_headers=""
if [[ $CARCH == x86_64 ]]; then
# Important for multilib
_32bit_headers="32"
fi
./configure \
......@@ -92,6 +107,7 @@ build() {
--with-binutils-include=/usr/include \
--with-cxx-include-root=$_cxx_headers \
--with-cxx-include-arch=$CHOST \
--with-cxx-include-32bit-dir=$_32bit_headers \
--$_optimized_switch-optimized
make REQUIRES_RTTI=1
......@@ -173,6 +189,11 @@ package_clang() {
sed -i 's:$(PROJ_prefix)/share/doc/clang:$(PROJ_prefix)/share/doc/llvm:' \
"$srcdir/llvm-$pkgver/Makefile.config"
# Install old libstdc++ headers. Contains combined headers from
# gcc 4.5.2-6-i686 and gcc-multilib-4.5.2-6-x86_64
install -d "$pkgdir/usr/include/c++"
cp -rd "$srcdir/gcc-headers-4.5.2" "$pkgdir/usr/include/c++/clang-$pkgver"
install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/clang/LICENSE"
}
......@@ -190,7 +211,7 @@ package_clang-analyzer() {
done
# Use Python 2
sed -i 's/env python$/\02/' \
sed -i 's/env python$/&2/' \
"$pkgdir/usr/lib/clang-analyzer/scan-view/scan-view" \
"$pkgdir/usr/lib/clang-analyzer/scan-build/set-xcode-analyzer"
......@@ -199,4 +220,4 @@ package_clang-analyzer() {
python2 -O -m compileall "$pkgdir/usr/lib/clang-analyzer"
install -Dm644 LICENSE.TXT "$pkgdir/usr/share/licenses/clang-analyzer/LICENSE"
}
\ No newline at end of file
}
--- llvm/trunk/include/llvm/Operator.h 2011/02/07 16:40:21 125006
+++ llvm/trunk/include/llvm/Operator.h 2011/05/08 01:59:22 131062
@@ -186,28 +186,46 @@
};
class AddOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
+ ~AddOperator(); // DO NOT IMPLEMENT
+};
class SubOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
+ ~SubOperator(); // DO NOT IMPLEMENT
+};
class MulOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
+ ~MulOperator(); // DO NOT IMPLEMENT
+};
class ShlOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
+ ~ShlOperator(); // DO NOT IMPLEMENT
+};
class SDivOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
+ ~SDivOperator(); // DO NOT IMPLEMENT
+};
class UDivOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
+ ~UDivOperator(); // DO NOT IMPLEMENT
+};
class AShrOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
+ ~AShrOperator(); // DO NOT IMPLEMENT
+};
class LShrOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
+ ~LShrOperator(); // DO NOT IMPLEMENT
+};
class GEPOperator
: public ConcreteOperator<Operator, Instruction::GetElementPtr> {
+ ~GEPOperator(); // DO NOT IMPLEMENT
+
enum {
IsInBounds = (1 << 0)
};
diff -Naur clang-2.9//lib/Frontend/InitHeaderSearch.cpp clang-2.9-patched//lib/Frontend/InitHeaderSearch.cpp
--- clang-2.9//lib/Frontend/InitHeaderSearch.cpp 2011-03-22 00:24:04.000000000 +0000
+++ clang-2.9-patched//lib/Frontend/InitHeaderSearch.cpp 2011-05-06 01:01:11.000000000 +0000
@@ -748,10 +748,10 @@
AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5",
"x86_64-suse-linux", "", "", triple);
- // Arch Linux 2008-06-24
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1",
+ // Chakra Linux 2011-05-06
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5.3",
"i686-pc-linux-gnu", "", "", triple);
- AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.3.1",
+ AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.5.3",
"x86_64-unknown-linux-gnu", "", "", triple);
// Gentoo x86 gcc 4.5.2
AddGnuCPlusPlusIncludePaths(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment