From 34633828d7351cf979bbb7aa75fede3db047251a Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sat, 7 Mar 2026 17:41:32 +0100 Subject: [PATCH] Fix MLKEM build. Signed-off-by: Pol Henarejos --- config/esp32/components/mlkem1024/CMakeLists.txt | 1 + config/esp32/components/mlkem512/CMakeLists.txt | 1 + config/esp32/components/mlkem768/CMakeLists.txt | 1 + pico_keys_sdk_import.cmake | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/esp32/components/mlkem1024/CMakeLists.txt b/config/esp32/components/mlkem1024/CMakeLists.txt index 22033d4..6b55f71 100644 --- a/config/esp32/components/mlkem1024/CMakeLists.txt +++ b/config/esp32/components/mlkem1024/CMakeLists.txt @@ -9,6 +9,7 @@ idf_component_register( SRCS ${MLKEM_SOURCES} INCLUDE_DIRS ${MLKEM_DIR} ) +idf_component_set_property(${COMPONENT_NAME} WHOLE_ARCHIVE ON) target_compile_definitions(${COMPONENT_LIB} PRIVATE MLK_CONFIG_PARAMETER_SET=1024 diff --git a/config/esp32/components/mlkem512/CMakeLists.txt b/config/esp32/components/mlkem512/CMakeLists.txt index 65357c5..0370721 100644 --- a/config/esp32/components/mlkem512/CMakeLists.txt +++ b/config/esp32/components/mlkem512/CMakeLists.txt @@ -9,6 +9,7 @@ idf_component_register( SRCS ${MLKEM_SOURCES} INCLUDE_DIRS ${MLKEM_DIR} ) +idf_component_set_property(${COMPONENT_NAME} WHOLE_ARCHIVE ON) target_compile_definitions(${COMPONENT_LIB} PRIVATE MLK_CONFIG_PARAMETER_SET=512 diff --git a/config/esp32/components/mlkem768/CMakeLists.txt b/config/esp32/components/mlkem768/CMakeLists.txt index 0085303..66bb36e 100644 --- a/config/esp32/components/mlkem768/CMakeLists.txt +++ b/config/esp32/components/mlkem768/CMakeLists.txt @@ -9,6 +9,7 @@ idf_component_register( SRCS ${MLKEM_SOURCES} INCLUDE_DIRS ${MLKEM_DIR} ) +idf_component_set_property(${COMPONENT_NAME} WHOLE_ARCHIVE ON) target_compile_definitions(${COMPONENT_LIB} PRIVATE MLK_CONFIG_PARAMETER_SET=768 diff --git a/pico_keys_sdk_import.cmake b/pico_keys_sdk_import.cmake index efec0b3..05f2929 100644 --- a/pico_keys_sdk_import.cmake +++ b/pico_keys_sdk_import.cmake @@ -444,9 +444,9 @@ endif() if(ENABLE_PQC) list(APPEND LIBRARIES - mlkem512 mlkem768 mlkem1024 + mlkem512 ) endif()