DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 6327eed2d1feb108440f22d2581d1ff86c10a10c29793538d8d899c7e2dc83d3f7b147d3fd4bcce2bd2bf57c071b08c624aeafe40a3e7a3914506e7751727e6c SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d
DIST llvm-5.0.0.src.tar.xz 23411980 BLAKE2B bc3d8b75b766c83912252b51d6b57c8151c9d83415eff7bc771923d35138ed253a788d6c8e0a384c5e78ce1a1065f10d66ef5004df163b4c3b0c6274bb3aa6b7 SHA512 e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a
DIST llvm-5.0.1-manpages.tar.bz2 94004 BLAKE2B 34eb29361ad7aa881e64d1dd2992fd89ce44adafd2521284c27b6ffe7082bc7e70458204e6f34d582b704bf7c5dad93c6a6dc41fc7abc41862aab8f5ec53ed07 SHA512 3444cc8e06009f5dd2669b92af662a1049d9294c8ca0dcf45486e1dc1aaf10160860b7856d30ad70bbe5864b21d1539316e89f5237549f5653954e23baf64334
+DIST llvm-5.0.1-patchset.tar.bz2 4204 BLAKE2B e7282e84578631d88549bdf34e5a44e0294e47ef1fee29c0cb954d7afd160d4b6a0f39bb3bd53791ea53503a60eaa0ada0a512a63d696ff096dc6f21f4aecdc7 SHA512 395ea2b13008e222c034e2bdd8c2bb033b9c01e61fb89c840f009f6cddb499b317df8b061d29f40968d8f0df5540a2f4a9de31eef1de886796c8c334f37254eb
DIST llvm-5.0.1.src.tar.xz 23428720 BLAKE2B 3db4d33df21018d17eef0042c0d8d82a8412bd5daa99cfb5405a6ec83c5774178fa76b220e8731c2a9a64dabf898aa90fe29c685327bd63a4f078e8e94a9a77e SHA512 bee1d45fca15ce725b1f2b1339b13eb6f750a3a321cfd099075477ec25835a8ca55b5366172c4aad46592dfd8afe372349ecf264f581463d017f9cee2d63c1cb
DIST llvm-manpages-4.0.1.tar.bz2 87981 BLAKE2B 79ffd254ee5c6e09159c954913ef820f74107d4fcea5e3ed82592dc36af8fdfbf1e850547ba8bfc20aa9a5ecdd26c50329e6a6d558ae3aa5475a930789ce3e01 SHA512 d5b3213567c25db58ef364d272314a79c311a80fc21d98c09a5540af45a8190a38f489228663fe9a9b63bf0f2b952c460c4196a8fc8d6f221619f6e7ed2fc415
DIST llvm-manpages-5.0.0.tar.bz2 94240 BLAKE2B 1657edefa2e839f401b7c30ba1c0cfde45bcb0fa9bcfc3ea6070bc0addc237be898c5a79e54b2120f98b2a9550ab286cfd0bc835751a4e8cc30005d4081fb9f9 SHA512 0bccfb00caa0796bed8ea4e591616e025e43d304f05589180820c17f8567fa3a1f1f76c323098ed0d0e4590765415b1c1c272a94c6e2e7544788f4088ef0ffea
+++ /dev/null
-From 937b23b5fffa59deb1dc342cc5602d387d84a762 Mon Sep 17 00:00:00 2001
-From: Michal Gorny <mgorny@gentoo.org>
-Date: Mon, 27 Nov 2017 22:23:09 +0000
-Subject: [PATCH] [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading
-
-Prevent unloading shared libraries on Linux when dlclose() is called.
-This is necessary since command-line option parsing API relies on
-registering the global option instances in the option parser instance
-which can be loaded in a different shared library.
-
-Given that we can't reliably remove those options when a library is
-unloaded, the parser ends up containing dangling references. Since glibc
-has relatively complex library unloading rules, some of the LLVM
-libraries can be unloaded while others (including the Support library)
-stay loaded causing quite a mayhem. To reliably prevent that, just
-forbid unloading all libraries -- it's a very bad idea anyway.
-
-While the issue arguably happens only with BUILD_SHARED_LIBS, it may
-affect any library reusing llvm::cl interface.
-
-Based on patch provided Ross Hayward on https://bugs.gentoo.org/617154.
-Previously hit by Fedora back in Feb 2016:
-https://lists.freedesktop.org/archives/mesa-dev/2016-February/107242.html
-
-Differential Revision: https://reviews.llvm.org/D40459
-
-git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319105 91177308-0d34-0410-b5e6-96231b3b80d8
----
- cmake/modules/HandleLLVMOptions.cmake | 8 ++++++++
- unittests/Support/DynamicLibrary/CMakeLists.txt | 7 +++++++
- 2 files changed, 15 insertions(+)
-
-diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
-index c5390371845..b5059a8a60e 100644
---- a/cmake/modules/HandleLLVMOptions.cmake
-+++ b/cmake/modules/HandleLLVMOptions.cmake
-@@ -151,6 +151,14 @@ if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR CYGWIN OR
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
- endif()
-
-+# Pass -Wl,-z,nodelete. This makes sure our shared libraries are not unloaded
-+# by dlclose(). We need that since the CLI API relies on cross-references
-+# between global objects which became horribly broken when one of the libraries
-+# is unloaded.
-+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,nodelete")
-+endif()
-+
-
- function(append value)
- foreach(variable ${ARGN})
-diff --git a/unittests/Support/DynamicLibrary/CMakeLists.txt b/unittests/Support/DynamicLibrary/CMakeLists.txt
-index 9355979221a..c6201b1ad31 100644
---- a/unittests/Support/DynamicLibrary/CMakeLists.txt
-+++ b/unittests/Support/DynamicLibrary/CMakeLists.txt
-@@ -24,5 +24,12 @@ function(dynlib_add_module NAME)
- add_dependencies(DynamicLibraryTests ${NAME})
- endfunction(dynlib_add_module)
-
-+# Revert -Wl,-z,nodelete on this test since it relies on the file
-+# being unloaded.
-+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-+ string(REPLACE "-Wl,-z,nodelete" "" CMAKE_SHARED_LINKER_FLAGS
-+ ${CMAKE_SHARED_LINKER_FLAGS})
-+endif()
-+
- dynlib_add_module(PipSqueak)
- dynlib_add_module(SecondLib)
---
-2.15.1
-
DESCRIPTION="Low Level Virtual Machine"
HOMEPAGE="https://llvm.org/"
SRC_URI="https://releases.llvm.org/${PV/_//}/${P/_/}.src.tar.xz
+ https://dev.gentoo.org/~mgorny/dist/llvm/${P}-patchset.tar.bz2
!doc? ( https://dev.gentoo.org/~mgorny/dist/llvm/${P}-manpages.tar.bz2 )"
# Keep in sync with CMakeLists.txt
# https://bugs.gentoo.org/show_bug.cgi?id=565358
eapply "${FILESDIR}"/9999/0007-llvm-config-Clean-up-exported-values-update-for-shar.patch
- # Backport the fix for dlclose() causing option parser mess
- # e.g. https://bugs.gentoo.org/617154
- eapply "${FILESDIR}"/5.0.1/0001-cmake-Pass-Wl-z-nodelete-on-Linux-to-prevent-unloadi.patch
+ # Apply the backported patches
+ eapply "${WORKDIR}/${P}-patchset"
+ # Copy the new binary file (we don't support git binary patches)
+ cp {"${WORKDIR}/${P}-patchset",.}/test/tools/llvm-symbolizer/Inputs/print_context.o || die
# disable use of SDK on OSX, bug #568758
sed -i -e 's/xcrun/false/' utils/lit/lit/util.py || die