1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
Description: Fix program segfault on some ARM environments.
Problem is actual for users of Ubuntu and Raspbian.
Origin: https://github.com/eiskaltdcpp/eiskaltdcpp/commit/f9be84e
Applied-Upstream: 2.3.0
Last-Update: 2014-02-21
--- a/dcpp/TigerHash.cpp
+++ b/dcpp/TigerHash.cpp
@@ -201,8 +201,20 @@
buf[j^7]=((uint8_t*)str)[j];
tiger_compress_macro(((uint64_t*)buf), res);
#else
+// Small fix by Boris Pek <tehnick-8@mail.ru>
+// Bug report: https://github.com/eiskaltdcpp/eiskaltdcpp/pull/25
+// Description: The ARM EABI requires 8-byte stack alignment at public
+// function entry points, compared to the previous 4-byte alignment.
+// See for details: https://wiki.debian.org/ArmEabiPort
+#if defined(__ARM_EABI__)
+ uint64_t str64[8];
+ memcpy(str64, str, BLOCK_SIZE);
+ tiger_compress_macro(((uint64_t*)str64), res);
+#else // common case
tiger_compress_macro(((uint64_t*)str), res);
#endif
+// end of fix
+#endif
str += BLOCK_SIZE;
pos += BLOCK_SIZE;
length -= BLOCK_SIZE;
|