diff --git a/src/backend/cpu/platform/HwlocCpuInfo.cpp b/src/backend/cpu/platform/HwlocCpuInfo.cpp index 98f559890..23ee554f3 100644 --- a/src/backend/cpu/platform/HwlocCpuInfo.cpp +++ b/src/backend/cpu/platform/HwlocCpuInfo.cpp @@ -32,6 +32,12 @@ #include +#if HWLOC_API_VERSION < 0x00010b00 +# define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET +# define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE +#endif + + #include "backend/cpu/platform/HwlocCpuInfo.h" #include "base/io/log/Log.h" @@ -152,7 +158,17 @@ xmrig::HwlocCpuInfo::HwlocCpuInfo() : BasicCpuInfo(), # endif hwloc_obj_t root = hwloc_get_root_obj(m_topology); - snprintf(m_backend, sizeof m_backend, "hwloc/%s", hwloc_obj_get_info_by_name(root, "hwlocVersion")); + +# if HWLOC_API_VERSION >= 0x00010b00 + const char *version = hwloc_obj_get_info_by_name(root, "hwlocVersion"); + if (version) { + snprintf(m_backend, sizeof m_backend, "hwloc/%s", version); + } + else +# endif + { + snprintf(m_backend, sizeof m_backend, "hwloc"); + } findCache(root, 2, 3, [this](hwloc_obj_t found) { this->m_cache[found->attr->cache.depth] += found->attr->cache.size; }); diff --git a/src/crypto/common/VirtualMemory.cpp b/src/crypto/common/VirtualMemory.cpp index e3c70dfbf..5f7c45512 100644 --- a/src/crypto/common/VirtualMemory.cpp +++ b/src/crypto/common/VirtualMemory.cpp @@ -28,6 +28,10 @@ #ifdef XMRIG_FEATURE_HWLOC # include # include "backend/cpu/platform/HwlocCpuInfo.h" +# +# if HWLOC_API_VERSION < 0x00010b00 +# define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE +# endif #endif