commit:     f08993a09f29a42b693fd385ed5777323c67441b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 11 23:02:37 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 11 23:03:11 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f08993a0

net-misc/xmrig: backport arm64 narrowing conversion patch

Needed for arches with unsigned char to fix compilation.

Bug: https://github.com/xmrig/xmrig/issues/2527
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../xmrig-6.14.0-narrowing-conversion-arm64.patch  | 27 ++++++++++++++++++++++
 net-misc/xmrig/xmrig-6.14.0.ebuild                 |  5 +++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/net-misc/xmrig/files/xmrig-6.14.0-narrowing-conversion-arm64.patch 
b/net-misc/xmrig/files/xmrig-6.14.0-narrowing-conversion-arm64.patch
new file mode 100644
index 00000000000..7f1f1bb4da7
--- /dev/null
+++ b/net-misc/xmrig/files/xmrig-6.14.0-narrowing-conversion-arm64.patch
@@ -0,0 +1,27 @@
+Fixes build on arm64 (and other platforms with unsigned char).
+
+https://github.com/xmrig/xmrig/commit/f4cdc527b00571150e8521331928c75b44e071f9.patch
+https://github.com/xmrig/xmrig/issues/2527
+
+From f4cdc527b00571150e8521331928c75b44e071f9 Mon Sep 17 00:00:00 2001
+From: XMRig <[email protected]>
+Date: Tue, 10 Aug 2021 01:40:36 +0700
+Subject: [PATCH] #2527 Fix narrowing conversion.
+
+---
+ src/base/net/stratum/DaemonClient.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/base/net/stratum/DaemonClient.cpp 
b/src/base/net/stratum/DaemonClient.cpp
+index 77818f34c..76f30c653 100644
+--- a/src/base/net/stratum/DaemonClient.cpp
++++ b/src/base/net/stratum/DaemonClient.cpp
+@@ -65,7 +65,7 @@ static const char *kJsonRPC                 = "/json_rpc";
+ 
+ static constexpr size_t kBlobReserveSize    = 8;
+ 
+-static const char kZMQGreeting[64] = { -1, 0, 0, 0, 0, 0, 0, 0, 0, 127, 3, 0, 
'N', 'U', 'L', 'L' };
++static const char kZMQGreeting[64] = { static_cast<char>(-1), 0, 0, 0, 0, 0, 
0, 0, 0, 127, 3, 0, 'N', 'U', 'L', 'L' };
+ static constexpr size_t kZMQGreetingSize1 = 11;
+ 
+ static const char kZMQHandshake[] = "\4\x19\5READY\xbSocket-Type\0\0\0\3SUB";

diff --git a/net-misc/xmrig/xmrig-6.14.0.ebuild 
b/net-misc/xmrig/xmrig-6.14.0.ebuild
index 97dc2905531..454bae8f972 100644
--- a/net-misc/xmrig/xmrig-6.14.0.ebuild
+++ b/net-misc/xmrig/xmrig-6.14.0.ebuild
@@ -30,7 +30,10 @@ RDEPEND="
        !arm64? ( sys-apps/msr-tools )
 "
 
-PATCHES=( "${FILESDIR}"/${PN}-6.12.2-nonotls.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-6.12.2-nonotls.patch
+       "${FILESDIR}"/${PN}-6.14.0-narrowing-conversion-arm64.patch
+)
 
 src_prepare() {
        if ! use donate ; then

Reply via email to