commit:     81e8e7d6db67b73553187c48893cbc36c546122e
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 19 01:38:02 2021 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Apr 19 01:38:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=81e8e7d6

net-misc/rsync: simplify simd logic

The SIMD implementation is smart enough to only execute instructions
that are available at runtime, so just let configure enable it.

The configure test for compiler support does not work when
cross-compiling.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-misc/rsync/rsync-3.2.3-r3.ebuild | 11 +++--------
 net-misc/rsync/rsync-9999.ebuild     | 11 +++--------
 2 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/net-misc/rsync/rsync-3.2.3-r3.ebuild 
b/net-misc/rsync/rsync-3.2.3-r3.ebuild
index d71437f679b..64bc69d5ac4 100644
--- a/net-misc/rsync/rsync-3.2.3-r3.ebuild
+++ b/net-misc/rsync/rsync-3.2.3-r3.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit prefix systemd
+inherit prefix systemd toolchain-funcs
 
 DESCRIPTION="File transfer program to keep remote files into sync"
 HOMEPAGE="https://rsync.samba.org/";
@@ -24,9 +24,7 @@ fi
 
 LICENSE="GPL-3"
 SLOT="0"
-IUSE_CPU_FLAGS_X86=" sse2"
 IUSE="acl examples iconv ipv6 libressl lz4 ssl stunnel system-zlib xattr 
xxhash zstd"
-IUSE+=" ${IUSE_CPU_FLAGS_X86// / cpu_flags_x86_}"
 
 RDEPEND="acl? ( virtual/acl )
        lz4? ( app-arch/lz4 )
@@ -81,11 +79,8 @@ src_configure() {
                $(use_enable zstd)
        )
 
-       if use elibc_glibc && [[ "${ARCH}" == "amd64" ]] ; then
-               # SIMD is only available for x86_64 right now
-               # and only on glibc (#728868)
-               myeconfargs+=( $(use_enable cpu_flags_x86_sse2 simd) )
-       else
+       if tc-is-cross-compiler; then
+               # configure check is broken when cross-compiling.
                myeconfargs+=( --disable-simd )
        fi
 

diff --git a/net-misc/rsync/rsync-9999.ebuild b/net-misc/rsync/rsync-9999.ebuild
index 0e776b6ee27..370fd32ffd2 100644
--- a/net-misc/rsync/rsync-9999.ebuild
+++ b/net-misc/rsync/rsync-9999.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit prefix systemd
+inherit prefix systemd toolchain-funcs
 
 DESCRIPTION="File transfer program to keep remote files into sync"
 HOMEPAGE="https://rsync.samba.org/";
@@ -24,9 +24,7 @@ fi
 
 LICENSE="GPL-3"
 SLOT="0"
-IUSE_CPU_FLAGS_X86=" sse2"
 IUSE="acl examples iconv ipv6 libressl lz4 ssl stunnel system-zlib xattr 
xxhash zstd"
-IUSE+=" ${IUSE_CPU_FLAGS_X86// / cpu_flags_x86_}"
 
 RDEPEND="acl? ( virtual/acl )
        lz4? ( app-arch/lz4 )
@@ -78,11 +76,8 @@ src_configure() {
                $(use_enable zstd)
        )
 
-       if use elibc_glibc && [[ "${ARCH}" == "amd64" ]] ; then
-               # SIMD is only available for x86_64 right now
-               # and only on glibc (#728868)
-               myeconfargs+=( $(use_enable cpu_flags_x86_sse2 simd) )
-       else
+       if tc-is-cross-compiler; then
+               # configure check is broken when cross-compiling.
                myeconfargs+=( --disable-simd )
        fi
 

Reply via email to