update llvm

This commit is contained in:
Marcin Bojara
2020-01-04 17:43:53 +01:00
parent 954ab15919
commit 8c430428c7
2 changed files with 56 additions and 65 deletions
+43 -58
View File
@@ -3,85 +3,70 @@
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt
from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
from pisi.actionsapi import get
from pisi.actionsapi import cmaketools
from pisi.actionsapi import shelltools
libdir = "/usr/lib32/llvm" if get.buildTYPE() == "emul32" else "/usr/lib/llvm"
lib = "lib32" if get.buildTYPE() == "emul32" else "lib"
libdir = "/usr/%s/llvm" % lib
def setup():
options = "-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_FFI=ON \
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_ENABLE_SPHINX=ON \
-DLLVM_ENABLE_DOXYGEN=OFF \
-DSPHINX_WARNINGS_AS_ERRORS=OFF \
-DFFI_INCLUDE_DIR=$(pkg-config --variable=includedir libffi) \
-DLLVM_BINUTILS_INCDIR=/usr/include \
"
if get.buildTYPE() != "emul32":
if not shelltools.can_access_directory("tools/clang"):
shelltools.system("tar xf ../cfe-%s.src.tar.xz -C tools" % get.srcVERSION())
shelltools.move("tools/cfe-%s.src" % get.srcVERSION(), "tools/clang")
shelltools.system("tar xf ../clang-tools-extra-%s.src.tar.xz -C tools" % get.srcVERSION())
shelltools.move("tools/clang-tools-extra-*", "tools/clang/extra")
if not shelltools.can_access_directory("tools/clang"):
shelltools.move("../clang-%s.src" % get.srcVERSION(), "tools/clang")
shelltools.move("../clang-tools-extra-%s.src" % get.srcVERSION(), "tools/clang/tools/extra")
shelltools.move("../lld-%s.src" % get.srcVERSION(), "tools/lld")
shelltools.move("../lldb-%s.src" % get.srcVERSION(), "tools/lldb")
shelltools.move("../compiler-rt-%s.src" % get.srcVERSION(), "projects/compiler-rt")
shelltools.system("tar xf ../lldb-%s.src.tar.xz -C tools" % get.srcVERSION())
shelltools.move("tools/lldb-*", "tools/lldb")
if not shelltools.can_access_directory("projects/compiler-rt"):
shelltools.system("tar xf ../compiler-rt-%s.src.tar.xz -C projects" % get.srcVERSION())
shelltools.move("projects/compiler-rt-%s.src" % get.srcVERSION(), "projects/compiler-rt")
shelltools.export("CC", "gcc")
shelltools.export("CXX", "g++")
if get.buildTYPE() == "emul32":
shelltools.export("CC", "gcc -m32")
shelltools.export("CXX", "g++ -m32")
else:
shelltools.export("PKG_CONFIG_PATH","/usr/lib32/pkgconfig")
shelltools.makedirs("build")
shelltools.makedirs("build")
shelltools.cd("build")
if get.buildTYPE() != "emul32":
options = "-DCMAKE_C_FLAGS:STRING=-m64 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_CXX_FLAGS:STRING=-m64 \
-DLLVM_TARGET_ARCH:STRING=x86_64 \
-DLLVM_DEFAULT_TARGET_TRIPLE=%s " % get.HOST()
if get.buildTYPE() == "emul32":
options = " -DCMAKE_C_FLAGS:STRING=-m32 \
-DCMAKE_INSTALL_PREFIX=/emul32 \
-DLLVM_TARGET_ARCH:STRING=i686 \
-DLLVM_LIBDIR_SUFFIX=32 \
-DLLVM_DEFAULT_TARGET_TRIPLE='i686-pc-linux-gnu' \
-DCMAKE_CXX_FLAGS:STRING=-m32"
cmaketools.configure("-DCMAKE_BUILD_TYPE=Release \
%s \
-DLLVM_ENABLE_FFI=ON \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_INCLUDEDIR=/usr/include \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DFFI_INCLUDE_DIR=/usr/lib/libffi-3.2.1/include \
-DENABLE_SHARED=ON" % options, sourceDir=".." )
options = "-DCMAKE_INSTALL_PREFIX=/usr \
-DLLVM_TARGET_ARCH:STRING=x86_64 \
-DLLVM_DEFAULT_TARGET_TRIPLE=%s \
" % get.HOST()
else:
pisitools.flags.replace("-march=\S+", "-march=i686 -m32")
options = "-DCMAKE_INSTALL_PREFIX=/emul32 \
-DLLVM_TARGET_ARCH:STRING=i686 \
-DLLVM_LIBDIR_SUFFIX=32 \
-DLLVM_DEFAULT_TARGET_TRIPLE='i686-pc-linux-gnu' \
"
options += "-DCMAKE_C_FLAGS_RELEASE=%s \
-DCMAKE_CXX_FLAGS_RELEASE=%s \
" % (get.CFLAGS(), get.CXXFLAGS())
cmaketools.configure(options, sourceDir=".." )
def build():
shelltools.makedirs("build")
shelltools.cd("build")
cmaketools.make()
def install():
shelltools.makedirs("build")
shelltools.cd("build")
shelltools.cd("build")
cmaketools.rawInstall("DESTDIR=%s" % get.installDIR())
if get.buildTYPE() == "emul32":
Executable → Regular
+13 -7
View File
@@ -11,11 +11,12 @@
<License>NCSA</License>
<Summary>The Low Level Virtual Machine</Summary>
<Description>The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.</Description>
<Archive sha1sum="d43bfea58a35e058b93a6af36a728cfc64add33d" type="tarxz">http://llvm.org/releases/7.1.0/llvm-7.1.0.src.tar.xz</Archive>
<Archive sha1sum="68673777f938bbd4ca2f05f2af670e19ffddcf0a" type="binary">http://llvm.org/releases/7.1.0/cfe-7.1.0.src.tar.xz</Archive>
<Archive sha1sum="1b8e08faff9545140defd53c15c56b3f6ca02c9b" type="binary">http://releases.llvm.org/7.1.0/clang-tools-extra-7.1.0.src.tar.xz</Archive>
<Archive sha1sum="6d11a36cc3969b9822cfb90ba659424da976a047" type="binary">http://releases.llvm.org/7.1.0/lldb-7.1.0.src.tar.xz</Archive>
<Archive sha1sum="bca06369f2f8b08e18ae095c362859b4033ae87d" type="binary">http://llvm.org/releases/7.1.0/compiler-rt-7.1.0.src.tar.xz</Archive>
<Archive sha1sum="f7fcf3bd92d130784513c06efe6910f135372ce3" type="tarxz">https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/llvm-9.0.1.src.tar.xz</Archive>
<Archive sha1sum="3afa0d2573ba55c46360419ed944a729ae08c8f7" type="tarxz">https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/lldb-9.0.1.src.tar.xz</Archive>
<Archive sha1sum="ef5f529adfb9b57b33c394641d7d5e2d1f1b5ff6" type="tarxz">https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/lld-9.0.1.src.tar.xz</Archive>
<Archive sha1sum="0d72ce018c85c54fc709c7da71d3dd1463af0bfc" type="tarxz">https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang-9.0.1.src.tar.xz</Archive>
<Archive sha1sum="f0571ec2135cb735f22baa149ac84e7334d0ac70" type="tarxz">https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang-tools-extra-9.0.1.src.tar.xz</Archive>
<Archive sha1sum="b35bc6ed7ce40f18ac45c81f4cf02ffd1f14de82" type="tarxz">https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/compiler-rt-9.0.1.src.tar.xz</Archive>
<BuildDependencies>
<Dependency>zlib-devel</Dependency>
<Dependency>libxml2-devel</Dependency>
@@ -155,8 +156,6 @@
<Path fileType="executable">/usr/bin/tblgen</Path>
<Path fileType="library">/usr/lib/clang</Path>
<Path fileType="library">/usr/lib/libclang*</Path>
<!-- <Path fileType="library">/usr/lib/liblldbPluginExpressionParserClang.a</Path> -->
<!-- <Path fileType="library">/usr/lib/liblldbPluginObjCLanguage.a</Path> -->
<Path fileType="man">/usr/share/man/man1/clang.1</Path>
<Path fileType="data">/usr/lib/cmake/clang/Clang*</Path>
<Path fileType="data">/usr/share/clang</Path>
@@ -212,6 +211,13 @@
</Package>
<History>
<Update release="11">
<Date>2020-01-03</Date>
<Version>9.0.1</Version>
<Comment>Version bump.</Comment>
<Name>Marcin Bojara</Name>
<Email>marcin.bojara@gmail.com</Email>
</Update>
<Update release="10">
<Date>2019-05-23</Date>
<Version>7.1.0</Version>