Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 732084 - net-misc/rsync-3.2.2-r1 - configure.sh:4912: checking whether to enable SIMD optimizations // configure.sh:4936: error: cannot run test program while cross compiling
Summary: net-misc/rsync-3.2.2-r1 - configure.sh:4912: checking whether to enable SIMD ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-10 10:58 UTC by Aisha Tammy
Modified: 2022-03-12 22:03 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
config.log (config.log,20.89 KB, text/plain)
2020-07-10 10:58 UTC, Aisha Tammy
Details
build.log (build.log,5.39 KB, text/plain)
2020-07-10 10:59 UTC, Aisha Tammy
Details
rsync-cross.patch (rsync-cross.patch,531 bytes, patch)
2020-08-03 19:02 UTC, Sergei Trofimovich (RETIRED)
Details | Diff
quick improvement of cross compilation detection (simd_cross_compilation.patch,548 bytes, patch)
2021-11-07 19:46 UTC, Andrew Aladjev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aisha Tammy 2020-07-10 10:58:32 UTC
Created attachment 648772 [details]
config.log

This is a similar issue to bug 729074

rsync fails on trying to be compiled during cross compilation

attached build.log and config.log
Comment 1 Aisha Tammy 2020-07-10 10:59:35 UTC
Created attachment 648774 [details]
build.log
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-03 19:00:50 UTC
It's 2 bugs:
1. rsync's configure.ac should provide cross-compileng arugument to AC_RUN_IFELSE()
2. gentoo's ebuild should probablya void passing --enable-simd for non-native case (as rsync's ./configure relies on successfull runtime feature detection)
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-08-03 19:02:23 UTC
Created attachment 652780 [details, diff]
rsync-cross.patch

rsync-cross.patch should fix rsync's configure.ac. CPU_FLAGS_X86="sse2" is a bit tricky: in cross-case we might want to override configure's autodetection.
Comment 4 Aisha Tammy 2020-09-03 00:13:16 UTC
(In reply to Sergei Trofimovich from comment #3)
> Created attachment 652780 [details, diff] [details, diff]
> rsync-cross.patch
> 
> rsync-cross.patch should fix rsync's configure.ac. CPU_FLAGS_X86="sse2" is a
> bit tricky: in cross-case we might want to override configure's
> autodetection.

So as I understand this, the current patch is not working fully.
I added it to PATCHES for rsync-3.2.3 and it still fails at the same error.
Comment 5 Andrew Aladjev 2020-09-12 11:01:28 UTC
For now ebuild comes with the following lines:

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
  myeconfargs+=( --disable-simd )
fi

So workaround is the following:

net-misc/rsync -cpu_flags_x86_sse2 -simd
Comment 6 Larry the Git Cow gentoo-dev 2021-10-22 18:46:51 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=826471502e24d5d22731fe07558260551c802d4c

commit 826471502e24d5d22731fe07558260551c802d4c
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-10-22 18:43:49 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-10-22 18:46:48 +0000

    net-misc/rsync: backport cross-compile fixes
    
    Closes: https://bugs.gentoo.org/732084
    Closes: https://github.com/gentoo/gentoo/pull/22354
    Closes: https://github.com/gentoo/gentoo/pull/22667
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 net-misc/rsync/files/rsync-3.2.3-cross.patch | 107 +++++++++++++++++++++++++++
 net-misc/rsync/rsync-3.2.3-r4.ebuild         |  52 ++++---------
 net-misc/rsync/rsync-9999.ebuild             |   5 --
 3 files changed, 122 insertions(+), 42 deletions(-)
Comment 7 Andrew Aladjev 2021-11-06 23:48:19 UTC
Hello, bug still persist. The problem is the following:

> Replace runtime SIMD check with a compile-only test in case of cross-compilation.
> if test x"$host_cpu" = x"$build_cpu"; then

Sorry, this check is too naive. "$host_cpu" and "$build_cpu" may equal to "x86_64" and it doesn't detect cross compiling. We should implement cross compiling detection using comparison of full toolchain name for "$host" and "$build".

I am going to create a patch and pull request, thank you.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-07 00:04:33 UTC
(In reply to Andrew Aladjev from comment #7)
> Hello, bug still persist. The problem is the following:
> 
> > Replace runtime SIMD check with a compile-only test in case of cross-compilation.
> > if test x"$host_cpu" = x"$build_cpu"; then
> 
> Sorry, this check is too naive. "$host_cpu" and "$build_cpu" may equal to
> "x86_64" and it doesn't detect cross compiling. We should implement cross
> compiling detection using comparison of full toolchain name for "$host" and
> "$build".
> 
> I am going to create a patch and pull request, thank you.

Please do, thanks, although please do submit it upstream too as these were just backports.
Comment 9 Mike Gilbert gentoo-dev 2021-11-07 00:38:54 UTC
Yes, please send any changes upstream and we can backport them from there.
Comment 10 Andrew Aladjev 2021-11-07 19:46:40 UTC
Created attachment 749400 [details, diff]
quick improvement of cross compilation detection

I've added a pull request https://github.com/WayneD/rsync/pull/252
Comment 11 Larry the Git Cow gentoo-dev 2021-11-08 01:19:06 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a81d4c4da78b07828fa9a152d00bb20e0fe289a4

commit a81d4c4da78b07828fa9a152d00bb20e0fe289a4
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-11-08 01:18:06 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-11-08 01:18:06 +0000

    net-misc/rsync: backport another cross-compile fix
    
    Bug: https://bugs.gentoo.org/732084
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 net-misc/rsync/files/rsync-3.2.3-cross.patch | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)