New package: llvm4.0-4.0.1

This commit is contained in:
Enno Boland 2018-03-23 16:20:40 +01:00
parent c69791ec19
commit e0f17766c5
No known key found for this signature in database
GPG Key ID: D09964719BDE9971
7 changed files with 270 additions and 0 deletions

1
srcpkgs/libllvm4.0 Symbolic link
View File

@ -0,0 +1 @@
llvm4.0

View File

@ -0,0 +1,9 @@
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "config-32.h"
#elif __WORDSIZE == 64
#include "config-64.h"
#else
#error "Unknown word size"
#endif

View File

@ -0,0 +1,9 @@
#include <bits/wordsize.h>
#if __WORDSIZE == 32
#include "llvm-config-32.h"
#elif __WORDSIZE == 64
#include "llvm-config-64.h"
#else
#error "Unknown word size"
#endif

View File

@ -0,0 +1,74 @@
From bc72a21666a9efc78e71b0296313f6e1449649fa Mon Sep 17 00:00:00 2001
From: Konstantin Zhuravlyov <kzhuravl_dev@outlook.com>
Date: Wed, 22 Mar 2017 21:48:18 +0000
Subject: [PATCH] [AMDGPU] Fix bug 31610
Differential Revision: https://reviews.llvm.org/D31258
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298551 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/Target/AMDGPU/AMDGPURuntimeMetadata.h | 8 ++++----
lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp | 5 ++---
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h b/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h
index ed147ff4c43..36e7a0c42a9 100644
--- a/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h
+++ b/lib/Target/AMDGPU/AMDGPURuntimeMetadata.h
@@ -40,8 +40,8 @@ namespace AMDGPU {
namespace RuntimeMD {
// Version and revision of runtime metadata
- const unsigned char MDVersion = 2;
- const unsigned char MDRevision = 0;
+ const uint32_t MDVersion = 2;
+ const uint32_t MDRevision = 0;
// Name of keys for runtime metadata.
namespace KeyName {
@@ -215,7 +215,7 @@ namespace RuntimeMD {
struct Metadata {
std::string Name;
std::string Language;
- std::vector<uint8_t> LanguageVersion;
+ std::vector<uint32_t> LanguageVersion;
std::vector<uint32_t> ReqdWorkGroupSize;
std::vector<uint32_t> WorkGroupSizeHint;
std::string VecTypeHint;
@@ -265,7 +265,7 @@ namespace RuntimeMD {
namespace Program {
// In-memory representation of program information.
struct Metadata {
- std::vector<uint8_t> MDVersionSeq;
+ std::vector<uint32_t> MDVersionSeq;
std::vector<std::string> PrintfInfo;
std::vector<Kernel::Metadata> Kernels;
diff --git a/lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp b/lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp
index 0e87d750f5d..7c96898297c 100644
--- a/lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp
+++ b/lib/Target/AMDGPU/MCTargetDesc/AMDGPURuntimeMD.cpp
@@ -49,7 +49,6 @@ static cl::opt<bool>
CheckRuntimeMDParser("amdgpu-check-rtmd-parser", cl::Hidden,
cl::desc("Check AMDGPU runtime metadata YAML parser"));
-LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint8_t)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(std::string)
LLVM_YAML_IS_SEQUENCE_VECTOR(Kernel::Metadata)
@@ -297,9 +296,9 @@ static Kernel::Metadata getRuntimeMDForKernel(const Function &F) {
auto Node = MD->getOperand(0);
if (Node->getNumOperands() > 1) {
Kernel.Language = "OpenCL C";
- uint16_t Major = mdconst::extract<ConstantInt>(Node->getOperand(0))
+ uint32_t Major = mdconst::extract<ConstantInt>(Node->getOperand(0))
->getZExtValue();
- uint16_t Minor = mdconst::extract<ConstantInt>(Node->getOperand(1))
+ uint32_t Minor = mdconst::extract<ConstantInt>(Node->getOperand(1))
->getZExtValue();
Kernel.LanguageVersion.push_back(Major);
Kernel.LanguageVersion.push_back(Minor);
--
2.12.2

View File

@ -0,0 +1,83 @@
From faca3fbd15d0c3108493c3c54cd93138e049ac43 Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Tue, 8 Sep 2015 22:03:02 +0200
Subject: [PATCH 3/3] musl
---
include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++
lib/Analysis/TargetLibraryInfo.cpp | 5 +++--
lib/Support/DynamicLibrary.cpp | 2 +-
lib/Support/Unix/Signals.inc | 6 +++---
utils/unittest/googletest/src/gtest.cc | 1 +
5 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
index e0a1ee3..465b65a 100644
--- a/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/include/llvm/Analysis/TargetLibraryInfo.h
@@ -18,6 +18,15 @@
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
+#undef fopen64
+#undef fseeko64
+#undef fstat64
+#undef fstatvfs64
+#undef ftello64
+#undef lstat64
+#undef stat64
+#undef tmpfile64
+
namespace llvm {
/// VecDesc - Describes a possible vectorization of a function.
/// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized
diff --git a/lib/Analysis/TargetLibraryInfo.cpp b/lib/Analysis/TargetLibraryInfo.cpp
index 635c50c..863f4a0 100644
--- a/lib/Analysis/TargetLibraryInfo.cpp
+++ b/lib/Analysis/TargetLibraryInfo.cpp
@@ -336,14 +336,15 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
}
// The following functions are available on at least Linux:
- if (!T.isOSLinux()) {
+ if (!T.isOSLinux())
+ TLI.setUnavailable(LibFunc::memalign);
+ if (1 /*!T.isGlibc()*/) {
TLI.setUnavailable(LibFunc::dunder_strdup);
TLI.setUnavailable(LibFunc::dunder_strtok_r);
TLI.setUnavailable(LibFunc::dunder_isoc99_scanf);
TLI.setUnavailable(LibFunc::dunder_isoc99_sscanf);
TLI.setUnavailable(LibFunc::under_IO_getc);
TLI.setUnavailable(LibFunc::under_IO_putc);
- TLI.setUnavailable(LibFunc::memalign);
TLI.setUnavailable(LibFunc::fopen64);
TLI.setUnavailable(LibFunc::fseeko64);
TLI.setUnavailable(LibFunc::fstat64);
diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp
index 9a7aeb5..e21750d 100644
--- a/lib/Support/DynamicLibrary.cpp
+++ b/lib/Support/DynamicLibrary.cpp
@@ -138,7 +138,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
// This macro returns the address of a well-known, explicit symbol
#define EXPLICIT_SYMBOL(SYM) \
- if (!strcmp(symbolName, #SYM)) return &SYM
+ if (!strcmp(symbolName, #SYM)) return (void *) &SYM
// On linux we have a weird situation. The stderr/out/in symbols are both
// macros and global variables because of standards requirements. So, we
diff --git a/utils/unittest/googletest/src/gtest.cc b/utils/unittest/googletest/src/gtest.cc
index 5780764..1d548c1 100644
--- a/utils/unittest/googletest/src/gtest.cc
+++ b/utils/unittest/googletest/src/gtest.cc
@@ -120,6 +120,7 @@
#if GTEST_CAN_STREAM_RESULTS_
# include <arpa/inet.h> // NOLINT
+# include <sys/socket.h> // NOLINT
# include <netdb.h> // NOLINT
#endif
--
2.5.1

93
srcpkgs/llvm4.0/template Normal file
View File

@ -0,0 +1,93 @@
# Template file for 'llvm4.0'
pkgname=llvm4.0
version=4.0.1
revision=1
wrksrc="llvm-${version}.src"
lib32disabled=yes
build_style=cmake
configure_args="
-DCMAKE_BUILD_TYPE=Release
-DLLVM_INSTALL_UTILS=ON
-DLLVM_BUILD_LLVM_DYLIB=ON
-DLLVM_LINK_LLVM_DYLIB=ON
-DLLVM_ENABLE_RTTI=ON
-DLLVM_ENABLE_FFI=ON
-DLLVM_BINUTILS_INCDIR=/usr/include"
short_desc="Low Level Virtual Machine"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.llvm.org"
license="BSD"
distfiles="http://www.llvm.org/releases/${version}/llvm-${version}.src.tar.xz"
checksum="da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51"
# XXX Investigate ocaml bindings.
hostmakedepends="groff perl python zlib-devel libffi-devel swig"
makedepends="python-devel zlib-devel libffi-devel libedit-devel libxml2-devel binutils-devel"
depends="libllvm4.0"
conflicts="llvm3.9>=0 llvm>=0"
post_extract() {
# patches
cd ${XBPS_BUILDDIR}/llvm-${version}.src
for i in ${FILESDIR}/patches/llvm/llvm-*.patch; do
msg_normal "Applying $i to llvm\n"
patch -sNp1 -i ${i}
done
}
pre_configure() {
if [ "$CROSS_BUILD" ]; then
msg_normal "Building host tblgen\n"
mkdir -p build/HOST
cd build/HOST
CC="$BUILD_CC" CXX="$BUILD_CXX" CFLAGS="$BUILD_CFLAGS" \
CXXFLAGS="$BUILD_CXXFLAGS" LDFLAGS="$BUILD_LDFLAGS" \
cmake ../.. -DCMAKE_BUILD_TYPE=Release
make ${makejobs} -C utils/TableGen
make ${makejobs} -C tools/clang/utils/TableGen
configure_args+=" -DLLVM_TABLEGEN=${wrksrc}/build/HOST/bin/llvm-tblgen"
configure_args+=" -DCLANG_TABLEGEN=${wrksrc}/build/HOST/bin/clang-tblgen"
cd ../..
fi
case "$XBPS_TARGET_MACHINE" in
i686*) _arch="X86";;
x86_64*) _arch="X86";;
arm*) _arch="ARM";;
aarch64*) _arch="AArch64";;
mips*) _arch="Mips";;
esac
configure_args+=" -DLLVM_TARGET_ARCH=${_arch}"
configure_args+=" -DLLVM_DEFAULT_TARGET_TRIPLE=${XBPS_CROSS_TRIPLET:-$XBPS_TRIPLET}"
}
do_install() {
vlicense LICENSE.TXT
cd build
cmake -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr -P cmake_install.cmake
# Fix permissions of static libs
chmod -x ${DESTDIR}/usr/lib/*.a
# Required for multilib.
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
for _header in llvm-config; do
mv ${DESTDIR}/usr/include/llvm/Config/${_header}{,-64}.h
vinstall ${FILESDIR}/llvm-Config-${_header}.h 644 \
usr/include/llvm/Config ${_header}.h
done
fi
# Remove llvm-config-host in cross builds.
if [ "$CROSS_BUILD" ]; then
rm -f ${DESTDIR}/usr/bin/llvm-config-host
fi
}
libllvm4.0_package() {
short_desc+=" - runtime library"
pkg_install() {
vmove "usr/lib/libLLVM-*.so*"
}
}

1
srcpkgs/llvm4.0/update Normal file
View File

@ -0,0 +1 @@
site="http://www.llvm.org/releases/download.html"