diff options
author | James Le Cuirot <chewi@gentoo.org> | 2023-01-29 11:33:38 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2023-01-29 11:33:38 +0000 |
commit | f522845a9404611765279f3e2ca28e519abbf182 (patch) | |
tree | 4405ac3a353dcaba9887f1a95a0ac748d7e1e40d /sys-devel/lld | |
parent | media-sound/audacity: bug-fix bump to 3.2.4 + eapi8 + dep versions cleanup, d... (diff) | |
download | gentoo-f522845a9404611765279f3e2ca28e519abbf182.tar.gz gentoo-f522845a9404611765279f3e2ca28e519abbf182.tar.bz2 gentoo-f522845a9404611765279f3e2ca28e519abbf182.zip |
sys-devel/lld: Fix cross-compiling with -DLLVM_TABLEGEN_EXE
The Clang approach of using -DLLVM_TOOLS_BINARY_DIR does not work here.
Closes: https://bugs.gentoo.org/891993
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'sys-devel/lld')
-rw-r--r-- | sys-devel/lld/lld-15.0.7.ebuild | 12 | ||||
-rw-r--r-- | sys-devel/lld/lld-16.0.0.9999.ebuild | 12 | ||||
-rw-r--r-- | sys-devel/lld/lld-16.0.0_pre20230107.ebuild | 12 | ||||
-rw-r--r-- | sys-devel/lld/lld-16.0.0_pre20230127.ebuild | 12 | ||||
-rw-r--r-- | sys-devel/lld/lld-17.0.0.9999.ebuild | 12 |
5 files changed, 55 insertions, 5 deletions
diff --git a/sys-devel/lld/lld-15.0.7.ebuild b/sys-devel/lld/lld-15.0.7.ebuild index 7bccf83c3662..6156f9bae682 100644 --- a/sys-devel/lld/lld-15.0.7.ebuild +++ b/sys-devel/lld/lld-15.0.7.ebuild @@ -4,7 +4,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) -inherit cmake flag-o-matic llvm llvm.org python-any-r1 +inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs DESCRIPTION="The LLVM linker (link editor)" HOMEPAGE="https://llvm.org/" @@ -69,12 +69,22 @@ src_configure() { -DLLVM_INCLUDE_TESTS=$(usex test) -DLLVM_MAIN_SRC_DIR="${WORKDIR}/llvm" ) + use test && mycmakeargs+=( -DLLVM_BUILD_TESTS=ON -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" -DLLVM_LIT_ARGS="$(get_lit_flags)" -DPython3_EXECUTABLE="${PYTHON}" ) + + if tc-is-cross-compiler; then + has_version -b sys-devel/llvm:${LLVM_MAJOR} || + die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." + mycmakeargs+=( + -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" + ) + fi + cmake_src_configure } diff --git a/sys-devel/lld/lld-16.0.0.9999.ebuild b/sys-devel/lld/lld-16.0.0.9999.ebuild index a540e3ab0cb3..c23949899ce7 100644 --- a/sys-devel/lld/lld-16.0.0.9999.ebuild +++ b/sys-devel/lld/lld-16.0.0.9999.ebuild @@ -4,7 +4,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) -inherit cmake flag-o-matic llvm llvm.org python-any-r1 +inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs DESCRIPTION="The LLVM linker (link editor)" HOMEPAGE="https://llvm.org/" @@ -69,11 +69,21 @@ src_configure() { -DBUILD_SHARED_LIBS=ON -DLLVM_INCLUDE_TESTS=$(usex test) ) + use test && mycmakeargs+=( -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" -DLLVM_LIT_ARGS="$(get_lit_flags)" -DPython3_EXECUTABLE="${PYTHON}" ) + + if tc-is-cross-compiler; then + has_version -b sys-devel/llvm:${LLVM_MAJOR} || + die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." + mycmakeargs+=( + -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" + ) + fi + cmake_src_configure } diff --git a/sys-devel/lld/lld-16.0.0_pre20230107.ebuild b/sys-devel/lld/lld-16.0.0_pre20230107.ebuild index a540e3ab0cb3..c23949899ce7 100644 --- a/sys-devel/lld/lld-16.0.0_pre20230107.ebuild +++ b/sys-devel/lld/lld-16.0.0_pre20230107.ebuild @@ -4,7 +4,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) -inherit cmake flag-o-matic llvm llvm.org python-any-r1 +inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs DESCRIPTION="The LLVM linker (link editor)" HOMEPAGE="https://llvm.org/" @@ -69,11 +69,21 @@ src_configure() { -DBUILD_SHARED_LIBS=ON -DLLVM_INCLUDE_TESTS=$(usex test) ) + use test && mycmakeargs+=( -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" -DLLVM_LIT_ARGS="$(get_lit_flags)" -DPython3_EXECUTABLE="${PYTHON}" ) + + if tc-is-cross-compiler; then + has_version -b sys-devel/llvm:${LLVM_MAJOR} || + die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." + mycmakeargs+=( + -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" + ) + fi + cmake_src_configure } diff --git a/sys-devel/lld/lld-16.0.0_pre20230127.ebuild b/sys-devel/lld/lld-16.0.0_pre20230127.ebuild index a540e3ab0cb3..c23949899ce7 100644 --- a/sys-devel/lld/lld-16.0.0_pre20230127.ebuild +++ b/sys-devel/lld/lld-16.0.0_pre20230127.ebuild @@ -4,7 +4,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) -inherit cmake flag-o-matic llvm llvm.org python-any-r1 +inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs DESCRIPTION="The LLVM linker (link editor)" HOMEPAGE="https://llvm.org/" @@ -69,11 +69,21 @@ src_configure() { -DBUILD_SHARED_LIBS=ON -DLLVM_INCLUDE_TESTS=$(usex test) ) + use test && mycmakeargs+=( -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" -DLLVM_LIT_ARGS="$(get_lit_flags)" -DPython3_EXECUTABLE="${PYTHON}" ) + + if tc-is-cross-compiler; then + has_version -b sys-devel/llvm:${LLVM_MAJOR} || + die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." + mycmakeargs+=( + -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" + ) + fi + cmake_src_configure } diff --git a/sys-devel/lld/lld-17.0.0.9999.ebuild b/sys-devel/lld/lld-17.0.0.9999.ebuild index a540e3ab0cb3..c23949899ce7 100644 --- a/sys-devel/lld/lld-17.0.0.9999.ebuild +++ b/sys-devel/lld/lld-17.0.0.9999.ebuild @@ -4,7 +4,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) -inherit cmake flag-o-matic llvm llvm.org python-any-r1 +inherit cmake flag-o-matic llvm llvm.org python-any-r1 toolchain-funcs DESCRIPTION="The LLVM linker (link editor)" HOMEPAGE="https://llvm.org/" @@ -69,11 +69,21 @@ src_configure() { -DBUILD_SHARED_LIBS=ON -DLLVM_INCLUDE_TESTS=$(usex test) ) + use test && mycmakeargs+=( -DLLVM_EXTERNAL_LIT="${EPREFIX}/usr/bin/lit" -DLLVM_LIT_ARGS="$(get_lit_flags)" -DPython3_EXECUTABLE="${PYTHON}" ) + + if tc-is-cross-compiler; then + has_version -b sys-devel/llvm:${LLVM_MAJOR} || + die "sys-devel/llvm:${LLVM_MAJOR} is required on the build host." + mycmakeargs+=( + -DLLVM_TABLEGEN_EXE="${BROOT}/usr/lib/llvm/${LLVM_MAJOR}/bin/llvm-tblgen" + ) + fi + cmake_src_configure } |