summaryrefslogtreecommitdiff
path: root/sys-libs/llvm-libunwind
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs/llvm-libunwind')
-rw-r--r--sys-libs/llvm-libunwind/Manifest16
-rw-r--r--sys-libs/llvm-libunwind/files/libunwind-3.8-cmake.patch82
-rw-r--r--sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch43
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-3.8.1.ebuild41
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-3.9.0-r1.ebuild49
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-3.9.1.ebuild49
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-4.0.1.ebuild46
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-5.0.0.ebuild46
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-5.0.9999.ebuild47
-rw-r--r--sys-libs/llvm-libunwind/llvm-libunwind-9999.ebuild46
-rw-r--r--sys-libs/llvm-libunwind/metadata.xml10
11 files changed, 475 insertions, 0 deletions
diff --git a/sys-libs/llvm-libunwind/Manifest b/sys-libs/llvm-libunwind/Manifest
new file mode 100644
index 000000000000..a6fbac794598
--- /dev/null
+++ b/sys-libs/llvm-libunwind/Manifest
@@ -0,0 +1,16 @@
+AUX libunwind-3.8-cmake.patch 3454 SHA256 3946db9aea188c3ad8f80fcec25ea2c696e17b17fc4510ace553e87d41b1aa7f SHA512 5d0a72e91a99e60f22239d56bf0998b0ae1df448ebf461c00bf6fe9eed0fa0579041bd98a9b50dfbe2d6a4490bbb8ede5c9b2fe76743f9f5b84770b4563377f1 WHIRLPOOL b6089ef2eb3a4f47e529f9efb585677cc8fbd0c1d64f84c4c4d3bddc393055742eefc9256baaad16febc2d6acec52e9fb38088f69dd1a226288b45fa214511d4
+AUX libunwind-3.9-cmake-static-lib.patch 1855 SHA256 1b6d6abbb687eb691a1907288c309cc89e55432d60d70b712021b723bcd90a33 SHA512 1d0c5859394d027fd0b30ae30caa0aaee94e3880a16d1f46f318221f3062e126c25c6f20cdf087dc9b37d92517df499b0f79294a6e17c8ac5da694c0d825e9bc WHIRLPOOL 54d3264a06d8e293bce73bc6be4e9c8922ed8894840e3df382e3737de19c6a24b73b166c32a53efd96101e64fb43dd64fe000b08f4d9fe6fb719291784772fc5
+DIST libunwind-3.8.1.src.tar.xz 60596 SHA256 21e58ce09a5982255ecf86b86359179ddb0be4f8f284a95be14201df90e48453 SHA512 2a60d7c4b0aee6c58f50089ac9fa2b756ab1d74faaee32f7436ddace4510589c7ffdd20478919966ed2fa8a23ee1b5d1b26115dbd8ee2834b00b5bcd61d00b14 WHIRLPOOL f2756de12d39de2df9bf06be3024327b3ca37f2537aae17efda6e94fb9807c31cab1a2eb070aca8e7e44467ab51c69fecbeef063e07472ec59657309a16bdd1c
+DIST libunwind-3.9.0.src.tar.xz 61764 SHA256 66675ddec5ba0d36689757da6008cb2596ee1a9067f4f598d89ce5a3b43f4c2b SHA512 dce384bea99ed61b363b847e20946fc9d70377389a227cc7054fbaa916e7cb5ba0b9d89f0df6ed33409dbf38beefd3654c18c1abcf0e50b5d0315ce0135a1d25 WHIRLPOOL 3fddaf6a06390143beee04d0e73ac0b66fb27c5497b80309ca314a52fd67d49ae3806b2b7588f07185c49339a75b7549bbf303f50224916f1ed65f6ad82415d0
+DIST libunwind-3.9.1.src.tar.xz 61788 SHA256 0b0bc73264d7ab77d384f8a7498729e3c4da8ffee00e1c85ad02a2f85e91f0e6 SHA512 a80f5d0660e209f5bf709316b5df2ca63b9f0db49f5f74dfe9c9e580c654f61a15acc071a739fdb84baf5ffa9420b92498f8560331173642d80f6b74e1e2afb7 WHIRLPOOL d79928771468e344bd4c73ec458f4994fbfa04b4f625e559f3ef20c75d504d06f8edc1051d1444d8b4260f253716333ecd4bc7a18e8aca822dd77245a5a99ac2
+DIST libunwind-4.0.1.src.tar.xz 63388 SHA256 3b072e33b764b4f9b5172698e080886d1f4d606531ab227772a7fc08d6a92555 SHA512 8a0552a8ab830010d81420f4b778a3b831bff85b19bcce972958fc30e1ba5a2fa26a3deba499985a43dd7a103690775f6a20e7b3edda55f4eaff3541002d6b59 WHIRLPOOL 2544b14afb6a2d545ed68c267389e7438c3dd4d244dd1cce8583f2aba2e90017a027c27c87a9a7336ea3c5ada3388414d4e357ad1c1db0d23ee52b178f45b563
+DIST libunwind-5.0.0.src.tar.xz 72236 SHA256 9a70e2333d54f97760623d89512c4831d6af29e78b77a33d824413ce98587f6f SHA512 20d54d5342d67425f5e36e9c690f1bb67bc2a3b7184b3ad546b689e510728d7c596f178d4f5186daf7480409ed4e455848b4ad1d9d896370fac1db69885fc793 WHIRLPOOL 0ecdf40e6cde7012f6949015b5030a4206b2c0d293159864466b58a9f34b193245daf90c95417b66e3c15191b1418a94b65893efbe216d144a4de4ffb6107925
+EBUILD llvm-libunwind-3.8.1.ebuild 887 SHA256 51b32550f00919810d206c0c3da9958422b4217aa7587e33a23bab0de2c25633 SHA512 bbb072b142bf07850f2ff7ae59d4f46693bd7b43b326860c76c232d206fc129541eb658e6f31d5103115b572ecc5af408617be4ab3af04ed520000360df38bad WHIRLPOOL 84a77b2b7766a888982b1a164ae9f55071ce0c6990cc607157286ff4726997014089174daae676b4c5876f4368c0f79d6ef4a247db83ba061b376845dabadf74
+EBUILD llvm-libunwind-3.9.0-r1.ebuild 1182 SHA256 06ce2ebb20c2668dafb9b4619857ee6c0af34ee7c53430a045c7321de0558c00 SHA512 409250525e1697964c71d8abf80d64da6da8361324db073fb4ab6facc5dd4a93d65a98aec0a52ff895ed865d7d102c8ba2c9c4fa51cc6cffd9bd73f1477d6992 WHIRLPOOL 889bf6ab4c284cc80f221dfbe130704675532314d0a81e3f12b70c386098f05d08b856e1d6d73eb13f3a98d22ff545e2e3aaaafea3ec6b2aa762486c52ccbc35
+EBUILD llvm-libunwind-3.9.1.ebuild 1187 SHA256 a4c3fdca9c6b62e95aeb4a18d423895d1f942de1e3ecdc390c8f096b1d59f025 SHA512 bdd65eb012df3af046c71406af02927255f3502aaf92e53fa9dbf2adfa0150b68e4325cfef2f07d1893738ba6ba3f009a89e37861ffe7999752ea77fc3963a0b WHIRLPOOL 8f98d6c556943c07c0822e2bfec7b7848ca7d75b052479b4af110fd68cba63650cf1237a37a7eb21803d677402c50a3daba0b5db091f5cf66fdf73f24d9dd645
+EBUILD llvm-libunwind-4.0.1.ebuild 1096 SHA256 aa03301ac66383ca475bcf8431e6049bc33b264930368a78da742977ad591204 SHA512 8ff88efcf19f55a6880f4fba24126645b6429eb667ea8cdd90aaa800ec856f1f83c2ce2ebfc4a8074ee25af2f68ddc67216e1a1423cbc2f744accf0a075bbcb6 WHIRLPOOL ef1e94cb5328f40df84cb13a8b906e7ad99fd26653e9bcf97088ea828128442fda089af96e07713b067b6fd1f1184657184531db500ae978d1a4261eb90ea2ad
+EBUILD llvm-libunwind-5.0.0.ebuild 1096 SHA256 aa03301ac66383ca475bcf8431e6049bc33b264930368a78da742977ad591204 SHA512 8ff88efcf19f55a6880f4fba24126645b6429eb667ea8cdd90aaa800ec856f1f83c2ce2ebfc4a8074ee25af2f68ddc67216e1a1423cbc2f744accf0a075bbcb6 WHIRLPOOL ef1e94cb5328f40df84cb13a8b906e7ad99fd26653e9bcf97088ea828128442fda089af96e07713b067b6fd1f1184657184531db500ae978d1a4261eb90ea2ad
+EBUILD llvm-libunwind-5.0.9999.ebuild 1109 SHA256 68f4e7ecf519f1599ed4979ee35f826a24cc8b6b3f4f6dbee76682cf75dd6250 SHA512 926839a7f702a1827cebdb45289560409056f63c77d1a4a57a2b00b8b9b813353b06b8742628d6a23d7dd4c94864af6fb059b9b6d045fa31819af4a7513046c5 WHIRLPOOL f76ebdfc606c8d7951b40dfbc9cbe188ecc283372a604f6747dccb412c776f6e705cd202df3c144a90cdd216bff0f8db9e673d68489e3c90433bdad7752bfbea
+EBUILD llvm-libunwind-9999.ebuild 1084 SHA256 e71d3206f29333d7d34d23007301eb8016f1390b9362c06c0abfbd62b704eeb3 SHA512 9393e7fafe3a5b0416c0206a1d25ba9f0601dfc329293c9d4b02d61859aaf7f5b1c1be1fc7e82429f278385f70890f1ab49b8db0785c33ac0d2e193877741cd7 WHIRLPOOL 11826d09f3e7b06b92598137134c43e977a0911851d12b6d5e7512244b684c0aac4f16e196bbdfe02b53c2c924e73f9634b4e7427fa03da6fd870bc840d256b0
+MISC ChangeLog 1632 SHA256 b53287c438bcd44ae5f83379f90b140589fa914bad4f3f9ca9ffcf30440ed23d SHA512 0bd16c4e745548f2e80fccd162123a45dbf9cbf0ba414344ae4f5b690062f122b1813c23ce7a90efc2544b2a4f5ec2a3bfc15fac265391fc4046334781242245 WHIRLPOOL a7259e499c13e8e8d1abb1bb5e122df4f53db7ad6a6ada2f1387cd39bf5af1b94fa107373172f105132960f2594d20a599b4c353f704f72eeb3842e161f334ff
+MISC metadata.xml 302 SHA256 5227e633c064b7502b07a2e2be7113a335bec46d874c9f66e0aa01ce5baf6dae SHA512 3afaef82e6a495a81e221524ae7604dc170ef5c103333728674faf0417c45ba7996118c10466eaa24f8feef9ed8f0fc60d535a5195462317d61c61a531c8a285 WHIRLPOOL 14e6f06ebcebb26488bfb2f9c636fed244acec33548c39dce5450546b535a9eede8e4a7a235e60a76c58c9ed6de9b23d87e68c73165e84c22644fcbe16da6c8c
diff --git a/sys-libs/llvm-libunwind/files/libunwind-3.8-cmake.patch b/sys-libs/llvm-libunwind/files/libunwind-3.8-cmake.patch
new file mode 100644
index 000000000000..5f995be5051a
--- /dev/null
+++ b/sys-libs/llvm-libunwind/files/libunwind-3.8-cmake.patch
@@ -0,0 +1,82 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d9b2367..b6bb5fd 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -43,7 +43,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+ set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
+ set(LLVM_LIT_PATH "${LLVM_PATH}/utils/lit/lit.py")
+- else ()
++ elseif (NOT LIBUNWIND_BUILT_STANDALONE)
+ message(FATAL_ERROR "llvm-config not found and LLVM_MAIN_SRC_DIR not defined. "
+ "Reconfigure with -DLLVM_CONFIG=path/to/llvm-config "
+ "or -DLLVM_PATH=path/to/llvm-source-root.")
+@@ -53,7 +53,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+ include("${LLVM_CMAKE_PATH}/AddLLVM.cmake")
+ include("${LLVM_CMAKE_PATH}/HandleLLVMOptions.cmake")
+- else ()
++ elseif (NOT LIBUNWIND_BUILT_STANDALONE)
+ message(FATAL_ERROR "Not found: ${LLVM_CMAKE_PATH}")
+ endif ()
+
+@@ -103,6 +103,7 @@ option(LIBUNWIND_ENABLE_ASSERTIONS "Enable assertions independent of build mode.
+ option(LIBUNWIND_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
+ option(LIBUNWIND_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
+ option(LIBUNWIND_ENABLE_SHARED "Build libunwind as a shared library." ON)
++option(LIBUNWIND_ENABLE_STATIC "Build libunwind as a static library." OFF)
+
+ set(LIBUNWIND_GCC_TOOLCHAIN "" CACHE STRING "GCC toolchain for cross compiling.")
+ set(LIBUNWIND_SYSROOT "" CACHE STRING "Sysroot for cross compiling.")
+@@ -136,9 +137,9 @@ macro(append_if list condition var)
+ endmacro()
+
+ set(LIBUNWIND_C_FLAGS "")
+-set(LIBUNWIND_CXX_FLAGS "")
++set(LIBUNWIND_CXX_FLAGS "-std=c++11")
+ set(LIBUNWIND_COMPILE_FLAGS "")
+-set(LIBUNWIND_LINK_FLAGS "")
++set(LIBUNWIND_LINK_FLAGS "-Wl,-z,noexecstack")
+
+ append_if(LIBUNWIND_COMPILE_FLAGS LIBUNWIND_HAS_WERROR_FLAG -Werror=return-type)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index ee01e9a..c66673e 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -18,7 +18,8 @@ set(LIBUNWIND_ASM_SOURCES
+ UnwindRegistersSave.S)
+ set_source_files_properties(${LIBUNWIND_ASM_SOURCES}
+ PROPERTIES
+- LANGUAGE C)
++ LANGUAGE C
++ COMPILE_FLAGS "-Wa,--noexecstack")
+
+ set(LIBUNWIND_HEADERS
+ AddressSpace.hpp
+@@ -51,8 +52,10 @@ set(LIBUNWIND_SOURCES
+
+ if (LIBUNWIND_ENABLE_SHARED)
+ add_library(unwind SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+-else()
+- add_library(unwind STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++endif ()
++if (LIBUNWIND_ENABLE_STATIC)
++ add_library(unwind_static STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++ set_target_properties(unwind_static PROPERTIES OUTPUT_NAME unwind)
+ endif ()
+
+ # Generate library list.
+@@ -106,7 +109,10 @@ set_target_properties(unwind
+ set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
+ APPEND_STRING PROPERTY COMPILE_FLAGS "${LIBUNWIND_CXX_FLAGS}")
+
+-install(TARGETS unwind
+- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++if (LIBUNWIND_ENABLE_SHARED)
++ install(TARGETS unwind LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
++if (LIBUNWIND_ENABLE_STATIC)
++ install(TARGETS unwind_static ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
diff --git a/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch b/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch
new file mode 100644
index 000000000000..82beb4481410
--- /dev/null
+++ b/sys-libs/llvm-libunwind/files/libunwind-3.9-cmake-static-lib.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 806b825..4b330f9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -104,6 +104,7 @@ option(LIBUNWIND_ENABLE_ASSERTIONS "Enable assertions independent of build mode.
+ option(LIBUNWIND_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
+ option(LIBUNWIND_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
+ option(LIBUNWIND_ENABLE_SHARED "Build libunwind as a shared library." ON)
++option(LIBUNWIND_ENABLE_STATIC "Build libunwind as a static library." OFF)
+ option(LIBUNWIND_ENABLE_CROSS_UNWINDING "Enable cross-platform unwinding support." OFF)
+ option(LIBUNWIND_ENABLE_ARM_WMMX "Enable unwinding support for ARM WMMX registers." OFF)
+
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index b7c2d63..7c453de 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -51,8 +51,10 @@ set(LIBUNWIND_SOURCES
+
+ if (LIBUNWIND_ENABLE_SHARED)
+ add_library(unwind SHARED ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
+-else()
+- add_library(unwind STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++endif()
++if (LIBUNWIND_ENABLE_STATIC)
++ add_library(unwind_static STATIC ${LIBUNWIND_SOURCES} ${LIBUNWIND_HEADERS})
++ set_target_properties(unwind_static PROPERTIES OUTPUT_NAME unwind)
+ endif ()
+
+ # Generate library list.
+@@ -109,7 +111,9 @@ set_property(SOURCE ${LIBUNWIND_CXX_SOURCES}
+ set_property(SOURCE ${LIBUNWIND_C_SOURCES}
+ APPEND_STRING PROPERTY COMPILE_FLAGS " ${CMAKE_C_FLAGS} ${LIBUNWIND_C_FLAGS}")
+
+-install(TARGETS unwind
+- LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+-
++if (LIBUNWIND_ENABLE_SHARED)
++ install(TARGETS unwind LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
++if (LIBUNWIND_ENABLE_STATIC)
++ install(TARGETS unwind_static ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
++endif ()
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-3.8.1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-3.8.1.ebuild
new file mode 100644
index 000000000000..617dedb11566
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-3.8.1.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils
+
+MY_P="libunwind-${PV}"
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+static-libs"
+
+DEPEND=""
+RDEPEND="!sys-libs/libunwind"
+
+S="${WORKDIR}/${MY_P}.src"
+
+src_prepare() {
+ default
+ eapply "${FILESDIR}/libunwind-3.8-cmake.patch"
+}
+
+src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ # work-around attempting to use llvm-config to get llvm sources
+ # (that are not needed at all)
+ -DLLVM_CONFIG=OFF
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_BUILT_STANDALONE=ON
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0-r1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0-r1.ebuild
new file mode 100644
index 000000000000..f40325bc0c02
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.0-r1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+inherit cmake-multilib
+
+MY_P="libunwind-${PV}"
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# llvm-config and cmake files needed to get proper flags
+# (3.9.0 needed because cmake file install path changed)
+DEPEND=">=sys-devel/llvm-3.9.0[${MULTILIB_USEDEP}]"
+
+S="${WORKDIR}/${MY_P}.src"
+
+src_prepare() {
+ # add switch for static-libs; accepted upstream
+ eapply "${FILESDIR}/libunwind-3.9-cmake-static-lib.patch"
+ default
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-3.9.1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.1.ebuild
new file mode 100644
index 000000000000..6a132e567b55
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-3.9.1.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+inherit cmake-multilib
+
+MY_P="libunwind-${PV}"
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://llvm.org/releases/${PV}/${MY_P}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="amd64 ~arm64 x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# llvm-config and cmake files needed to get proper flags
+# (3.9.0 needed because cmake file install path changed)
+DEPEND=">=sys-devel/llvm-3.9.0[${MULTILIB_USEDEP}]"
+
+S="${WORKDIR}/${MY_P}.src"
+
+src_prepare() {
+ # add switch for static-libs; accepted upstream
+ eapply "${FILESDIR}/libunwind-3.9-cmake-static-lib.patch"
+ default
+}
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-4.0.1.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-4.0.1.ebuild
new file mode 100644
index 000000000000..a85458427d14
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-4.0.1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+inherit cmake-multilib llvm
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://releases.llvm.org/${PV/_//}/libunwind-${PV/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND=">=sys-devel/llvm-4"
+
+S=${WORKDIR}/libunwind-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-5.0.0.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-5.0.0.ebuild
new file mode 100644
index 000000000000..a85458427d14
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-5.0.0.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+inherit cmake-multilib llvm
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI="https://releases.llvm.org/${PV/_//}/libunwind-${PV/_/}.src.tar.xz"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND=">=sys-devel/llvm-4"
+
+S=${WORKDIR}/libunwind-${PV/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-5.0.9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-5.0.9999.ebuild
new file mode 100644
index 000000000000..fc8c13fc44bf
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-5.0.9999.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+inherit cmake-multilib git-r3 llvm
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/libunwind.git
+ https://github.com/llvm-mirror/libunwind.git"
+EGIT_BRANCH="release_50"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND=">=sys-devel/llvm-4"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/llvm-libunwind-9999.ebuild b/sys-libs/llvm-libunwind/llvm-libunwind-9999.ebuild
new file mode 100644
index 000000000000..88f7a92b6c9c
--- /dev/null
+++ b/sys-libs/llvm-libunwind/llvm-libunwind-9999.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+inherit cmake-multilib git-r3 llvm
+
+DESCRIPTION="C++ runtime stack unwinder from LLVM"
+HOMEPAGE="https://github.com/llvm-mirror/libunwind"
+SRC_URI=""
+EGIT_REPO_URI="https://git.llvm.org/git/libunwind.git
+ https://github.com/llvm-mirror/libunwind.git"
+
+LICENSE="|| ( UoI-NCSA MIT )"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug +static-libs"
+
+RDEPEND="!sys-libs/libunwind"
+# LLVM 4 required for llvm-config --cmakedir
+DEPEND=">=sys-devel/llvm-4"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+multilib_src_configure() {
+ local libdir=$(get_libdir)
+
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+ -DLIBUNWIND_ENABLE_ASSERTIONS=$(usex debug)
+ -DLIBUNWIND_ENABLE_STATIC=$(usex static-libs)
+ )
+
+ cmake-utils_src_configure
+}
+
+multilib_src_install() {
+ cmake-utils_src_install
+
+ # install headers like sys-libs/libunwind
+ doheader "${S}"/include/*.h
+}
diff --git a/sys-libs/llvm-libunwind/metadata.xml b/sys-libs/llvm-libunwind/metadata.xml
new file mode 100644
index 000000000000..cfce3f1a81b3
--- /dev/null
+++ b/sys-libs/llvm-libunwind/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">llvm-mirror/libunwind</remote-id>
+ </upstream>
+</pkgmetadata>