0002-openpgm-pgm-checksum.c-fix-build-with-32-bits-MMX.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From b7fa865fa6b06d97d424c500fd1c4bc44c096359 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Sun, 1 Nov 2020 22:46:18 +0100
  4. Subject: [PATCH] openpgm/pgm/checksum.c: fix build with 32 bits MMX
  5. Build with i386-pentium-mmx or i686 is broken since version 5-3-128 and
  6. https://github.com/steve-o/openpgm/commit/b276dc15be5d4e6e1143b9de25d09f63f9c85135
  7. because _mm_cvtm64_si64 is undefined resulting in the following build
  8. failure for example on zeromq:
  9. /srv/storage/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/i586-buildroot-linux-musl/8.3.0/../../../../i586-buildroot-linux-musl/bin/ld: /srv/storage/autobuild/run/instance-3/output-1/host/i586-buildroot-linux-musl/sysroot/usr/lib32/libpgm-5.3.so.0: undefined reference to `_mm_cvtm64_si64'
  10. So use the fallback if __x86_64__ is not defined
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/01d9be37e8a743307128f53f41785654c9971e1a
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  15. ---
  16. Upstream status: commit b7fa865fa6b06d97d424c500fd1c4bc44c096359
  17. openpgm/pgm/checksum.c | 2 +-
  18. 1 file changed, 1 insertion(+), 1 deletion(-)
  19. diff --git a/openpgm/pgm/checksum.c b/openpgm/pgm/checksum.c
  20. index fef89bce237c..8d8dd3f32305 100644
  21. --- a/openpgm/pgm/checksum.c
  22. +++ b/openpgm/pgm/checksum.c
  23. @@ -948,7 +948,7 @@ do_csumcpy_mmx (
  24. sum = _mm_add_pi32 (sum, lo);
  25. sum = _mm_add_pi32 (sum, hi);
  26. -#if 1
  27. +#if defined(__x86_64__)
  28. *(int64_t*)dst = _mm_cvtm64_si64 (tmp);
  29. #else
  30. ((int*)dst)[1] = _mm_cvtsi64_si32 (tmp);
  31. --
  32. 2.30.2