commit:     5ec6220049870a8d8f097823a8e682b8fa1df823
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 13 15:31:16 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Oct 13 15:41:11 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ec62200

sys-devel/llvm-toolchain-symlinks: Do not multilib by default

Bug: https://bugs.gentoo.org/876901
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ...ks-14.ebuild => llvm-toolchain-symlinks-14-r1.ebuild} | 16 +++++++++++-----
 ...ks-15.ebuild => llvm-toolchain-symlinks-15-r1.ebuild} | 16 +++++++++++-----
 ...ks-16.ebuild => llvm-toolchain-symlinks-16-r1.ebuild} | 16 +++++++++++-----
 sys-devel/llvm-toolchain-symlinks/metadata.xml           |  5 +++++
 4 files changed, 38 insertions(+), 15 deletions(-)

diff --git 
a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-14.ebuild 
b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-14-r1.ebuild
similarity index 71%
rename from sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-14.ebuild
rename to sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-14-r1.ebuild
index 9cc42ef77e31..8d59c568c625 100644
--- a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-14.ebuild
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-14-r1.ebuild
@@ -13,7 +13,7 @@ S=${WORKDIR}
 LICENSE="public-domain"
 SLOT="${PV}"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux 
~ppc-macos ~x64-macos"
-IUSE="+native-symlinks"
+IUSE="multilib-symlinks +native-symlinks"
 
 RDEPEND="
        sys-devel/llvm:${SLOT}
@@ -26,17 +26,23 @@ src_install() {
                addr2line ar dlltool nm objcopy objdump ranlib readelf size
                strings strip windres
        )
+       local chosts=( "${CHOST}" )
+       if use multilib-symlinks; then
+               local abi
+               for abi in $(get_all_abis); do
+                       chosts+=( "$(get_abi_CHOST "${abi}")" )
+               done
+       fi
 
-       local abi t
+       local chost t
        local dest=/usr/lib/llvm/${SLOT}/bin
        dodir "${dest}"
        for t in "${tools[@]}"; do
                dosym "llvm-${t}" "${dest}/${t}"
        done
-       for abi in $(get_all_abis); do
-               local abi_chost=$(get_abi_CHOST "${abi}")
+       for chost in "${chosts[@]}"; do
                for t in "${tools[@]}"; do
-                       dosym "llvm-${t}" "${dest}/${abi_chost}-${t}"
+                       dosym "llvm-${t}" "${dest}/${chost}-${t}"
                done
        done
 }

diff --git 
a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15.ebuild 
b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15-r1.ebuild
similarity index 71%
rename from sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15.ebuild
rename to sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15-r1.ebuild
index 9cc42ef77e31..8d59c568c625 100644
--- a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15.ebuild
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-15-r1.ebuild
@@ -13,7 +13,7 @@ S=${WORKDIR}
 LICENSE="public-domain"
 SLOT="${PV}"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux 
~ppc-macos ~x64-macos"
-IUSE="+native-symlinks"
+IUSE="multilib-symlinks +native-symlinks"
 
 RDEPEND="
        sys-devel/llvm:${SLOT}
@@ -26,17 +26,23 @@ src_install() {
                addr2line ar dlltool nm objcopy objdump ranlib readelf size
                strings strip windres
        )
+       local chosts=( "${CHOST}" )
+       if use multilib-symlinks; then
+               local abi
+               for abi in $(get_all_abis); do
+                       chosts+=( "$(get_abi_CHOST "${abi}")" )
+               done
+       fi
 
-       local abi t
+       local chost t
        local dest=/usr/lib/llvm/${SLOT}/bin
        dodir "${dest}"
        for t in "${tools[@]}"; do
                dosym "llvm-${t}" "${dest}/${t}"
        done
-       for abi in $(get_all_abis); do
-               local abi_chost=$(get_abi_CHOST "${abi}")
+       for chost in "${chosts[@]}"; do
                for t in "${tools[@]}"; do
-                       dosym "llvm-${t}" "${dest}/${abi_chost}-${t}"
+                       dosym "llvm-${t}" "${dest}/${chost}-${t}"
                done
        done
 }

diff --git 
a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16.ebuild 
b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16-r1.ebuild
similarity index 70%
rename from sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16.ebuild
rename to sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16-r1.ebuild
index 117dff32e17b..10c6367152de 100644
--- a/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16.ebuild
+++ b/sys-devel/llvm-toolchain-symlinks/llvm-toolchain-symlinks-16-r1.ebuild
@@ -14,7 +14,7 @@ LICENSE="public-domain"
 SLOT="${PV}"
 KEYWORDS=""
 PROPERTIES="live"
-IUSE="+native-symlinks"
+IUSE="multilib-symlinks +native-symlinks"
 
 RDEPEND="
        sys-devel/llvm:${SLOT}
@@ -27,17 +27,23 @@ src_install() {
                addr2line ar dlltool nm objcopy objdump ranlib readelf size
                strings strip windres
        )
+       local chosts=( "${CHOST}" )
+       if use multilib-symlinks; then
+               local abi
+               for abi in $(get_all_abis); do
+                       chosts+=( "$(get_abi_CHOST "${abi}")" )
+               done
+       fi
 
-       local abi t
+       local chost t
        local dest=/usr/lib/llvm/${SLOT}/bin
        dodir "${dest}"
        for t in "${tools[@]}"; do
                dosym "llvm-${t}" "${dest}/${t}"
        done
-       for abi in $(get_all_abis); do
-               local abi_chost=$(get_abi_CHOST "${abi}")
+       for chost in "${chosts[@]}"; do
                for t in "${tools[@]}"; do
-                       dosym "llvm-${t}" "${dest}/${abi_chost}-${t}"
+                       dosym "llvm-${t}" "${dest}/${chost}-${t}"
                done
        done
 }

diff --git a/sys-devel/llvm-toolchain-symlinks/metadata.xml 
b/sys-devel/llvm-toolchain-symlinks/metadata.xml
index c6260bb7fb74..d62775dfc3a3 100644
--- a/sys-devel/llvm-toolchain-symlinks/metadata.xml
+++ b/sys-devel/llvm-toolchain-symlinks/metadata.xml
@@ -5,6 +5,11 @@
                <email>[email protected]</email>
        </maintainer>
        <use>
+               <flag name="multilib-symlinks">
+                       Install symlinks for all ABI CHOSTs. Note that this can
+                       result in gcc being overrode for native builds, as well
+                       as conflict with crossdev if used for the same targets.
+               </flag>
                <flag name="native-symlinks">
                        Install generic tool symlinks like 'objdump' and 
'ranlib',
                        as well as ${CTARGET}-*. These symlinks are installed

Reply via email to