From 098146145f6f085a6a91201b8ca47257c3872f40 Mon Sep 17 00:00:00 2001 From: Michael <57787676+baentsch@users.noreply.github.com> Date: Mon, 29 Nov 2021 12:03:20 +0100 Subject: [PATCH 1/4] add downlevel compiler warning --- .CMake/alg_support.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.CMake/alg_support.cmake b/.CMake/alg_support.cmake index 5406895f26..68297dca04 100644 --- a/.CMake/alg_support.cmake +++ b/.CMake/alg_support.cmake @@ -182,6 +182,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_512_aarch64 "" ON "OQS_ENABLE_KEM_kyber_512" OFF) +else() + message(WARNING " ARM optimizations not active due to backlevel compiler") endif() endif() endif() @@ -197,6 +199,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_768_aarch64 "" ON "OQS_ENABLE_KEM_kyber_768" OFF) +else() + message(WARNING " ARM optimizations not active due to backlevel compiler") endif() endif() endif() @@ -212,6 +216,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_1024_aarch64 "" ON "OQS_ENABLE_KEM_kyber_1024" OFF) +else() + message(WARNING " ARM optimizations not active due to backlevel compiler") endif() endif() endif() @@ -340,6 +346,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_lightsaber_aarch64 "" ON "OQS_ENABLE_KEM_saber_lightsaber" OFF) +else() + message(WARNING " ARM optimizations not active due to backlevel compiler") endif() endif() endif() @@ -355,6 +363,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_saber_aarch64 "" ON "OQS_ENABLE_KEM_saber_saber" OFF) +else() + message(WARNING " ARM optimizations not active due to backlevel compiler") endif() endif() endif() @@ -370,6 +380,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin") if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_firesaber_aarch64 "" ON "OQS_ENABLE_KEM_saber_firesaber" OFF) +else() + message(WARNING " ARM optimizations not active due to backlevel compiler") endif() endif() endif() From 5971340b0f199dac836e66a74c419de74d2978bf Mon Sep 17 00:00:00 2001 From: Michael <57787676+baentsch@users.noreply.github.com> Date: Mon, 29 Nov 2021 17:06:23 +0100 Subject: [PATCH 2/4] correct warning message --- .CMake/alg_support.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.CMake/alg_support.cmake b/.CMake/alg_support.cmake index 68297dca04..1740ec5d04 100644 --- a/.CMake/alg_support.cmake +++ b/.CMake/alg_support.cmake @@ -183,7 +183,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_512_aarch64 "" ON "OQS_ENABLE_KEM_kyber_512" OFF) else() - message(WARNING " ARM optimizations not active due to backlevel compiler") + message(WARNING " ARM optimizations not active due to downlevel compiler") endif() endif() endif() @@ -200,7 +200,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_768_aarch64 "" ON "OQS_ENABLE_KEM_kyber_768" OFF) else() - message(WARNING " ARM optimizations not active due to backlevel compiler") + message(WARNING " ARM optimizations not active due to downlevel compiler") endif() endif() endif() @@ -217,7 +217,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_1024_aarch64 "" ON "OQS_ENABLE_KEM_kyber_1024" OFF) else() - message(WARNING " ARM optimizations not active due to backlevel compiler") + message(WARNING " ARM optimizations not active due to downlevel compiler") endif() endif() endif() @@ -347,7 +347,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_lightsaber_aarch64 "" ON "OQS_ENABLE_KEM_saber_lightsaber" OFF) else() - message(WARNING " ARM optimizations not active due to backlevel compiler") + message(WARNING " ARM optimizations not active due to downlevel compiler") endif() endif() endif() @@ -364,7 +364,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_saber_aarch64 "" ON "OQS_ENABLE_KEM_saber_saber" OFF) else() - message(WARNING " ARM optimizations not active due to backlevel compiler") + message(WARNING " ARM optimizations not active due to downlevel compiler") endif() endif() endif() @@ -381,7 +381,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_firesaber_aarch64 "" ON "OQS_ENABLE_KEM_saber_firesaber" OFF) else() - message(WARNING " ARM optimizations not active due to backlevel compiler") + message(WARNING " ARM optimizations not active due to downlevel compiler") endif() endif() endif() From aa6c4df037351fea11381eecbb5aac0997ca7406 Mon Sep 17 00:00:00 2001 From: Michael <57787676+baentsch@users.noreply.github.com> Date: Mon, 29 Nov 2021 17:12:26 +0100 Subject: [PATCH 3/4] warning added to code generator script --- .../.CMake/alg_support.cmake/add_enable_by_alg.fragment | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/copy_from_upstream/.CMake/alg_support.cmake/add_enable_by_alg.fragment b/scripts/copy_from_upstream/.CMake/alg_support.cmake/add_enable_by_alg.fragment index a90de13787..52dc4a72fc 100644 --- a/scripts/copy_from_upstream/.CMake/alg_support.cmake/add_enable_by_alg.fragment +++ b/scripts/copy_from_upstream/.CMake/alg_support.cmake/add_enable_by_alg.fragment @@ -21,6 +21,8 @@ if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_G {%- endif %} cmake_dependent_option(OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['scheme'] }}_{{ impl['name'] }} "" ON "OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['scheme'] }}" OFF) {% if impl['upstream']['name'] == 'pqclean' -%} +else() + message(WARNING " ARM optimizations not active due to downlevel compiler") endif() {%- endif %} endif() From 0b8092321334a2c1aa36ec622181696d84276131 Mon Sep 17 00:00:00 2001 From: Michael <57787676+baentsch@users.noreply.github.com> Date: Tue, 30 Nov 2021 07:11:20 +0100 Subject: [PATCH 4/4] implement PR feedback --- .CMake/alg_support.cmake | 12 ++++++------ .../alg_support.cmake/add_enable_by_alg.fragment | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.CMake/alg_support.cmake b/.CMake/alg_support.cmake index 1740ec5d04..7c4e50d3c1 100644 --- a/.CMake/alg_support.cmake +++ b/.CMake/alg_support.cmake @@ -183,7 +183,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_512_aarch64 "" ON "OQS_ENABLE_KEM_kyber_512" OFF) else() - message(WARNING " ARM optimizations not active due to downlevel compiler") + message(WARNING " ARM optimizations are not fully supported on this compiler version.") endif() endif() endif() @@ -200,7 +200,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_768_aarch64 "" ON "OQS_ENABLE_KEM_kyber_768" OFF) else() - message(WARNING " ARM optimizations not active due to downlevel compiler") + message(WARNING " ARM optimizations are not fully supported on this compiler version.") endif() endif() endif() @@ -217,7 +217,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_kyber_1024_aarch64 "" ON "OQS_ENABLE_KEM_kyber_1024" OFF) else() - message(WARNING " ARM optimizations not active due to downlevel compiler") + message(WARNING " ARM optimizations are not fully supported on this compiler version.") endif() endif() endif() @@ -347,7 +347,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_lightsaber_aarch64 "" ON "OQS_ENABLE_KEM_saber_lightsaber" OFF) else() - message(WARNING " ARM optimizations not active due to downlevel compiler") + message(WARNING " ARM optimizations are not fully supported on this compiler version.") endif() endif() endif() @@ -364,7 +364,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_saber_aarch64 "" ON "OQS_ENABLE_KEM_saber_saber" OFF) else() - message(WARNING " ARM optimizations not active due to downlevel compiler") + message(WARNING " ARM optimizations are not fully supported on this compiler version.") endif() endif() endif() @@ -381,7 +381,7 @@ if((OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS))) if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "9.4.0")) OR ((NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU")) AND (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")))) cmake_dependent_option(OQS_ENABLE_KEM_saber_firesaber_aarch64 "" ON "OQS_ENABLE_KEM_saber_firesaber" OFF) else() - message(WARNING " ARM optimizations not active due to downlevel compiler") + message(WARNING " ARM optimizations are not fully supported on this compiler version.") endif() endif() endif() diff --git a/scripts/copy_from_upstream/.CMake/alg_support.cmake/add_enable_by_alg.fragment b/scripts/copy_from_upstream/.CMake/alg_support.cmake/add_enable_by_alg.fragment index 52dc4a72fc..83664aa3c4 100644 --- a/scripts/copy_from_upstream/.CMake/alg_support.cmake/add_enable_by_alg.fragment +++ b/scripts/copy_from_upstream/.CMake/alg_support.cmake/add_enable_by_alg.fragment @@ -22,7 +22,7 @@ if(((CMAKE_C_COMPILER_ID STREQUAL "GNU") AND (CMAKE_C_COMPILER_VERSION VERSION_G cmake_dependent_option(OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['scheme'] }}_{{ impl['name'] }} "" ON "OQS_ENABLE_KEM_{{ family['name'] }}_{{ scheme['scheme'] }}" OFF) {% if impl['upstream']['name'] == 'pqclean' -%} else() - message(WARNING " ARM optimizations not active due to downlevel compiler") + message(WARNING " ARM optimizations are not fully supported on this compiler version.") endif() {%- endif %} endif()