diff options
author | Mike Gilbert <floppym@gentoo.org> | 2021-10-22 14:43:49 -0400 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2021-10-22 14:46:48 -0400 |
commit | 826471502e24d5d22731fe07558260551c802d4c (patch) | |
tree | 87412e9084e43efef67b0a5893c6deb87c756c02 /net-misc/rsync/files | |
parent | dev-libs/openssl: drop USE=bindist (diff) | |
download | gentoo-826471502e24d5d22731fe07558260551c802d4c.tar.gz gentoo-826471502e24d5d22731fe07558260551c802d4c.tar.bz2 gentoo-826471502e24d5d22731fe07558260551c802d4c.zip |
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>
Diffstat (limited to 'net-misc/rsync/files')
-rw-r--r-- | net-misc/rsync/files/rsync-3.2.3-cross.patch | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/net-misc/rsync/files/rsync-3.2.3-cross.patch b/net-misc/rsync/files/rsync-3.2.3-cross.patch new file mode 100644 index 000000000000..1f23627853b9 --- /dev/null +++ b/net-misc/rsync/files/rsync-3.2.3-cross.patch @@ -0,0 +1,107 @@ +From 9f9240b661c5f381831b62d72b6ea928a91ff43a Mon Sep 17 00:00:00 2001 +From: Wayne Davison <wayne@opencoder.net> +Date: Thu, 3 Sep 2020 10:07:36 -0700 +Subject: [PATCH] Set CXX_OK=no when cross compiling. + +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 64d2e6d6..109546a6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -233,7 +233,7 @@ __attribute__ ((target("ssse3"))) void more_testing(char* buf, int len) + in8_2 = _mm_lddqu_si128((__m128i_u*)&buf[i + 16]); + } + } +-]], [[if (test_ssse3(42) != 42 || test_sse2(42) != 42 || test_avx2(42) != 42) exit(1);]])],[CXX_OK=yes],[CXX_OK=no]) ++]], [[if (test_ssse3(42) != 42 || test_sse2(42) != 42 || test_avx2(42) != 42) exit(1);]])],[CXX_OK=yes],[CXX_OK=no],[CXX_OK=no]) + AC_LANG(C) + if test x"$CXX_OK" = x"yes"; then + # AC_MSG_RESULT() is called below. +From 7eb59a9152a2ace7bc7858e9915c671b3ab54344 Mon Sep 17 00:00:00 2001 +From: Wayne Davison <wayne@opencoder.net> +Date: Tue, 22 Sep 2020 17:19:45 -0700 +Subject: [PATCH] Change from $build_cpu to $host_cpu as edo1 suggested. + +--- + configure.ac | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 109546a6..e8c06f42 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -211,7 +211,7 @@ CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-g //'` + + if test x"$enable_simd" != x"no"; then + # For x86-64 SIMD, g++ >=5 or clang++ >=7 is required +- if test x"$build_cpu" = x"x86_64"; then ++ if test x"$host_cpu" = x"x86_64"; then + AC_LANG(C++) + AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> + #include <immintrin.h> +@@ -283,8 +283,8 @@ AC_ARG_ENABLE(asm, + AS_HELP_STRING([--disable-asm],[disable ASM optimizations])) + + if test x"$enable_asm" != x"no"; then +- if test x"$build_cpu" = x"x86_64"; then +- ASM="$build_cpu" ++ if test x"$host_cpu" = x"x86_64"; then ++ ASM="$host_cpu" + elif test x"$enable_asm" = x"yes"; then + AC_MSG_RESULT(unavailable) + AC_MSG_ERROR(The ASM optimizations are currently x86_64 only. +From b7fab6f285ff0ff3816b109a8c3131b6ded0b484 Mon Sep 17 00:00:00 2001 +From: edo <edo.rus@gmail.com> +Date: Wed, 7 Oct 2020 08:33:57 +0300 +Subject: [PATCH] Allow cross-compilation with SIMD (x86_84) (#104) + +Replace runtime SIMD check with a compile-only test in case of +cross-compilation. + +You can still use '--enable-simd=no' to build x86_64 code without +SIMD instructions. +--- + configure.ac | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 3fd7e5d5..e469981b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -208,12 +208,7 @@ AC_ARG_ENABLE(simd, + + # Clag is crashing with -g -O2, so we'll get rid of -g for now. + CXXFLAGS=`echo "$CXXFLAGS" | sed 's/-g //'` +- +-if test x"$enable_simd" != x"no"; then +- # For x86-64 SIMD, g++ >=5 or clang++ >=7 is required +- if test x"$host_cpu" = x"x86_64"; then +- AC_LANG(C++) +- AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h> ++m4_define(SIMD_X86_64_TEST, [[#include <stdio.h> + #include <immintrin.h> + __attribute__ ((target("default"))) int test_ssse3(int x) { return x; } + __attribute__ ((target("default"))) int test_sse2(int x) { return x; } +@@ -233,7 +228,18 @@ __attribute__ ((target("ssse3"))) void more_testing(char* buf, int len) + in8_2 = _mm_lddqu_si128((__m128i_u*)&buf[i + 16]); + } + } +-]], [[if (test_ssse3(42) != 42 || test_sse2(42) != 42 || test_avx2(42) != 42) exit(1);]])],[CXX_OK=yes],[CXX_OK=no],[CXX_OK=no]) ++]]) ++ ++if test x"$enable_simd" != x"no"; then ++ # For x86-64 SIMD, g++ >=5 or clang++ >=7 is required ++ if test x"$host_cpu" = x"x86_64"; then ++ AC_LANG(C++) ++ if test x"$host_cpu" = x"$build_cpu"; then ++ AC_RUN_IFELSE([AC_LANG_PROGRAM([SIMD_X86_64_TEST],[[if (test_ssse3(42) != 42 || test_sse2(42) != 42 || test_avx2(42) != 42) exit(1);]])], ++ [CXX_OK=yes],[CXX_OK=no]) ++ else ++ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([SIMD_X86_64_TEST])],[CXX_OK=yes],[CXX_OK=no]) ++ fi + AC_LANG(C) + if test x"$CXX_OK" = x"yes"; then + # AC_MSG_RESULT() is called below. |