From 489aa7eb59f30213da11073920c76a4475afb9b1 Mon Sep 17 00:00:00 2001 From: Michael Baentsch <57787676+baentsch@users.noreply.github.com> Date: Wed, 7 Sep 2022 19:21:27 +0200 Subject: [PATCH] ARM32 gcc12 build workaround (#1297) * add ARM32 gcc compile option workaround * add no-ipa-modref only in gcc11 and higher --- .CMake/compiler_opts.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.CMake/compiler_opts.cmake b/.CMake/compiler_opts.cmake index 7acf88c89..20a07debf 100644 --- a/.CMake/compiler_opts.cmake +++ b/.CMake/compiler_opts.cmake @@ -169,6 +169,12 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU") endif () endif() + # workaround for gcc issues on ARM32 as per https://github.com/open-quantum-safe/liboqs/issues/1288 + if(ARCH_ARM32v7 AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0.0")) + add_compile_options(-fno-ipa-modref) + add_compile_options(-fno-ipa-pure-const) + endif() + elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # Warning C4146 is raised when a unary minus operator is applied to an # unsigned type; this has nonetheless been standard and portable for as