commit:     8be073dde3867d361c79022aa29e48f7cd13282b
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Sep 24 08:00:00 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Sep 24 14:00:44 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8be073dd

sys-devel/lld: Provide libunwind headers to fix build

lld/MachO/UnwindInfoSection.h includes
libunwind/include/mach-o/compact_unwind_encoding.h since:
https://github.com/llvm/llvm-project/commit/2124ca1d5cb67cf494fb6605d1d437a40610e6ef

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-devel/lld/lld-12.0.0.9999.ebuild | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/sys-devel/lld/lld-12.0.0.9999.ebuild 
b/sys-devel/lld/lld-12.0.0.9999.ebuild
index 7b627c88cf1..88c1fe13f11 100644
--- a/sys-devel/lld/lld-12.0.0.9999.ebuild
+++ b/sys-devel/lld/lld-12.0.0.9999.ebuild
@@ -8,7 +8,7 @@ inherit cmake llvm llvm.org python-any-r1
 
 DESCRIPTION="The LLVM linker (link editor)"
 HOMEPAGE="https://llvm.org/";
-LLVM_COMPONENTS=( lld )
+LLVM_COMPONENTS=( lld libunwind/include/mach-o )
 LLVM_TEST_COMPONENTS=( llvm/utils/{lit,unittest} )
 llvm.org_set_globals
 
@@ -31,15 +31,26 @@ pkg_setup() {
        use test && python-any-r1_pkg_setup
 }
 
+src_unpack() {
+       llvm.org_src_unpack
+
+       # Directory ${WORKDIR}/llvm does not exist with USE="-test",
+       # but LLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" is set below,
+       # and ${LLVM_MAIN_SRC_DIR}/../libunwind/include is used by build system
+       # (lld/MachO/CMakeLists.txt) and is expected to be resolvable
+       # to existent directory ${WORKDIR}/libunwind/include.
+       mkdir -p "${WORKDIR}/llvm" || die
+}
+
 src_configure() {
        local mycmakeargs=(
                -DBUILD_SHARED_LIBS=OFF
 
                -DLLVM_INCLUDE_TESTS=$(usex test)
+               -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
        )
        use test && mycmakeargs+=(
                -DLLVM_BUILD_TESTS=ON
-               -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm"
                -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit"
                -DLLVM_LIT_ARGS="$(get_lit_flags)"
        )

Reply via email to