From a2f738f6e02a07266e046520bc16daf4bd7062d7 Mon Sep 17 00:00:00 2001 From: idriskalp Date: Sat, 4 Jan 2020 21:18:33 +0300 Subject: [PATCH] llvm 9.0.1 --- programming/build/llvm/actions.py | 109 ++++++++++++++++++------------ programming/build/llvm/pspec.xml | 74 +++++++++++++++++--- 2 files changed, 128 insertions(+), 55 deletions(-) mode change 100644 => 100755 programming/build/llvm/actions.py mode change 100644 => 100755 programming/build/llvm/pspec.xml diff --git a/programming/build/llvm/actions.py b/programming/build/llvm/actions.py old mode 100644 new mode 100755 index de46aac56e..2c77bf96eb --- a/programming/build/llvm/actions.py +++ b/programming/build/llvm/actions.py @@ -3,70 +3,91 @@ # 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 cmaketools from pisi.actionsapi import shelltools +from pisi.actionsapi import get +from pisi.actionsapi import cmaketools +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 \ - " +def setup(): + if get.buildTYPE() != "emul32": - 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") + if not shelltools.can_access_directory("tools/clang"): + shelltools.system("tar xf ../clang-%s.src.tar.xz -C tools" % get.srcVERSION()) + shelltools.move("tools/clang-%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") - else: + shelltools.system("tar xf ../lldb-%s.src.tar.xz -C tools" % get.srcVERSION()) + shelltools.move("tools/lldb-*", "tools/lldb") + + shelltools.system("tar xf ../lld-%s.src.tar.xz -C tools" % get.srcVERSION()) + shelltools.move("tools/lld-*", "tools/lld") + + shelltools.system("tar xf ../polly-%s.src.tar.xz -C tools" % get.srcVERSION()) + shelltools.move("tools/polly-*", "tools/polly") + + 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", "clang") + shelltools.export("CXX", "clang++") + + + if get.buildTYPE() == "emul32": + shelltools.export("CC", "clang -m32") + shelltools.export("CXX", "clang++ -m32") shelltools.export("PKG_CONFIG_PATH","/usr/lib32/pkgconfig") - shelltools.makedirs("build") + shelltools.makedirs("build") + shelltools.cd("build") if get.buildTYPE() != "emul32": - 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=".." ) + 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 \ + -DBUILD_SHARED_LIBS=ON \ + -DLLVM_ENABLE_RTTI=ON \ + -DLLVM_ENABLE_EH=ON \ + -DLLVM_INCLUDEDIR=/usr/include \ + -DLLVM_ENABLE_ASSERTIONS=OFF \ + -DFFI_INCLUDE_DIR=/usr/lib/libffi-3.2.1/include \ + -DENABLE_SHARED=ON" % options, sourceDir=".." ) def build(): + shelltools.makedirs("build") shelltools.cd("build") + cmaketools.make() def install(): - shelltools.cd("build") + shelltools.makedirs("build") + shelltools.cd("build") + cmaketools.rawInstall("DESTDIR=%s" % get.installDIR()) if get.buildTYPE() == "emul32": diff --git a/programming/build/llvm/pspec.xml b/programming/build/llvm/pspec.xml old mode 100644 new mode 100755 index 7f86badc3b..b0d8401d25 --- a/programming/build/llvm/pspec.xml +++ b/programming/build/llvm/pspec.xml @@ -11,12 +11,13 @@ NCSA The Low Level Virtual Machine 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. - https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/llvm-9.0.1.src.tar.xz - https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/lldb-9.0.1.src.tar.xz - https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/lld-9.0.1.src.tar.xz - https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang-9.0.1.src.tar.xz - https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang-tools-extra-9.0.1.src.tar.xz - https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/compiler-rt-9.0.1.src.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/llvm-9.0.1.src.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang-9.0.1.src.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/clang-tools-extra-9.0.1.src.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/lldb-9.0.1.src.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/lld-9.0.1.src.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/polly-9.0.1.src.tar.xz + https://github.com/llvm/llvm-project/releases/download/llvmorg-9.0.1/compiler-rt-9.0.1.src.tar.xz zlib-devel libxml2-devel @@ -30,6 +31,7 @@ cmake binutils + llvm-clang @@ -49,6 +51,7 @@ /usr/bin /usr/bin/llvm-config /usr/include/llvm* + /usr/include/polly* /usr/lib/llvm /usr/lib /etc/ld.so.conf.d @@ -78,6 +81,7 @@ /usr/lib/libLLVM*.so /usr/lib/LLVMgold.* /usr/lib/libLTO.* + /usr/lib/libPolly*.so /usr/lib/bfd-plugins/LLVMgold.so /usr/share/licenses/llvm-libs/LICENSE @@ -109,7 +113,8 @@ /usr/lib/liblldbPluginObjCLanguage.a - + + lldb-devel Development headers lldb @@ -120,8 +125,53 @@ /usr/include/lldb/* + + + lld + Linker from the LLVM project + + llvm-libs + zlib + libffi + libedit + libgcc + ncurses + python + libxml2 + + + /usr/bin/ld.lld + /usr/bin/ld64.lld + /usr/bin/lld + /usr/bin/lld-link + /usr/bin/wasm-ld + /usr/lib/liblldCOFF.* + /usr/lib/liblldCommon.* + /usr/lib/liblldCore.* + /usr/lib/liblldDriver.* + /usr/lib/liblldELF.* + /usr/lib/liblldMachO.* + /usr/lib/liblldMinGW.* + /usr/lib/liblldReaderWriter.* + /usr/lib/liblldWasm.* + /usr/lib/liblldYAML.* + /usr/share/doc/lld + + + + + lld-devel + Development headers lld + + lld + + + /usr/include/lld/* + + + llvm-clang-analyzer app:console @@ -156,6 +206,8 @@ /usr/bin/tblgen /usr/lib/clang /usr/lib/libclang* + + /usr/share/man/man1/clang.1 /usr/lib/cmake/clang/Clang* /usr/share/clang @@ -211,12 +263,12 @@ - - 2020-01-03 + + 2020-01-04 9.0.1 Version bump. - Marcin Bojara - marcin.bojara@gmail.com + Idris Kalp + idriskalp@gmail.com 2019-05-23