diff --git a/CHANGELOG.md b/CHANGELOG.md index b8b42784..87c5714d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# v6.3.3 +- [#1817](https://github.com/xmrig/xmrig/pull/1817) Fixed self-select login sequence. +- Added brand new [build from source](https://xmrig.com/docs/miner/build) documentation. +- New binary downloads for macOS (`macos-x64`), FreeBSD (`freebsd-static-x64`), Linux (`linux-static-x64`), Ubuntu 18.04 (`bionic-x64`), Ubuntu 20.04 (`focal-x64`). +- Generic Linux download `xenial-x64` renamed to `linux-x64`. +- Builds without SSL/TLS support are no longer provided. +- Improved CUDA loader error reporting and fixed plugin load on Linux. +- Fixed build warnings with Clang compiler. +- Fixed colors on macOS. + # v6.3.2 - [#1794](https://github.com/xmrig/xmrig/pull/1794) More robust 1 GB pages handling. - Don't allocate 1 GB per thread if 1 GB is the default huge page size. diff --git a/CMakeLists.txt b/CMakeLists.txt index b334d1ae..5ac37b15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,10 +208,6 @@ include_directories(src) include_directories(src/3rdparty) include_directories(${UV_INCLUDE_DIR}) -if (BUILD_STATIC) - set(CMAKE_EXE_LINKER_FLAGS " -static") -endif() - if (WITH_DEBUG_LOG) add_definitions(/DAPP_DEBUG) endif() @@ -223,3 +219,7 @@ if (WIN32) add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/bin/WinRing0/WinRing0x64.sys" $) endif() + +if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_BUILD_TYPE STREQUAL Release) + add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} ${CMAKE_PROJECT_NAME}) +endif() diff --git a/README.md b/README.md index f6968082..65183710 100644 --- a/README.md +++ b/README.md @@ -2,36 +2,35 @@ [![Github All Releases](https://img.shields.io/github/downloads/xmrig/xmrig/total.svg)](https://github.com/MoneroOcean/xmrig/releases) [![GitHub release](https://img.shields.io/github/release/xmrig/xmrig/all.svg)](https://github.com/MoneroOcean/xmrig/releases) -[![GitHub Release Date](https://img.shields.io/github/release-date-pre/xmrig/xmrig.svg)](https://github.com/MoneroOcean/xmrig/releases) +[![GitHub Release Date](https://img.shields.io/github/release-date/xmrig/xmrig.svg)](https://github.com/MoneroOcean/xmrig/releases) [![GitHub license](https://img.shields.io/github/license/xmrig/xmrig.svg)](https://github.com/MoneroOcean/xmrig/blob/master/LICENSE) [![GitHub stars](https://img.shields.io/github/stars/xmrig/xmrig.svg)](https://github.com/MoneroOcean/xmrig/stargazers) [![GitHub forks](https://img.shields.io/github/forks/xmrig/xmrig.svg)](https://github.com/MoneroOcean/xmrig/network) -XMRig High performance, open source, cross platform RandomX, KawPow, CryptoNight, AstroBWT and Argon2 CPU/GPU miner, with official support for Windows. +XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and AstroBWT unified CPU/GPU miner. Official binaries are available for Windows, Linux, macOS and FreeBSD. ## Mining backends -- **CPU** (x64/x86/ARM) +- **CPU** (x64/ARMv8) - **OpenCL** for AMD GPUs. - **CUDA** for NVIDIA GPUs via external [CUDA plugin](https://github.com/MoneroOcean/xmrig-cuda). - - ## Download -* Binary releases: https://github.com/MoneroOcean/xmrig/releases -* Git tree: https://github.com/MoneroOcean/xmrig.git - * Clone with `git clone https://github.com/MoneroOcean/xmrig.git` :hammer: [Build instructions](https://github.com/MoneroOcean/xmrig/wiki/Build). +* **[Binary releases](https://github.com/MoneroOcean/xmrig/releases)** +* **[Build from source](https://xmrig.com/docs/miner/build)** ## Usage -The preferred way to configure the miner is the [JSON config file](src/config.json) as it is more flexible and human friendly. The command line interface does not cover all features, such as mining profiles for different algorithms. Important options can be changed during runtime without miner restart by editing the config file or executing API calls. +The preferred way to configure the miner is the [JSON config file](src/config.json) as it is more flexible and human friendly. The [command line interface](https://xmrig.com/docs/miner/command-line-options) does not cover all features, such as mining profiles for different algorithms. Important options can be changed during runtime without miner restart by editing the config file or executing API calls. -* **[xmrig.com/wizard](https://xmrig.com/wizard)** helps you create initial configuration for the miner. -* **[workers.xmrig.info](http://workers.xmrig.info)** helps manage your miners via HTTP API. -* **[Command line options](https://xmrig.com/docs/miner/command-line-options)** +* **[Wizard](https://xmrig.com/wizard)** helps you create initial configuration for the miner. +* **[Workers](http://workers.xmrig.info)** helps manage your miners via HTTP API. ## Donations * Default donation 1% (1 minute in 100 minutes) can be increased via option `donate-level` or disabled in source code. * XMR: `48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD` -* BTC: `1P7ujsXeX7GxQwHNnJsRMgAdNkFZmNVqJT` + +## Developers +* **[xmrig](https://github.com/xmrig)** +* **[sech1](https://github.com/SChernykh)** ## Contacts * support@xmrig.com diff --git a/cmake/OpenSSL.cmake b/cmake/OpenSSL.cmake index 89805301..84f97d54 100644 --- a/cmake/OpenSSL.cmake +++ b/cmake/OpenSSL.cmake @@ -10,6 +10,11 @@ if (WITH_TLS) set(OPENSSL_USE_STATIC_LIBS TRUE) endif() + if (BUILD_STATIC) + set(OPENSSL_USE_STATIC_LIBS TRUE) + endif() + + find_package(OpenSSL) if (OPENSSL_FOUND) diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 7c2c79b8..5edad339 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -45,6 +45,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") endif() + if (BUILD_STATIC) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + endif() + add_definitions(/D_GNU_SOURCE) if (${CMAKE_VERSION} VERSION_LESS "3.1.0") @@ -92,6 +96,10 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) endif() endif() + if (BUILD_STATIC) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + endif() + endif() if (NOT WIN32) diff --git a/scripts/build.hwloc.sh b/scripts/build.hwloc.sh index 326b6640..1ca34731 100755 --- a/scripts/build.hwloc.sh +++ b/scripts/build.hwloc.sh @@ -8,12 +8,12 @@ mkdir -p deps/lib mkdir -p build && cd build -wget https://download.open-mpi.org/release/hwloc/v2.2/hwloc-${HWLOC_VERSION}.tar.bz2 -O hwloc-${HWLOC_VERSION}.tar.bz2 -tar -xjf hwloc-${HWLOC_VERSION}.tar.bz2 +wget https://download.open-mpi.org/release/hwloc/v2.2/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz +tar -xzf hwloc-${HWLOC_VERSION}.tar.gz cd hwloc-${HWLOC_VERSION} ./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2 -make -j$(nproc) -cp -fr include/ ../../deps +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps cp hwloc/.libs/libhwloc.a ../../deps/lib cd .. \ No newline at end of file diff --git a/scripts/build.hwloc1.sh b/scripts/build.hwloc1.sh new file mode 100755 index 00000000..f1afc285 --- /dev/null +++ b/scripts/build.hwloc1.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e + +HWLOC_VERSION="1.11.13" + +mkdir -p deps +mkdir -p deps/include +mkdir -p deps/lib + +mkdir -p build && cd build + +wget https://download.open-mpi.org/release/hwloc/v1.11/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz +tar -xzf hwloc-${HWLOC_VERSION}.tar.gz + +cd hwloc-${HWLOC_VERSION} +./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2 +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps +cp src/.libs/libhwloc.a ../../deps/lib +cd .. \ No newline at end of file diff --git a/scripts/build.libressl.sh b/scripts/build.libressl.sh index af7fe822..e7495233 100755 --- a/scripts/build.libressl.sh +++ b/scripts/build.libressl.sh @@ -13,8 +13,8 @@ tar -xzf libressl-${LIBRESSL_VERSION}.tar.gz cd libressl-${LIBRESSL_VERSION} ./configure --disable-shared -make -j$(nproc) -cp -fr include/ ../../deps +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps cp crypto/.libs/libcrypto.a ../../deps/lib cp ssl/.libs/libssl.a ../../deps/lib cd .. \ No newline at end of file diff --git a/scripts/build.openssl.sh b/scripts/build.openssl.sh index 5939eb57..5f9e5a71 100755 --- a/scripts/build.openssl.sh +++ b/scripts/build.openssl.sh @@ -13,8 +13,8 @@ tar -xzf openssl-${OPENSSL_VERSION}.tar.gz cd openssl-${OPENSSL_VERSION} ./config -no-shared -no-asm -no-zlib -no-comp -no-dgram -no-filenames -no-cms -make -j$(nproc) -cp -fr include/ ../../deps +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps cp libcrypto.a ../../deps/lib cp libssl.a ../../deps/lib cd .. \ No newline at end of file diff --git a/scripts/build.uv.sh b/scripts/build.uv.sh index 6f4c9796..8279da37 100755 --- a/scripts/build.uv.sh +++ b/scripts/build.uv.sh @@ -14,7 +14,7 @@ tar -xzf v${UV_VERSION}.tar.gz cd libuv-${UV_VERSION} sh autogen.sh ./configure --disable-shared -make -j$(nproc) -cp -fr include/ ../../deps +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps cp .libs/libuv.a ../../deps/lib cd .. \ No newline at end of file diff --git a/src/backend/cuda/CudaBackend.cpp b/src/backend/cuda/CudaBackend.cpp index a15ba810..ed23d4d3 100644 --- a/src/backend/cuda/CudaBackend.cpp +++ b/src/backend/cuda/CudaBackend.cpp @@ -152,7 +152,9 @@ public: } if (!CudaLib::init(cuda.loader())) { - return printDisabled(kLabel, RED_S " (failed to load CUDA plugin)"); + Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") RED_BOLD("disabled ") RED("(%s)"), kLabel, CudaLib::lastError()); + + return; } runtimeVersion = CudaLib::runtimeVersion(); diff --git a/src/backend/cuda/cuda.cmake b/src/backend/cuda/cuda.cmake index 75799cd8..6661ec83 100644 --- a/src/backend/cuda/cuda.cmake +++ b/src/backend/cuda/cuda.cmake @@ -1,3 +1,9 @@ +if (BUILD_STATIC AND XMRIG_OS_UNIX AND WITH_CUDA) + message(WARNING "CUDA backend is not compatible with static build, use -DWITH_CUDA=OFF to suppress this warning") + + set(WITH_CUDA OFF) +endif() + if (WITH_CUDA) add_definitions(/DXMRIG_FEATURE_CUDA) diff --git a/src/backend/cuda/wrappers/CudaLib.cpp b/src/backend/cuda/wrappers/CudaLib.cpp index 0829e0bb..db6b4e95 100644 --- a/src/backend/cuda/wrappers/CudaLib.cpp +++ b/src/backend/cuda/wrappers/CudaLib.cpp @@ -30,6 +30,7 @@ #include "backend/cuda/wrappers/CudaLib.h" #include "base/io/Env.h" #include "base/io/log/Log.h" +#include "base/kernel/Process.h" #include "crypto/rx/RxAlgo.h" @@ -46,6 +47,14 @@ enum Version : uint32_t static uv_lib_t cudaLib; +#if defined(__APPLE__) +static String defaultLoader = "/System/Library/Frameworks/OpenCL.framework/OpenCL"; +#elif defined(_WIN32) +static String defaultLoader = "xmrig-cuda.dll"; +#else +static String defaultLoader = "libxmrig-cuda.so"; +#endif + static const char *kAlloc = "alloc"; static const char *kAstroBWTHash = "astroBWTHash"; @@ -125,11 +134,12 @@ static setJob_v2_t pSetJob_v2 = nullptr; static version_t pVersion = nullptr; -#define DLSYM(x) if (uv_dlsym(&cudaLib, k##x, reinterpret_cast(&p##x)) == -1) { throw std::runtime_error("symbol not found (" #x ")"); } +#define DLSYM(x) if (uv_dlsym(&cudaLib, k##x, reinterpret_cast(&p##x)) == -1) { throw std::runtime_error(std::string("symbol not found: ") + k##x); } bool CudaLib::m_initialized = false; bool CudaLib::m_ready = false; +String CudaLib::m_error; String CudaLib::m_loader; @@ -139,9 +149,22 @@ String CudaLib::m_loader; bool xmrig::CudaLib::init(const char *fileName) { if (!m_initialized) { - m_loader = fileName == nullptr ? defaultLoader() : Env::expand(fileName); - m_ready = uv_dlopen(m_loader, &cudaLib) == 0 && load(); m_initialized = true; + m_loader = fileName == nullptr ? defaultLoader : Env::expand(fileName); + + if (!open()) { + return false; + } + + try { + load(); + } catch (std::exception &ex) { + m_error = (std::string(m_loader) + ": " + ex.what()).c_str(); + + return false; + } + + m_ready = true; } return m_ready; @@ -150,7 +173,7 @@ bool xmrig::CudaLib::init(const char *fileName) const char *xmrig::CudaLib::lastError() noexcept { - return uv_dlerror(&cudaLib); + return m_error; } @@ -344,66 +367,70 @@ void xmrig::CudaLib::release(nvid_ctx *ctx) noexcept } -bool xmrig::CudaLib::load() +bool xmrig::CudaLib::open() { - if (uv_dlsym(&cudaLib, kVersion, reinterpret_cast(&pVersion)) == -1) { + m_error = nullptr; + + if (uv_dlopen(m_loader, &cudaLib) == 0) { + return true; + } + +# ifdef XMRIG_OS_LINUX + if (m_loader == defaultLoader) { + m_loader = Process::location(Process::ExeLocation, m_loader); + } + else { return false; } + if (uv_dlopen(m_loader, &cudaLib) == 0) { + return true; + } +# endif + + m_error = uv_dlerror(&cudaLib); + + return false; +} + + +void xmrig::CudaLib::load() +{ + DLSYM(Version); + if (pVersion(ApiVersion) != 3U) { - return false; + throw std::runtime_error("API version mismatch"); } - uv_dlsym(&cudaLib, kDeviceInfo_v2, reinterpret_cast(&pDeviceInfo_v2)); - uv_dlsym(&cudaLib, kSetJob_v2, reinterpret_cast(&pSetJob_v2)); + DLSYM(Alloc); + DLSYM(CnHash); + DLSYM(DeviceCount); + DLSYM(DeviceInit); + DLSYM(DeviceInt); + DLSYM(DeviceName); + DLSYM(DeviceUint); + DLSYM(DeviceUlong); + DLSYM(Init); + DLSYM(LastError); + DLSYM(PluginVersion); + DLSYM(Release); + DLSYM(RxHash); + DLSYM(RxPrepare); + DLSYM(AstroBWTHash); + DLSYM(AstroBWTPrepare); + DLSYM(KawPowHash); + DLSYM(KawPowPrepare_v2); + DLSYM(KawPowStopHash); - try { - DLSYM(Alloc); - DLSYM(CnHash); - DLSYM(DeviceCount); - DLSYM(DeviceInit); - DLSYM(DeviceInt); - DLSYM(DeviceName); - DLSYM(DeviceUint); - DLSYM(DeviceUlong); - DLSYM(Init); - DLSYM(LastError); - DLSYM(PluginVersion); - DLSYM(Release); - DLSYM(RxHash); - DLSYM(RxPrepare); - DLSYM(AstroBWTHash); - DLSYM(AstroBWTPrepare); - DLSYM(KawPowHash); - DLSYM(KawPowPrepare_v2); - DLSYM(KawPowStopHash); - DLSYM(Version); + uv_dlsym(&cudaLib, kDeviceInfo_v2, reinterpret_cast(&pDeviceInfo_v2)); + if (!pDeviceInfo_v2) { + DLSYM(DeviceInfo); + } - if (!pDeviceInfo_v2) { - DLSYM(DeviceInfo); - } - - if (!pSetJob_v2) { - DLSYM(SetJob); - } - } catch (std::exception &ex) { - LOG_ERR("Error loading CUDA library: %s", ex.what()); - return false; + uv_dlsym(&cudaLib, kSetJob_v2, reinterpret_cast(&pSetJob_v2)); + if (!pSetJob_v2) { + DLSYM(SetJob); } pInit(); - - return true; -} - - -xmrig::String xmrig::CudaLib::defaultLoader() -{ -# if defined(__APPLE__) - return "/System/Library/Frameworks/OpenCL.framework/OpenCL"; // FIXME -# elif defined(_WIN32) - return "xmrig-cuda.dll"; -# else - return "libxmrig-cuda.so"; -# endif } diff --git a/src/backend/cuda/wrappers/CudaLib.h b/src/backend/cuda/wrappers/CudaLib.h index c058ffd5..d7b776d2 100644 --- a/src/backend/cuda/wrappers/CudaLib.h +++ b/src/backend/cuda/wrappers/CudaLib.h @@ -99,11 +99,12 @@ public: static void release(nvid_ctx *ctx) noexcept; private: - static bool load(); - static String defaultLoader(); + static bool open(); + static void load(); static bool m_initialized; static bool m_ready; + static String m_error; static String m_loader; }; diff --git a/src/backend/opencl/opencl.cmake b/src/backend/opencl/opencl.cmake index 9e970df9..d42383fa 100644 --- a/src/backend/opencl/opencl.cmake +++ b/src/backend/opencl/opencl.cmake @@ -1,3 +1,9 @@ +if (BUILD_STATIC AND XMRIG_OS_UNIX AND WITH_OPENCL) + message(WARNING "OpenCL backend is not compatible with static build, use -DWITH_OPENCL=OFF to suppress this warning") + + set(WITH_OPENCL OFF) +endif() + if (WITH_OPENCL) add_definitions(/DCL_TARGET_OPENCL_VERSION=200) add_definitions(/DCL_USE_DEPRECATED_OPENCL_1_2_APIS) diff --git a/src/backend/opencl/wrappers/OclLib.cpp b/src/backend/opencl/wrappers/OclLib.cpp index b5b12c62..158ef13e 100644 --- a/src/backend/opencl/wrappers/OclLib.cpp +++ b/src/backend/opencl/wrappers/OclLib.cpp @@ -44,7 +44,7 @@ static uv_lib_t oclLib; -static const char *kErrorTemplate = MAGENTA_BG_BOLD(WHITE_BOLD_S " ocl ") RED(" error ") RED_BOLD("%s") RED(" when calling ") RED_BOLD("%s"); +static const char *kErrorTemplate = MAGENTA_BG_BOLD(WHITE_BOLD_S " opencl ") RED(" error ") RED_BOLD("%s") RED(" when calling ") RED_BOLD("%s"); static const char *kBuildProgram = "clBuildProgram"; static const char *kCreateBuffer = "clCreateBuffer"; diff --git a/src/base/io/log/Log.h b/src/base/io/log/Log.h index ca53960d..6327a7ad 100644 --- a/src/base/io/log/Log.h +++ b/src/base/io/log/Log.h @@ -81,7 +81,13 @@ private: #define CLEAR CSI "0m" // all attributes off #define BRIGHT_BLACK_S CSI "0;90m" // somewhat MD.GRAY #define BLACK_S CSI "0;30m" -#define BLACK_BOLD_S CSI "1;30m" // another name for GRAY + +#ifdef XMRIG_OS_APPLE +# define BLACK_BOLD_S CSI "0;37m" +#else +# define BLACK_BOLD_S CSI "1;30m" // another name for GRAY +#endif + #define RED_S CSI "0;31m" #define RED_BOLD_S CSI "1;31m" #define GREEN_S CSI "0;32m" diff --git a/src/base/kernel/Entry.cpp b/src/base/kernel/Entry.cpp index ae2ac3ce..a50cb634 100644 --- a/src/base/kernel/Entry.cpp +++ b/src/base/kernel/Entry.cpp @@ -84,7 +84,7 @@ static int showVersion() # if defined(LIBRESSL_VERSION_TEXT) printf("LibreSSL/%s\n", LIBRESSL_VERSION_TEXT + 9); # elif defined(OPENSSL_VERSION_TEXT) - constexpr const char *v = OPENSSL_VERSION_TEXT + 8; + constexpr const char *v = &OPENSSL_VERSION_TEXT[8]; printf("OpenSSL/%.*s\n", static_cast(strchr(v, ' ') - v), v); # endif } diff --git a/src/base/kernel/config/BaseConfig.cpp b/src/base/kernel/config/BaseConfig.cpp index 129c2d66..cb0e4f90 100644 --- a/src/base/kernel/config/BaseConfig.cpp +++ b/src/base/kernel/config/BaseConfig.cpp @@ -176,7 +176,7 @@ void xmrig::BaseConfig::printVersions() snprintf(buf, sizeof buf, "LibreSSL/%s ", LIBRESSL_VERSION_TEXT + 9); libs += buf; # elif defined(OPENSSL_VERSION_TEXT) - constexpr const char *v = OPENSSL_VERSION_TEXT + 8; + constexpr const char *v = &OPENSSL_VERSION_TEXT[8]; snprintf(buf, sizeof buf, "OpenSSL/%.*s ", static_cast(strchr(v, ' ') - v), v); libs += buf; # endif diff --git a/src/base/net/http/HttpListener.h b/src/base/net/http/HttpListener.h index ac302dab..4f982c4d 100644 --- a/src/base/net/http/HttpListener.h +++ b/src/base/net/http/HttpListener.h @@ -29,13 +29,20 @@ namespace xmrig { class HttpListener : public IHttpListener { public: - inline HttpListener(IHttpListener *listener, const char *tag = nullptr) : m_tag(tag), m_listener(listener) {} + inline HttpListener(IHttpListener *listener, const char *tag = nullptr) : +# ifdef APP_DEBUG + m_tag(tag), +# endif + m_listener(listener) + {} protected: void onHttpData(const HttpData &data) override; private: +# ifdef APP_DEBUG const char *m_tag; +# endif IHttpListener *m_listener; }; diff --git a/src/base/net/stratum/Job.h b/src/base/net/stratum/Job.h index ea52be74..8341439a 100644 --- a/src/base/net/stratum/Job.h +++ b/src/base/net/stratum/Job.h @@ -65,7 +65,7 @@ public: void setDiff(uint64_t diff); inline bool isNicehash() const { return m_nicehash; } - inline bool isValid() const { return m_size > 0 && m_diff > 0; } + inline bool isValid() const { return (m_size > 0 && m_diff > 0) || !m_poolWallet.isEmpty(); } inline bool setId(const char *id) { return m_id = id; } inline const Algorithm &algorithm() const { return m_algorithm; } inline const Buffer &seed() const { return m_seed; } diff --git a/src/crypto/kawpow/KPCache.cpp b/src/crypto/kawpow/KPCache.cpp index f4634102..2a60a787 100644 --- a/src/crypto/kawpow/KPCache.cpp +++ b/src/crypto/kawpow/KPCache.cpp @@ -91,7 +91,7 @@ bool KPCache::init(uint32_t epoch) const uint32_t a = (cache_nodes * i) / n; const uint32_t b = (cache_nodes * (i + 1)) / n; - threads.emplace_back([this, a, b, cache_nodes, &cache]() { + threads.emplace_back([this, a, b, &cache]() { uint32_t j = a; for (; j + 4 <= b; j += 4) ethash_calculate_dag_item4_opt(((node*)m_DAGCache.data()) + j, j, num_dataset_parents, &cache); for (; j < b; ++j) ethash_calculate_dag_item_opt(((node*)m_DAGCache.data()) + j, j, num_dataset_parents, &cache); diff --git a/src/crypto/randomx/randomx.cpp b/src/crypto/randomx/randomx.cpp index 7dcab7e8..b62d6202 100644 --- a/src/crypto/randomx/randomx.cpp +++ b/src/crypto/randomx/randomx.cpp @@ -235,7 +235,9 @@ RandomX_ConfigurationBase::RandomX_ConfigurationBase() # endif } +#ifdef XMRIG_ARMv8 static uint32_t Log2(size_t value) { return (value > 1) ? (Log2(value / 2) + 1) : 0; } +#endif void RandomX_ConfigurationBase::Apply() { diff --git a/src/crypto/rx/RxNUMAStorage.cpp b/src/crypto/rx/RxNUMAStorage.cpp index 09a0fd37..4b4ab4d6 100644 --- a/src/crypto/rx/RxNUMAStorage.cpp +++ b/src/crypto/rx/RxNUMAStorage.cpp @@ -164,7 +164,7 @@ public: return true; } - for (const auto kv : m_datasets) { + for (const auto &kv : m_datasets) { if (kv.second->isOneGbPages()) { return false; } diff --git a/src/version.h b/src/version.h index 369d98d5..c209fd49 100644 --- a/src/version.h +++ b/src/version.h @@ -28,7 +28,7 @@ #define APP_ID "xmrig" #define APP_NAME "XMRig" #define APP_DESC "XMRig miner" -#define APP_VERSION "6.3.2-mo1" +#define APP_VERSION "6.3.3-mo1" #define APP_DOMAIN "xmrig.com" #define APP_SITE "www.xmrig.com" #define APP_COPYRIGHT "Copyright (C) 2016-2020 xmrig.com" @@ -36,7 +36,7 @@ #define APP_VER_MAJOR 6 #define APP_VER_MINOR 3 -#define APP_VER_PATCH 2 +#define APP_VER_PATCH 3 #ifdef _MSC_VER # if (_MSC_VER >= 1920)