diff options
author | J0WI <J0WI@users.noreply.github.com> | 2018-11-08 11:09:29 +0100 |
---|---|---|
committer | Andy Postnikov <apostnikov@gmail.com> | 2019-01-07 03:22:44 +0200 |
commit | 1b31b74333331c7e141190631e07469dfa1ece70 (patch) | |
tree | cf5aa0b32ae341fa92dec166b5601ccb8b79f884 | |
parent | cd7e796072b2defa799dc93bcdeee8b5fc25de9e (diff) | |
download | aports-1b31b74333331c7e141190631e07469dfa1ece70.tar.bz2 aports-1b31b74333331c7e141190631e07469dfa1ece70.tar.xz |
community/llvm3.7: remove aport
-rw-r--r-- | community/llvm3.7/APKBUILD | 215 | ||||
-rw-r--r-- | community/llvm3.7/cmake-fix-libLLVM-name.patch | 76 | ||||
-rw-r--r-- | community/llvm3.7/config.guess.patch | 13 | ||||
-rw-r--r-- | community/llvm3.7/llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch | 101 | ||||
-rw-r--r-- | community/llvm3.7/llvm-0002-Fix-build-with-musl-libc.patch | 46 | ||||
-rw-r--r-- | community/llvm3.7/llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch | 33 | ||||
-rw-r--r-- | community/llvm3.7/llvm-ValueMap-fix.patch | 11 | ||||
-rw-r--r-- | community/llvm3.7/llvm-d18644-systemz-atomic-fence.patch | 163 | ||||
-rw-r--r-- | community/llvm3.7/llvm-nm-workaround.patch | 27 |
9 files changed, 0 insertions, 685 deletions
diff --git a/community/llvm3.7/APKBUILD b/community/llvm3.7/APKBUILD deleted file mode 100644 index 85be729acc..0000000000 --- a/community/llvm3.7/APKBUILD +++ /dev/null @@ -1,215 +0,0 @@ -# Contributor: Travis Tilley <ttilley@gmail.com> -# Contributor: Mitch Tishmack <mitch.tishmack@gmail.com> -# Contributor: Jakub Jirutka <jakub@jirutka.cz> -# Maintainer: Travis Tilley <ttilley@gmail.com> -_pkgname=llvm -pkgver=3.7.1 -_majorver=${pkgver%.*} -pkgname=$_pkgname$_majorver -pkgrel=7 -pkgdesc="Low Level Virtual Machine compiler system (version $_majorver)" -arch="all" -url="http://llvm.org/" -license="UOI-NCSA" -depends_dev="$pkgname=$pkgver-r$pkgrel" -makedepends="binutils-dev chrpath cmake file libffi-dev paxmark python2 zlib-dev" -subpackages="$pkgname-static $pkgname-libs $pkgname-dev" -source="https://llvm.org/releases/$pkgver/llvm-$pkgver.src.tar.xz - llvm-ValueMap-fix.patch - llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch - llvm-0002-Fix-build-with-musl-libc.patch - llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch - llvm-d18644-systemz-atomic-fence.patch - llvm-nm-workaround.patch - config.guess.patch - cmake-fix-libLLVM-name.patch - " -builddir="$srcdir/$_pkgname-$pkgver.src" - -# ARM has few failures in test suite that we don't care about currently and -# also it takes forever to run them on the builder. -case "$CARCH" in - arm*|aarch64) options="!check";; # FIXME -esac - -# NOTE: It seems that there's no (sane) way how to change includedir, sharedir -# etc. separately, just the CMAKE_INSTALL_PREFIX. Standard CMake variables and -# even LLVM-specific variables, that are related to these paths, actually -# don't work (in llvm 3.7). -# -# When building a software that depends on LLVM, utility llvm-config should be -# used to discover where is LLVM installed. It provides options to print -# path of bindir, includedir, and libdir separately, but in its source, all -# these paths are actually hard-coded against INSTALL_PREFIX. We can patch it -# and move paths manually, but I'm really not sure what it may break... -# -# Also note that we should *not* add version suffix to files in llvm bindir! -# It breaks build system of some software that depends on LLVM, because they -# don't expect these files to have a sufix. -# -# So, we install all the LLVM files into /usr/lib/llvm-$_majorver. -# BTW, Fedora and Debian do the same thing. -# -_prefix="usr/lib/llvm$_majorver" - -prepare() { - default_prepare - cd "$builddir" - - update_config_sub - - # Remove some tests that fails. - rm test/tools/llvm-objdump/macho-compact-unwind-x86_64.test \ - test/tools/llvm-objdump/macho-compact-unwind-i386.test \ - test/Transforms/GlobalOpt/alias-used.ll - - mkdir -p "$builddir"/build -} - -build() { - cd "$builddir"/build - - # Auto-detect it by guessing either. - local ffi_include_dir="$(pkg-config --cflags-only-I libffi | sed 's|^-I||g')" - - cmake -G "Unix Makefiles" -Wno-dev \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/$_prefix \ - -DCMAKE_VERBOSE_MAKEFILE=NO \ - -DFFI_INCLUDE_DIR="$ffi_include_dir" \ - -DLLVM_BINUTILS_INCDIR=/usr/include \ - -DLLVM_BUILD_DOCS=OFF \ - -DLLVM_BUILD_EXAMPLES=OFF \ - -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \ - -DLLVM_BUILD_LLVM_DYLIB=ON \ - -DLLVM_BUILD_TESTS=ON \ - -DLLVM_DEFAULT_TARGET_TRIPLE="$CBUILD" \ - -DLLVM_DYLIB_EXPORT_ALL=ON \ - -DLLVM_ENABLE_ASSERTIONS=OFF \ - -DLLVM_ENABLE_CXX1Y=ON \ - -DLLVM_ENABLE_FFI=ON \ - -DLLVM_ENABLE_LIBCXX=OFF \ - -DLLVM_ENABLE_PIC=ON \ - -DLLVM_ENABLE_RTTI=ON \ - -DLLVM_ENABLE_SPHINX=OFF \ - -DLLVM_ENABLE_TERMINFO=ON \ - -DLLVM_ENABLE_ZLIB=ON \ - -DLLVM_HOST_TRIPLE="$CHOST" \ - -DLLVM_INCLUDE_EXAMPLES=OFF \ - -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;PowerPC;SystemZ;AMDGPU;NVPTX;Mips;BPF' \ - "$builddir" - - make llvm-tblgen - make - - paxmark m \ - bin/llvm-rtdyld \ - bin/lli \ - bin/lli-child-target \ - unittests/ExecutionEngine/MCJIT/MCJITTests \ - unittests/Support/SupportTests -} - -check() { - cd "$builddir"/build - - make check-llvm -} - -package() { - cd "$builddir"/build - - make DESTDIR="$pkgdir" install - - # This tool is needed e.g. for running codegen tests in Rust package. - install -D -m 755 bin/FileCheck "$pkgdir"/$_prefix/bin/FileCheck - - cd "$pkgdir"/$_prefix - - # Remove RPATHs. - file lib/*.so bin/* \ - | awk -F: '$2~/ELF/{print $1}' \ - | xargs -r chrpath -d - - # Symlink files from /usr/lib/llvm*/bin to /usr/bin. - mkdir -p "$pkgdir"/usr/bin - local name path - for path in bin/*; do - name=${path##*/} - case "$name" in - FileCheck | obj2yaml | yaml2obj) continue;; - esac - ln -s ../lib/llvm$_majorver/bin/$name "$pkgdir"/usr/bin/$name-$_majorver - done - - # Move /usr/lib/$pkgname/include/ into /usr/include/$pkgname/ - # and symlink it back. - _mv include/* "$pkgdir"/usr/include/$pkgname/ - rmdir include - ln -s ../../include/$pkgname include - - # Move /usr/lib/$pkgname/share/llvm/cmake/ into /usr/lib/cmake/$pkgname/ - # and symlink it back. - _mv share/llvm/cmake/* "$pkgdir"/usr/lib/cmake/$pkgname/ - rmdir share/llvm/cmake - ln -s ../../../cmake/$pkgname share/llvm/cmake - - ln -s libLTO-$_majorver.so lib/libLTO.so -} - -static() { - pkgdesc="LLVM $_majorver static libraries" - - _mv "$pkgdir"/$_prefix/lib/*.a "$subpkgdir"/$_prefix/lib/ -} - -libs() { - pkgdesc="LLVM $_majorver runtime library" - local soname="libLLVM-$_majorver.so" - local soname2="libLLVM-$pkgver.so" - - mkdir -p "$subpkgdir" - cd "$subpkgdir" - - # libLLVM should be in /usr/lib. This is needed for binaries that are - # dynamically linked with libLLVM, so they can find it on default path. - _mv "$pkgdir"/$_prefix/lib/$soname usr/lib/ - ln -s $soname usr/lib/$soname2 - - # And also symlink it back to the LLVM prefix. - mkdir -p $_prefix/lib - ln -s ../../$soname $_prefix/lib/$soname - ln -s ../../$soname $_prefix/lib/$soname2 -} - -dev() { - default_dev - cd "$subpkgdir" - - _mv "$pkgdir"/$_prefix/lib \ - "$pkgdir"/$_prefix/share \ - "$pkgdir"/$_prefix/include \ - $_prefix/ - - _mv "$pkgdir"/$_prefix/bin/FileCheck \ - "$pkgdir"/$_prefix/bin/llvm-config \ - $_prefix/bin/ - - _mv "$pkgdir"/usr/bin/llvm-config-* usr/bin/ -} - -_mv() { - local dest; for dest; do true; done # get last argument - mkdir -p "$dest" - mv $@ -} - -sha512sums="ac521debc02f6deba96ef975d6a546b0c5c77299c1dbf5e1b87a7974ff5e7fd715bd7e384b92d9adf572ce47130bdbf6d3c648eb0d7f72f16f976292e4909e90 llvm-3.7.1.src.tar.xz -006ef8c8a1d49321016cb0f251e256177100c1097a0dedec2061ffc1363ae3d159c56f22df7bea67b13991e61b1d5322feeb7c732aeccc1a35835a89c50f7560 llvm-ValueMap-fix.patch -7a74abc15d8abb4ef4884469544168bfefb6859166f041c7d766157d77b20ea5b6bb06ffc0dd4f6965eab95294102f060d7a969e778ec933d2859c4900ec7380 llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch -f84cd65d7042e89826ba6e8d48c4c302bf4980da369d7f19a55f217e51c00ca8ed178d453df3a3cee76598a7cecb94aed0775a6d24fe73266f82749913fc3e71 llvm-0002-Fix-build-with-musl-libc.patch -19bfb9282455d39d07dbb2b1293b03a45c57d522fbb9c5e58dac034200669628b97e7a90cd4ff5d52d9bb79acfccbef653d8a1140a7f0589ecd6f9b7c4ba0eb6 llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch -303ef099e8e21f9bc5f88ba1b30870e8127bea4948fc66b1858cc014cbde7bd917dc0bee1a511ef2adb6a9f40a3e3c3ae3fcada6ad3ee339807ac893c882d7ae llvm-d18644-systemz-atomic-fence.patch -11db6f3c5d697bc536c7d053530f7a5572756185e16399c32c31306861b58046ca9bc14b8d8097758c00a8c1a7026cbfb75636c0e697e59c53dda5848f93b006 llvm-nm-workaround.patch -caf1c9466e8163f8844bd40095d1c3ce26c9e96dcb639f64833baca65a81708d39496e8c8ea65c7f11476d752265080998f1873b79cbc92b23349258e4dfa3ab config.guess.patch -52287dd37f62e0b51c487abe62a22440d3e9df2cb6144af45ba9ddc42848495fad533bf6b13f08e1b454ee653be9b8a14e02cf81f430a7d2c9be030889ef7f72 cmake-fix-libLLVM-name.patch" diff --git a/community/llvm3.7/cmake-fix-libLLVM-name.patch b/community/llvm3.7/cmake-fix-libLLVM-name.patch deleted file mode 100644 index 600e32777f..0000000000 --- a/community/llvm3.7/cmake-fix-libLLVM-name.patch +++ /dev/null @@ -1,76 +0,0 @@ -From: Jakub Jirutka <jakub@jirutka.cz> -Date: Sun, 07 Aug 2016 12:37:00 +0200 -Subject: [PATCH] Include version in name of shared libs - -This change makes the CMake build system generate libraries for Linux and -Darwin matching the makefile build system. - -libLLVM.so -> libLLVM-$MAJOR.$MINOR.so -libLTO.so -> libLTO-$MAJOR.$MINOR.so - -See https://github.com/llvm-mirror/llvm/commit/61dbca10ea813ea3af447cc7ac2556a5e81211f9 - ---- a/cmake/modules/AddLLVM.cmake -+++ b/cmake/modules/AddLLVM.cmake -@@ -313,10 +313,12 @@ - # Same semantics as target_link_libraries(). - # ADDITIONAL_HEADERS - # May specify header files for IDE generators. -+# SONAME -+# Should set SONAME link flags and create symlinks - # ) - function(llvm_add_library name) - cmake_parse_arguments(ARG -- "MODULE;SHARED;STATIC" -+ "MODULE;SHARED;STATIC;SONAME" - "OUTPUT_NAME" - "ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS" - ${ARGN}) -@@ -418,11 +420,6 @@ - PREFIX "" - ) - endif() -- -- set_target_properties(${name} -- PROPERTIES -- SOVERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR} -- VERSION ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}) - endif() - - if(ARG_MODULE OR ARG_SHARED) -@@ -483,7 +480,7 @@ - - macro(add_llvm_library name) - cmake_parse_arguments(ARG -- "SHARED" -+ "SHARED;SONAME" - "" - "" - ${ARGN}) -@@ -526,6 +523,15 @@ - -DCMAKE_INSTALL_COMPONENT=${name} - -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") - endif() -+ if(ARG_SHARED) -+ get_target_property(output_name ${name} OUTPUT_NAME) -+ if(${output_name} STREQUAL "output_name-NOTFOUND") -+ set(output_name ${name}) -+ endif() -+ set(library_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}) -+ set(api_name ${output_name}-${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}${LLVM_VERSION_SUFFIX}) -+ set_target_properties(${name} PROPERTIES OUTPUT_NAME ${library_name}) -+ endif() - endif() - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) - endif() ---- a/tools/llvm-shlib/CMakeLists.txt -+++ b/tools/llvm-shlib/CMakeLists.txt -@@ -95,7 +95,7 @@ - add_custom_target(libLLVMExports DEPENDS ${LLVM_EXPORTED_SYMBOL_FILE}) - endif() - --add_llvm_library(LLVM SHARED ${SOURCES}) -+add_llvm_library(LLVM SHARED SONAME ${SOURCES}) - - list(REMOVE_DUPLICATES LIB_NAMES) - if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") # FIXME: It should be "GNU ld for elf" diff --git a/community/llvm3.7/config.guess.patch b/community/llvm3.7/config.guess.patch deleted file mode 100644 index d6dc20b84e..0000000000 --- a/community/llvm3.7/config.guess.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/autoconf/config.guess 2016-08-04 01:13:53.941899947 +0200 -+++ b/autoconf/config.guess 2016-08-04 01:16:30.084553757 +0200 -@@ -142,6 +142,10 @@ - - # Note: order is significant - the case branches are not exclusive. - -+if [ -n "$CBUILD" ]; then -+ echo "$CBUILD"; exit -+fi -+ - case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or diff --git a/community/llvm3.7/llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch b/community/llvm3.7/llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch deleted file mode 100644 index d3e06ec1ac..0000000000 --- a/community/llvm3.7/llvm-0001-Add-Musl-MuslEABI-and-Musl-EABIHF-triples.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 1cec99f6d53d442d8a8c9d2ed9f4a58f8fdc6412 Mon Sep 17 00:00:00 2001 -From: Natanael Copa <ncopa@alpinelinux.org> -Date: Thu, 18 Feb 2016 08:30:07 +0100 -Subject: [PATCH 1/3] Add Musl, MuslEABI and Musl EABIHF triples - ---- - include/llvm/ADT/Triple.h | 11 +++++++++++ - lib/Support/Triple.cpp | 7 +++++++ - lib/Target/ARM/ARMSubtarget.h | 3 +++ - lib/Target/ARM/ARMTargetMachine.cpp | 2 ++ - 4 files changed, 23 insertions(+) - ---- a/include/llvm/ADT/Triple.h -+++ b/include/llvm/ADT/Triple.h -@@ -167,6 +167,10 @@ - EABIHF, - Android, - -+ Musl, -+ MuslEABI, -+ MuslEABIHF, -+ - MSVC, - Itanium, - Cygnus, -@@ -548,6 +552,13 @@ - /// setOSAndEnvironmentName - Set the operating system and optional - /// environment components with a single string. - void setOSAndEnvironmentName(StringRef Str); -+ -+ /// Tests whether the target is musl libc -+ bool isMusl() const { -+ return getEnvironment() == Triple::Musl || -+ getEnvironment() == Triple::MuslEABI || -+ getEnvironment() == Triple::MuslEABIHF; -+ } - - /// @} - /// @name Helpers to build variants of a particular triple. ---- a/lib/Support/Triple.cpp -+++ b/lib/Support/Triple.cpp -@@ -192,6 +192,9 @@ - case CODE16: return "code16"; - case EABI: return "eabi"; - case EABIHF: return "eabihf"; -+ case Musl: return "musl"; -+ case MuslEABIHF: return "muslgnueabihf"; -+ case MuslEABI: return "muslgnueabi"; - case Android: return "android"; - case MSVC: return "msvc"; - case Itanium: return "itanium"; -@@ -427,6 +430,9 @@ - .StartsWith("code16", Triple::CODE16) - .StartsWith("gnu", Triple::GNU) - .StartsWith("android", Triple::Android) -+ .StartsWith("muslgnueabihf", Triple::MuslEABIHF) -+ .StartsWith("muslgnueabi", Triple::MuslEABI) -+ .StartsWith("musl", Triple::Musl) - .StartsWith("msvc", Triple::MSVC) - .StartsWith("itanium", Triple::Itanium) - .StartsWith("cygnus", Triple::Cygnus) -@@ -1326,6 +1332,7 @@ - switch (getEnvironment()) { - case llvm::Triple::EABIHF: - case llvm::Triple::GNUEABIHF: -+ case llvm::Triple::MuslEABIHF: - return "arm1176jzf-s"; - default: - return "arm7tdmi"; ---- a/lib/Target/ARM/ARMSubtarget.h -+++ b/lib/Target/ARM/ARMSubtarget.h -@@ -381,8 +381,10 @@ - bool isTargetEHABICompatible() const { - return (TargetTriple.getEnvironment() == Triple::EABI || - TargetTriple.getEnvironment() == Triple::GNUEABI || -+ TargetTriple.getEnvironment() == Triple::MuslEABI || - TargetTriple.getEnvironment() == Triple::EABIHF || - TargetTriple.getEnvironment() == Triple::GNUEABIHF || -+ TargetTriple.getEnvironment() == Triple::MuslEABIHF || - TargetTriple.getEnvironment() == Triple::Android) && - !isTargetDarwin() && !isTargetWindows(); - } -@@ -391,6 +393,7 @@ - // FIXME: this is invalid for WindowsCE - return TargetTriple.getEnvironment() == Triple::GNUEABIHF || - TargetTriple.getEnvironment() == Triple::EABIHF || -+ TargetTriple.getEnvironment() == Triple::MuslEABIHF || - isTargetWindows(); - } - bool isTargetAndroid() const { ---- a/lib/Target/ARM/ARMTargetMachine.cpp -+++ b/lib/Target/ARM/ARMTargetMachine.cpp -@@ -97,6 +97,8 @@ - case llvm::Triple::GNUEABIHF: - case llvm::Triple::EABIHF: - case llvm::Triple::EABI: -+ case llvm::Triple::MuslEABI: -+ case llvm::Triple::MuslEABIHF: - TargetABI = ARMBaseTargetMachine::ARM_ABI_AAPCS; - break; - case llvm::Triple::GNU: diff --git a/community/llvm3.7/llvm-0002-Fix-build-with-musl-libc.patch b/community/llvm3.7/llvm-0002-Fix-build-with-musl-libc.patch deleted file mode 100644 index 6ee91ea44d..0000000000 --- a/community/llvm3.7/llvm-0002-Fix-build-with-musl-libc.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 5c571082fdaf61f6df19d9b7137dc26d71334058 Mon Sep 17 00:00:00 2001 -From: Natanael Copa <ncopa@alpinelinux.org> -Date: Thu, 18 Feb 2016 10:33:04 +0100 -Subject: [PATCH 2/3] Fix build with musl libc - -On musl libc the fopen64 and fopen are the same thing, but for -compatibility they have a `#define fopen64 fopen`. Same applies for -fseek64, fstat64, fstatvfs64, ftello64, lstat64, stat64 and tmpfile64. ---- - include/llvm/Analysis/TargetLibraryInfo.h | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h -index 7becdf0..7f14427 100644 ---- a/include/llvm/Analysis/TargetLibraryInfo.h -+++ b/include/llvm/Analysis/TargetLibraryInfo.h -@@ -18,6 +18,26 @@ - #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 -+#undef F_GETLK64 -+#undef F_SETLK64 -+#undef F_SETLKW64 -+#undef flock64 -+#undef open64 -+#undef openat64 -+#undef creat64 -+#undef lockf64 -+#undef posix_fadvise64 -+#undef posix_fallocate64 -+#undef off64_t -+ - namespace llvm { - /// VecDesc - Describes a possible vectorization of a function. - /// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized --- -2.7.3 - diff --git a/community/llvm3.7/llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch b/community/llvm3.7/llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch deleted file mode 100644 index d5d7f07b5e..0000000000 --- a/community/llvm3.7/llvm-0003-Fix-DynamicLibrary-to-build-with-musl-libc.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d12ecb83d01dcb580dd94f4d57828f33d3eb4c35 Mon Sep 17 00:00:00 2001 -From: Natanael Copa <ncopa@alpinelinux.org> -Date: Thu, 18 Feb 2016 15:33:21 +0100 -Subject: [PATCH 3/3] Fix DynamicLibrary to build with musl libc - -stdin/out/err is part of the libc and not the kernel so we check for the -specific libc that does the unexpected instead of linux. - -This is needed for making it build with musl libc. ---- - lib/Support/DynamicLibrary.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp -index 9a7aeb5..0c1c8f8 100644 ---- a/lib/Support/DynamicLibrary.cpp -+++ b/lib/Support/DynamicLibrary.cpp -@@ -140,10 +140,10 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) { - #define EXPLICIT_SYMBOL(SYM) \ - if (!strcmp(symbolName, #SYM)) return &SYM - --// On linux we have a weird situation. The stderr/out/in symbols are both -+// On GNU libc we have a weird situation. The stderr/out/in symbols are both - // macros and global variables because of standards requirements. So, we - // boldly use the EXPLICIT_SYMBOL macro without checking for a #define first. --#if defined(__linux__) and !defined(__ANDROID__) -+#if defined(__GLIBC__) - { - EXPLICIT_SYMBOL(stderr); - EXPLICIT_SYMBOL(stdout); --- -2.7.3 - diff --git a/community/llvm3.7/llvm-ValueMap-fix.patch b/community/llvm3.7/llvm-ValueMap-fix.patch deleted file mode 100644 index a8f6631c26..0000000000 --- a/community/llvm3.7/llvm-ValueMap-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/include/llvm/IR/ValueMap.h -+++ b/include/llvm/IR/ValueMap.h -@@ -99,7 +99,7 @@ - explicit ValueMap(const ExtraData &Data, unsigned NumInitBuckets = 64) - : Map(NumInitBuckets), Data(Data) {} - -- bool hasMD() const { return MDMap; } -+ bool hasMD() const { return bool(MDMap); } - MDMapT &MD() { - if (!MDMap) - MDMap.reset(new MDMapT); diff --git a/community/llvm3.7/llvm-d18644-systemz-atomic-fence.patch b/community/llvm3.7/llvm-d18644-systemz-atomic-fence.patch deleted file mode 100644 index 32d4396a57..0000000000 --- a/community/llvm3.7/llvm-d18644-systemz-atomic-fence.patch +++ /dev/null @@ -1,163 +0,0 @@ -Source: http://pkgs.fedoraproject.org/cgit/rpms/llvm.git/tree/llvm-d18644-systemz-atomic-fence.patch?h=f24 -=================================================================== ---- a/lib/Target/SystemZ/SystemZAsmPrinter.cpp -+++ a/lib/Target/SystemZ/SystemZAsmPrinter.cpp -@@ -260,6 +260,11 @@ - .addImm(15).addReg(SystemZ::R0D); - break; - -+ // Emit nothing here but a comment if we can. -+ case SystemZ::MemBarrier: -+ OutStreamer->emitRawComment("MEMBARRIER"); -+ return; -+ - default: - Lower.lower(MI, LoweredMI); - break; -=================================================================== ---- a/lib/Target/SystemZ/SystemZISelLowering.h -+++ a/lib/Target/SystemZ/SystemZISelLowering.h -@@ -146,6 +146,9 @@ - // Perform a serialization operation. (BCR 15,0 or BCR 14,0.) - SERIALIZE, - -+ // Compiler barrier only; generate a no-op. -+ MEMBARRIER, -+ - // Transaction begin. The first operand is the chain, the second - // the TDB pointer, and the third the immediate control field. - // Returns chain and glue. -@@ -479,6 +482,7 @@ - SDValue lowerBITCAST(SDValue Op, SelectionDAG &DAG) const; - SDValue lowerOR(SDValue Op, SelectionDAG &DAG) const; - SDValue lowerCTPOP(SDValue Op, SelectionDAG &DAG) const; -+ SDValue lowerATOMIC_FENCE(SDValue Op, SelectionDAG &DAG) const; - SDValue lowerATOMIC_LOAD(SDValue Op, SelectionDAG &DAG) const; - SDValue lowerATOMIC_STORE(SDValue Op, SelectionDAG &DAG) const; - SDValue lowerATOMIC_LOAD_OP(SDValue Op, SelectionDAG &DAG, -=================================================================== ---- a/lib/Target/SystemZ/SystemZISelLowering.cpp -+++ a/lib/Target/SystemZ/SystemZISelLowering.cpp -@@ -216,6 +216,8 @@ - setOperationAction(ISD::ATOMIC_LOAD_UMAX, MVT::i32, Custom); - setOperationAction(ISD::ATOMIC_CMP_SWAP, MVT::i32, Custom); - -+ setOperationAction(ISD::ATOMIC_FENCE, MVT::Other, Custom); -+ - // z10 has instructions for signed but not unsigned FP conversion. - // Handle unsigned 32-bit types as signed 64-bit types. - if (!Subtarget.hasFPExtension()) { -@@ -3118,6 +3120,25 @@ - return Op; - } - -+SDValue SystemZTargetLowering::lowerATOMIC_FENCE(SDValue Op, -+ SelectionDAG &DAG) const { -+ SDLoc DL(Op); -+ AtomicOrdering FenceOrdering = static_cast<AtomicOrdering>( -+ cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue()); -+ SynchronizationScope FenceScope = static_cast<SynchronizationScope>( -+ cast<ConstantSDNode>(Op.getOperand(2))->getZExtValue()); -+ -+ // The only fence that needs an instruction is a sequentially-consistent -+ // cross-thread fence. -+ if (FenceOrdering == SequentiallyConsistent && FenceScope == CrossThread) { -+ return SDValue(DAG.getMachineNode(SystemZ::Serialize, DL, MVT::Other, -+ Op.getOperand(0)), 0); -+ } -+ -+ // MEMBARRIER is a compiler barrier; it codegens to a no-op. -+ return DAG.getNode(SystemZISD::MEMBARRIER, DL, MVT::Other, Op.getOperand(0)); -+} -+ - // Op is an atomic load. Lower it into a normal volatile load. - SDValue SystemZTargetLowering::lowerATOMIC_LOAD(SDValue Op, - SelectionDAG &DAG) const { -@@ -4444,6 +4465,8 @@ - case ISD::CTTZ_ZERO_UNDEF: - return DAG.getNode(ISD::CTTZ, SDLoc(Op), - Op.getValueType(), Op.getOperand(0)); -+ case ISD::ATOMIC_FENCE: -+ return lowerATOMIC_FENCE(Op, DAG); - case ISD::ATOMIC_SWAP: - return lowerATOMIC_LOAD_OP(Op, DAG, SystemZISD::ATOMIC_SWAPW); - case ISD::ATOMIC_STORE: -@@ -4547,6 +4570,7 @@ - OPCODE(SEARCH_STRING); - OPCODE(IPM); - OPCODE(SERIALIZE); -+ OPCODE(MEMBARRIER); - OPCODE(TBEGIN); - OPCODE(TBEGIN_NOFLOAT); - OPCODE(TEND); -@@ -5307,6 +5331,7 @@ - MachineBasicBlock * - SystemZTargetLowering::emitAtomicCmpSwapW(MachineInstr *MI, - MachineBasicBlock *MBB) const { -+ - MachineFunction &MF = *MBB->getParent(); - const SystemZInstrInfo *TII = - static_cast<const SystemZInstrInfo *>(Subtarget.getInstrInfo()); -=================================================================== ---- a/lib/Target/SystemZ/SystemZInstrInfo.td -+++ a/lib/Target/SystemZ/SystemZInstrInfo.td -@@ -1231,6 +1231,10 @@ - let hasSideEffects = 1 in - def Serialize : Alias<2, (outs), (ins), [(z_serialize)]>; - -+// A pseudo instruction that serves as a compiler barrier. -+let hasSideEffects = 1 in -+def MemBarrier : Pseudo<(outs), (ins), [(z_membarrier)]>; -+ - let Predicates = [FeatureInterlockedAccess1], Defs = [CC] in { - def LAA : LoadAndOpRSY<"laa", 0xEBF8, atomic_load_add_32, GR32>; - def LAAG : LoadAndOpRSY<"laag", 0xEBE8, atomic_load_add_64, GR64>; -=================================================================== ---- a/lib/Target/SystemZ/SystemZOperators.td -+++ a/lib/Target/SystemZ/SystemZOperators.td -@@ -188,6 +188,8 @@ - - def z_serialize : SDNode<"SystemZISD::SERIALIZE", SDTNone, - [SDNPHasChain, SDNPMayStore]>; -+def z_membarrier : SDNode<"SystemZISD::MEMBARRIER", SDTNone, -+ [SDNPHasChain, SDNPSideEffect]>; - - // Defined because the index is an i32 rather than a pointer. - def z_vector_insert : SDNode<"ISD::INSERT_VECTOR_ELT", -=================================================================== ---- a/test/CodeGen/SystemZ/atomic-fence-01.ll -+++ a/test/CodeGen/SystemZ/atomic-fence-01.ll -@@ -0,0 +1,16 @@ -+; Test (fast) serialization. -+; -+; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s --check-prefix=Z10 -+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s --check-prefix=Z196 -+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=zEC12 | FileCheck %s --check-prefix=ZEC12 -+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s --check-prefix=Z13 -+ -+define void @test() { -+; Z10: bcr 15, %r0 -+; Z196: bcr 14, %r0 -+; ZEC12: bcr 14, %r0 -+; Z13: bcr 14, %r0 -+ fence seq_cst -+ ret void -+} -+ -=================================================================== ---- a/test/CodeGen/SystemZ/atomic-fence-02.ll -+++ a/test/CodeGen/SystemZ/atomic-fence-02.ll -@@ -0,0 +1,13 @@ -+; Serialization is emitted only for fence seq_cst. -+; -+; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s -+ -+define void @test() { -+; CHECK: #MEMBARRIER -+ fence acquire -+; CHECK: #MEMBARRIER -+ fence release -+; CHECK: #MEMBARRIER -+ fence acq_rel -+ ret void -+} diff --git a/community/llvm3.7/llvm-nm-workaround.patch b/community/llvm3.7/llvm-nm-workaround.patch deleted file mode 100644 index 5755e57ff3..0000000000 --- a/community/llvm3.7/llvm-nm-workaround.patch +++ /dev/null @@ -1,27 +0,0 @@ -From https://llvm.org/bugs/show_bug.cgi?id=24115 - -diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp -index e7ee312..b9e4779 100644 ---- a/tools/llvm-nm/llvm-nm.cpp -+++ b/tools/llvm-nm/llvm-nm.cpp -@@ -486,7 +486,7 @@ static void sortAndPrintSymbolList(SymbolicFile &Obj, bool printName, - std::string ArchiveName, - std::string ArchitectureName) { - if (!NoSort) { -- std::function<bool(const NMSymbol &, const NMSymbol &)> Cmp; -+ bool (*Cmp)(const NMSymbol &, const NMSymbol &); - if (NumericSort) - Cmp = compareSymbolAddress; - else if (SizeSort) -@@ -495,8 +495,9 @@ static void sortAndPrintSymbolList(SymbolicFile &Obj, bool printName, - Cmp = compareSymbolName; - - if (ReverseSort) -- Cmp = [=](const NMSymbol &A, const NMSymbol &B) { return Cmp(B, A); }; -- std::sort(SymbolList.begin(), SymbolList.end(), Cmp); -+ std::sort(SymbolList.begin(), SymbolList.end(), [=](const NMSymbol &A, const NMSymbol &B) { return Cmp(B, A); }); -+ else -+ std::sort(SymbolList.begin(), SymbolList.end(), Cmp); - } - - if (!PrintFileName) { |