From 8bbc9b2c5762cd22b5a51218d3515556f93d7b89 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 15 Jan 2024 17:36:57 -0600 Subject: [PATCH] Fix build with old ARM headers and opt-out of fast AES on RISC-V for now --- app/streaming/streamutils.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/streaming/streamutils.cpp b/app/streaming/streamutils.cpp index eb89fd42..e620730c 100644 --- a/app/streaming/streamutils.cpp +++ b/app/streaming/streamutils.cpp @@ -12,6 +12,10 @@ #ifdef Q_OS_LINUX #include + +#ifndef HWCAP2_AES +#define HWCAP2_AES (1 << 0) +#endif #endif Uint32 StreamUtils::getPlatformWindowFlags() @@ -126,6 +130,10 @@ bool StreamUtils::hasFastAes() return getauxval(AT_HWCAP2) & HWCAP2_AES; #elif defined(Q_OS_LINUX) && defined(Q_PROCESSOR_ARM) && QT_POINTER_SIZE == 8 return getauxval(AT_HWCAP) & HWCAP_AES; +#elif defined(Q_PROCESSOR_RISCV) + // TODO: Implement detection of RISC-V vector crypto extension when possible. + // At the time of writing, no RISC-V hardware has it, so hardcode it off. + return false; #elif QT_POINTER_SIZE == 4 #warning Unknown 32-bit platform. Assuming AES is slow on this CPU. return false;