Browse Source

package/xmrig: enable for avmv7a

Available since 2017:
https://github.com/xmrig/xmrig/commit/aa4f8b6fa78eb8331b5927ba5315b926ac75ce9c

We noticed it since its addition to the readme:
https://github.com/xmrig/xmrig/commit/97869f3347a621d9dbf20210289ce10c68a5bd34

Added patch to fix build with gcc-4.8.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Bernd Kuhls 3 years ago
parent
commit
935617e016
2 changed files with 42 additions and 2 deletions
  1. 40 0
      package/xmrig/0001-astrobwt-fix-build-with-gcc-4.8.patch
  2. 2 2
      package/xmrig/Config.in

+ 40 - 0
package/xmrig/0001-astrobwt-fix-build-with-gcc-4.8.patch

@@ -0,0 +1,40 @@
+From 72234ae73590fa93d837034a3fb48b71eb071a2a Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd.kuhls@t-online.de>
+Date: Sun, 22 May 2022 20:24:14 +0200
+Subject: [PATCH] astrobwt: fix build with gcc-4.8
+
+Fixes build error:
+
+xmrig-6.17.0/src/crypto/astrobwt/sort_indices2.cpp:40:24: error: missing binary operator before token "("
+ #if __has_cpp_attribute(unlikely)
+
+found with the buildroot toolchain
+arm-none-linux-gnueabi-gcc (Sourcery CodeBench Lite 2014.05-29) 4.8.3 20140320 (prerelease)
+
+Inspired by
+https://reviews.llvm.org/rG91c32fd8c8fa395971a028f7091273fa2c8f44e6
+
+Patch sent upstream: https://github.com/xmrig/xmrig/pull/3057
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ src/crypto/astrobwt/sort_indices2.cpp | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/crypto/astrobwt/sort_indices2.cpp b/src/crypto/astrobwt/sort_indices2.cpp
+index 2d86d462..3a70f619 100644
+--- a/src/crypto/astrobwt/sort_indices2.cpp
++++ b/src/crypto/astrobwt/sort_indices2.cpp
+@@ -36,6 +36,9 @@
+ #define RESTRICT
+ #endif
+ 
++#ifndef __has_cpp_attribute
++#define __has_cpp_attribute(x) 0
++#endif
+ 
+ #if __has_cpp_attribute(unlikely)
+ #define UNLIKELY(X) (X) [[unlikely]]
+-- 
+2.30.2
+

+ 2 - 2
package/xmrig/Config.in

@@ -1,7 +1,7 @@
 config BR2_PACKAGE_XMRIG
 	bool "xmrig"
 	# archs officially supported by upstream
-	depends on BR2_aarch64 || BR2_x86_64 || BR2_i386
+	depends on BR2_ARM_CPU_ARMV7A || BR2_aarch64 || BR2_x86_64 || BR2_i386
 	depends on BR2_USE_MMU # libuv
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4 # libuv
 	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # libuv
@@ -16,7 +16,7 @@ config BR2_PACKAGE_XMRIG
 	  https://xmrig.com
 
 comment "xmrig needs a glibc or musl toolchain w/ NPTL, dynamic library, C++"
-	depends on BR2_aarch64 || BR2_x86_64 || BR2_i386
+	depends on BR2_ARM_CPU_ARMV7A || BR2_aarch64 || BR2_x86_64 || BR2_i386
 	depends on BR2_USE_MMU
 	depends on BR2_TOOLCHAIN_HAS_SYNC_4
 	depends on !BR2_TOOLCHAIN_HAS_THREADS_NPTL || \