diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d2a454e6..68efd8ce2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,6 +127,12 @@ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "s390x") endif() elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv") set(ARCH "riscv") +elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "loongarch64") + set(ARCH "loongarch64") + set(ARCH_LOONGARCH64 ON) + if(${OQS_DIST_BUILD}) + set(OQS_DIST_LOONGARCH64_BUILD ON) + endif() elseif(OQS_PERMIT_UNSUPPORTED_ARCHITECTURE) message(WARNING "Unknown or unsupported processor: " ${CMAKE_SYSTEM_PROCESSOR}) message(WARNING "Compilation on an unsupported processor should only be used for testing, as it may result an insecure configuration, for example due to variable-time instructions leaking secret information.") diff --git a/src/common/common.c b/src/common/common.c index cb70d558c..795f3f97c 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -206,6 +206,11 @@ static void set_available_cpu_extensions(void) { /* mark that this function has been called */ cpu_ext_data[OQS_CPU_EXT_INIT] = 1; } +#elif defined(OQS_DIST_LOONGARCH64_BUILD) +static void set_available_cpu_extensions(void) { + /* mark that this function has been called */ + cpu_ext_data[OQS_CPU_EXT_INIT] = 1; +} #elif defined(OQS_DIST_BUILD) static void set_available_cpu_extensions(void) { }