Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=xfcetesting.git;a=commitdiff;h=21690abdf357516275e55cdef0b1e4d4eb29892d
commit 21690abdf357516275e55cdef0b1e4d4eb29892d Author: Devil505 <[email protected]> Date: Thu Oct 27 13:57:36 2011 +0200 llvm-2.9-4-i686 * added clang and ocaml bindings as subpkgs * I know it's really ugly, if someone can do better, be my guest! * Pingax you have now clang for Gnustem Etoilé:) diff --git a/source/devel-extra/llvm/FrugalBuild b/source/devel-extra/llvm/FrugalBuild index 2d4b769..905df43 100644 --- a/source/devel-extra/llvm/FrugalBuild +++ b/source/devel-extra/llvm/FrugalBuild @@ -3,20 +3,164 @@ pkgname=llvm pkgver=2.9 -pkgrel=3 +pkgrel=4 url="http://www.llvm.org" pkgdesc="Low Level Virtual Machine ( Compiler , Tools and Libs )" depends=('libstdc++') -makedepends=('groff') +makedepends=('groff' 'libffi' 'python' 'ocaml') groups=('devel-extra') archs=('i686' 'x86_64' 'ppc' 'arm') -Finclude cmake up2date="Flasttar $url/releases/download.html" -source=(http://www.llvm.org/releases/$pkgver/$pkgname-$pkgver.tgz) -sha1sums=('500f587f840199ac53c4fc7572839d08fa9d9123') +source=(http://llvm.org/releases/$pkgver/$pkgname-$pkgver.tgz \ + http://llvm.org/releases/$pkgver/clang-$pkgver.tgz \ + clang-plugin-loader-registry.patch \ + cindexer-clang-path.patch \ + clang-toolchains-gcc-versions.patch \ + clang-pure64.patch \ + enable-lto.patch) +sha1sums=('500f587f840199ac53c4fc7572839d08fa9d9123' \ + '5fd3b5cec050ec12858c1602b23cf096282ad4a4' \ + 'f616f6147bb6bd752b9f3f3e93a569cc70442107' \ + '8d091c17cb43e6afbaa5c5381a29764676b3017f' \ + 'c55bfa2448b605e9eb300b07950860eb2f9cc8a1' \ + 'f2ed97c095d8ffd04f8e2dd623ab38eb6db0d020' \ + 'c59f4bb865f9f513096fff12cefa4583fa5d9e59') + +subpkgs=("${subpkgs[@]}" "clang") +subdescs=("${subdescs[@]}" "C language family frontend for LLVM") +subdepends=("${subdepends[@]}" "") +subrodepends=("${subrodepends[@]}" "$pkgname=$pkgver") +subgroups=("${subgroups[@]}" 'devel-extra') +subarchs=("${subarchs[@]}" 'i686 x86_64') + +subpkgs=("${subpkgs[@]}" "$pkgname-ocaml") +subdescs=("${subdescs[@]}" "OCaml bindings for LLVM") +subdepends=("${subdepends[@]}" "ocaml") +subrodepends=("${subrodepends[@]}" "$pkgname=$pkgver") +subgroups=("${subgroups[@]}" 'devel-extra') +subarchs=("${subarchs[@]}" 'i686 x86_64') build() { - Fbuild --disable-assertions + Fcd + # At the present, clang must reside inside the LLVM source code tree to build + # See http://llvm.org/bugs/show_bug.cgi?id=4840 + rm -rf tools/clang || Fdie + cp -r "$Fsrcdir/clang-$pkgver" tools/clang || Fdie + + # Fix symbolic links from OCaml bindings to LLVM libraries + sed -i 's:\$(PROJ_libdir):/usr/lib/llvm:' bindings/ocaml/Makefile.ocaml || Fdie + + # Fix installation directories, ./configure doesn't seem to set them right + sed -i -e 's:\$(PROJ_prefix)/etc/llvm:/etc/llvm:' \ + -e 's:\$(PROJ_prefix)/lib:$(PROJ_prefix)/lib/llvm:' \ + -e 's:\$(PROJ_prefix)/docs/llvm:$(PROJ_prefix)/share/doc/llvm:' \ + Makefile.config.in || Fdie + + # Fix insecure rpath (http://bugs.archlinux.org/task/14017) + sed -i 's:$(RPATH) -Wl,$(\(ToolDir\|LibDir\|ExmplDir\))::g' Makefile.rules || Fdie + + # Get the correct list of symbols to export + # See http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-April/008559.html + Fpatch clang-plugin-loader-registry.patch + + # Fix clang path in CIndexer.cpp (https://bugs.archlinux.org/task/22799) + cd tools/clang || Fdie + Fpatch cindexer-clang-path.patch + + # Add GCC 4.6.1 to GccVersions (FS#23631) + Fpatch clang-toolchains-gcc-versions.patch + + if [[ $CARCH == x86_64 ]]; then + # Adjust lib paths + Fpatch clang-pure64.patch + fi + + # Make -flto work + # Use gold instead of default linker, and always use the plugin + Fpatch enable-lto.patch + + # Apply strip option to configure + _optimized_switch="enable" + [[ $(check_option strip) == n ]] && _optimized_switch="disable" + + # Include location of libffi headers in CPPFLAGS + export CPPFLAGS="$CPPFLAGS $(pkg-config --cflags libffi)" + + _cxx_headers="/usr/include/c++/clang-$pkgver" + + cd ../.. || Fdie + Fconf \ + --prefix=/usr \ + --libdir=/usr/lib/llvm \ + --sysconfdir=/etc \ + --enable-shared \ + --enable-libffi \ + --enable-targets=all \ + --disable-expensive-checks \ + --disable-debug-runtime \ + --disable-assertions \ + #--with-binutils-include=/usr/include \ + --with-cxx-include-root=$_cxx_headers \ + --with-cxx-include-arch=$CHOST \ + --$_optimized_switch-optimized + + make REQUIRES_RTTI=1 || Fdie + + # We move the clang directory out of the tree so it won't get installed and + # then we bring it back in for the clang package + mv tools/clang "$Fsrcdir" + # -j1 is due to race conditions during the installation of the OCaml bindings + make -j1 DESTDIR="$Fdestdir" install || Fdie + mv "$Fsrcdir/clang" tools || Fdie + + # Remove duplicate files installed by the OCaml bindings + rm "$Fdestdir"/usr/{lib/llvm/libllvm*,share/doc/llvm/ocamldoc.tar.gz} || Fdie + + # Fix permissions of static libs + chmod -x "$Fdestdir"/usr/lib/llvm/*.a || Fdie + + # Fix libdir in llvm-config (http://bugs.archlinux.org/task/14487) + sed -i 's:\(ABS_RUN_DIR/lib\):\1/llvm:' "$Fdestdir/usr/bin/llvm-config" || Fdie + + # Get rid of example Hello transformation + rm "$Fdestdir"/usr/lib/llvm/*LLVMHello.* || Fdie + + # Symlink the gold plugin where clang expects it + ln -s llvm/LLVMgold.so "$Fdestdir/usr/lib/LLVMgold.so" || Fdie + + # Add ld.so.conf.d entry + install -d "$Fdestdir/etc/ld.so.conf.d" || Fdie + echo /usr/lib/llvm >"$Fdestdir/etc/ld.so.conf.d/llvm.conf" || Fdie + + Fcd + + # Remove execute bit from static libraries + chmod -x "$Fdestdir"/usr/lib/ocaml/libllvm*.a || Fdie + + # Fix installation path for clang docs + sed -i 's:$(PROJ_prefix)/share/doc/llvm:$(PROJ_prefix)/share/doc/clang:' \ + "$Fsrcdir/llvm-$pkgver/Makefile.config" || Fdie + + cd "$Fsrcdir/llvm-$pkgver/tools/clang" || Fdie + make DESTDIR="$Fdestdir" install || Fdie + + # Fix permissions of static libs + chmod -x "$Fdestdir"/usr/lib/llvm/*.a || Fdie + + # Revert the path change in case we want to do a repackage later + sed -i 's:$(PROJ_prefix)/share/doc/clang:$(PROJ_prefix)/share/doc/llvm:' \ + "$Fsrcdir/llvm-$pkgver/Makefile.config" || Fdie + + Fsplit clang /usr/bin/clang* + Fsplit clang /usr/include/clang* + + Fsplit clang /usr/lib/clang/ + Fsplit clang /usr/lib/llvm/libclang* + Fsplit clang /usr/share/doc/clang + Fsplit clang /usr/share/man/man1/clang* + + Fsplit $pkgname-ocaml usr/lib/ocaml/ + Fsplit $pkgname-ocaml usr/share/doc/llvm/ocamldoc/ } # optimization OK diff --git a/source/devel-extra/llvm/cindexer-clang-path.patch b/source/devel-extra/llvm/cindexer-clang-path.patch new file mode 100644 index 0000000..ddaab69 --- /dev/null +++ b/source/devel-extra/llvm/cindexer-clang-path.patch @@ -0,0 +1,10 @@ +--- tools/libclang/CIndexer.cpp.orig 2011-04-07 13:08:24.000000000 +0300 ++++ tools/libclang/CIndexer.cpp 2011-04-07 13:11:52.224884642 +0300 +@@ -80,6 +80,7 @@ std::string CIndexer::getClangResourcesP + + // We now have the CIndex directory, locate clang relative to it. + LibClangPath.eraseComponent(); ++ LibClangPath.eraseComponent(); + #endif + + LibClangPath.appendComponent("clang"); diff --git a/source/devel-extra/llvm/clang-plugin-loader-registry.patch b/source/devel-extra/llvm/clang-plugin-loader-registry.patch new file mode 100644 index 0000000..f46eb9f --- /dev/null +++ b/source/devel-extra/llvm/clang-plugin-loader-registry.patch @@ -0,0 +1,11 @@ +diff -upr llvm-2.7.orig/autoconf/ExportMap.map llvm-2.7/autoconf/ExportMap.map +--- llvm-2.7.orig/autoconf/ExportMap.map 2010-02-25 00:33:41.000000000 +0200 ++++ llvm-2.7/autoconf/ExportMap.map 2010-05-10 14:14:22.000000000 +0300 +@@ -2,6 +2,7 @@ + global: main; + __progname; + environ; ++ _ZN4llvm8RegistryIN5clang14FrontendActionENS_14RegistryTraitsIS2_EEE4HeadE; + + local: *; + }; diff --git a/source/devel-extra/llvm/clang-pure64.patch b/source/devel-extra/llvm/clang-pure64.patch new file mode 100644 index 0000000..da61785 --- /dev/null +++ b/source/devel-extra/llvm/clang-pure64.patch @@ -0,0 +1,38 @@ +Index: lib/Driver/Tools.cpp +=================================================================== +--- lib/Driver/Tools.cpp (revision 123373) ++++ lib/Driver/Tools.cpp (working copy) +@@ -3306,7 +3306,7 @@ + else if (ToolChain.getArch() == llvm::Triple::arm) + CmdArgs.push_back("/lib/ld-linux.so.3"); + else +- CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2"); ++ CmdArgs.push_back("/lib/ld-linux-x86-64.so.2"); + } + + CmdArgs.push_back("-o"); +Index: lib/Driver/ToolChains.cpp +=================================================================== +--- lib/Driver/ToolChains.cpp (revision 123373) ++++ lib/Driver/ToolChains.cpp (working copy) +@@ -1317,18 +1317,10 @@ + if (Arch == llvm::Triple::x86) + Suffix64 = "/64"; + +- std::string Lib32 = "lib"; +- +- bool Exists; +- if (!llvm::sys::fs::exists("/lib32", Exists) && Exists) +- Lib32 = "lib32"; +- ++ std::string Lib32 = "lib32"; + std::string Lib64 = "lib"; +- bool Symlink; +- if (!llvm::sys::fs::exists("/lib64", Exists) && Exists && +- (llvm::sys::fs::is_symlink("/lib64", Symlink) || !Symlink)) +- Lib64 = "lib64"; + ++ bool Exists; + std::string GccTriple = ""; + if (Arch == llvm::Triple::arm) { + if (!llvm::sys::fs::exists("/usr/lib/gcc/arm-linux-gnueabi", Exists) && diff --git a/source/devel-extra/llvm/clang-toolchains-gcc-versions.patch b/source/devel-extra/llvm/clang-toolchains-gcc-versions.patch new file mode 100644 index 0000000..7e00837 --- /dev/null +++ b/source/devel-extra/llvm/clang-toolchains-gcc-versions.patch @@ -0,0 +1,12 @@ +diff -upr clang-2.9.orig/lib/Driver/ToolChains.cpp clang-2.9/lib/Driver/ToolChains.cpp +--- clang-2.9.orig/lib/Driver/ToolChains.cpp 2011-03-21 23:29:27.000000000 +0200 ++++ clang-2.9/lib/Driver/ToolChains.cpp 2011-04-08 00:03:34.000000000 +0300 +@@ -1449,7 +1449,7 @@ Linux::Linux(const HostInfo &Host, const + GccTriple = "i586-suse-linux"; + } + +- const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4", ++ const char* GccVersions[] = {"4.6.1", "4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4", + "4.4.3", "4.4", "4.3.4", "4.3.3", "4.3.2", + "4.3", "4.2.4", "4.2.3", "4.2.2", "4.2.1", + "4.2"}; diff --git a/source/devel-extra/llvm/enable-lto.patch b/source/devel-extra/llvm/enable-lto.patch new file mode 100644 index 0000000..40d9310 --- /dev/null +++ b/source/devel-extra/llvm/enable-lto.patch @@ -0,0 +1,36 @@ +Index: lib/Driver/ToolChains.cpp +=================================================================== +--- lib/Driver/ToolChains.cpp (revision 123373) ++++ lib/Driver/ToolChains.cpp (working copy) +@@ -1398,11 +1398,11 @@ + Lib = Lib64; + } + +- llvm::sys::Path LinkerPath(Base + "/../../../../" + GccTriple + "/bin/ld"); ++ llvm::sys::Path LinkerPath(Base + "/../../../../" + GccTriple + "/bin/ld.gold"); + if (!llvm::sys::fs::exists(LinkerPath.str(), Exists) && Exists) + Linker = LinkerPath.str(); + else +- Linker = GetProgramPath("ld"); ++ Linker = GetProgramPath("ld.gold"); + + LinuxDistro Distro = DetectLinuxDistro(Arch); + +Index: lib/Driver/Tools.cpp +=================================================================== +--- lib/Driver/Tools.cpp (revision 123373) ++++ lib/Driver/Tools.cpp (working copy) +@@ -3412,11 +3412,11 @@ + } + } + +- if (Args.hasArg(options::OPT_use_gold_plugin)) { ++ // if (Args.hasArg(options::OPT_use_gold_plugin)) { + CmdArgs.push_back("-plugin"); + std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so"; + CmdArgs.push_back(Args.MakeArgString(Plugin)); +- } ++ // } + + C.addCommand(new Command(JA, *this, ToolChain.Linker.c_str(), CmdArgs)); + }
_______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
