Added missing symbols, change fix for double def

pull/561/head
Daniele Lacamera 2025-03-27 18:21:25 +01:00
parent cb9d1b0b28
commit 068f1acfc9
3 changed files with 72 additions and 85 deletions

View File

@ -128,8 +128,6 @@ add_option(
add_option("DEBUG_UART" "Enable trace debugging over a UART (default: disabled)" "no" "yes;no") add_option("DEBUG_UART" "Enable trace debugging over a UART (default: disabled)" "no" "yes;no")
add_option("BUILD_TEST_APPS" "Build the wolfBoot image and test apps (default: disabled)" "no" "yes;no") add_option("BUILD_TEST_APPS" "Build the wolfBoot image and test apps (default: disabled)" "no" "yes;no")
add_option("BUILD_IMAGE" "Build the wolfBoot image (default: disabled)" "no" "yes;no") add_option("BUILD_IMAGE" "Build the wolfBoot image (default: disabled)" "no" "yes;no")
add_option("PYTHON_KEYTOOLS" "Use wolfCrypt-py for key generation and signing (default: disabled)"
"no" "yes;no")
add_option( add_option(
"PULL_LINKER_DEFINES" "PULL_LINKER_DEFINES"
"Pull partition addresses from the linker script instead of defining fixed addresses in target.h (default: disabled)" "Pull partition addresses from the linker script instead of defining fixed addresses in target.h (default: disabled)"
@ -633,15 +631,9 @@ target_compile_definitions(wolfboothal PRIVATE ${WOLFBOOT_DEFS})
target_include_directories(wolfboothal PRIVATE ${WOLFBOOT_ROOT} include) target_include_directories(wolfboothal PRIVATE ${WOLFBOOT_ROOT} include)
target_compile_options(wolfboothal PRIVATE ${WOLFBOOT_COMPILE_OPTIONS} ${EXTRA_COMPILE_OPTIONS}) target_compile_options(wolfboothal PRIVATE ${WOLFBOOT_COMPILE_OPTIONS} ${EXTRA_COMPILE_OPTIONS})
if(PYTHON_KEYTOOLS)
message(STATUS "Using Python Keytools")
set(SIGN_TOOL ${WOLFBOOT_ROOT}/tools/keytools/sign.py)
set(KEYGEN_TOOL ${WOLFBOOT_ROOT}/tools/keytools/keygen.py)
else()
message(STATUS "Using C Keytools") message(STATUS "Using C Keytools")
set(SIGN_TOOL ${CMAKE_CURRENT_BINARY_DIR}/sign) set(SIGN_TOOL ${CMAKE_CURRENT_BINARY_DIR}/sign)
set(KEYGEN_TOOL ${CMAKE_CURRENT_BINARY_DIR}/keygen) set(KEYGEN_TOOL ${CMAKE_CURRENT_BINARY_DIR}/keygen)
endif()
list(APPEND WOLFBOOT_INCLUDE_DIRS ${WOLFBOOT_ROOT} ${WOLFBOOT_ROOT}/include) list(APPEND WOLFBOOT_INCLUDE_DIRS ${WOLFBOOT_ROOT} ${WOLFBOOT_ROOT}/include)
@ -711,7 +703,6 @@ target_include_directories(target BEFORE INTERFACE ${CMAKE_CURRENT_BINARY_DIR})
set(KEYSTORE ${CMAKE_CURRENT_BINARY_DIR}/keystore.c) set(KEYSTORE ${CMAKE_CURRENT_BINARY_DIR}/keystore.c)
if(NOT PYTHON_KEYTOOLS)
list( list(
APPEND APPEND
KEYTOOL_SOURCES KEYTOOL_SOURCES
@ -740,7 +731,13 @@ if(NOT PYTHON_KEYTOOLS)
lib/wolfssl/wolfcrypt/src/sha512.c lib/wolfssl/wolfcrypt/src/sha512.c
lib/wolfssl/wolfcrypt/src/tfm.c lib/wolfssl/wolfcrypt/src/tfm.c
lib/wolfssl/wolfcrypt/src/wc_port.c lib/wolfssl/wolfcrypt/src/wc_port.c
lib/wolfssl/wolfcrypt/src/wolfmath.c) lib/wolfssl/wolfcrypt/src/wolfmath.c
lib/wolfssl/wolfcrypt/src/dilithium.c
lib/wolfssl/wolfcrypt/src/wc_lms.c
lib/wolfssl/wolfcrypt/src/wc_lms_impl.c
lib/wolfssl/wolfcrypt/src/wc_xmss.c
lib/wolfssl/wolfcrypt/src/wc_xmss_impl.c
)
list( list(
APPEND APPEND
@ -753,7 +750,6 @@ if(NOT PYTHON_KEYTOOLS)
-Ilib/wolfssl/ -Ilib/wolfssl/
-Iinclude -Iinclude
-I${CMAKE_CURRENT_BINARY_DIR} -I${CMAKE_CURRENT_BINARY_DIR}
-DWOLFBOOT_KEYTOOLS
-O2 -O2
-DIMAGE_HEADER_SIZE=${IMAGE_HEADER_SIZE} -DIMAGE_HEADER_SIZE=${IMAGE_HEADER_SIZE}
-DDELTA_UPDATES) -DDELTA_UPDATES)
@ -773,14 +769,9 @@ if(NOT PYTHON_KEYTOOLS)
COMMENT "Building keygen tool") COMMENT "Building keygen tool")
add_custom_target(keytools ALL DEPENDS ${SIGN_TOOL} ${KEYGEN_TOOL}) add_custom_target(keytools ALL DEPENDS ${SIGN_TOOL} ${KEYGEN_TOOL})
endif()
if(NOT SIGN STREQUAL "NONE") if(NOT SIGN STREQUAL "NONE")
if(PYTHON_KEYTOOLS)
add_custom_target(keystore DEPENDS ${KEYSTORE})
else()
add_custom_target(keystore DEPENDS ${SIGN_TOOL} ${KEYGEN_TOOL} ${KEYSTORE}) add_custom_target(keystore DEPENDS ${SIGN_TOOL} ${KEYGEN_TOOL} ${KEYSTORE})
endif()
# generate keystore if it does not already exist # generate keystore if it does not already exist
if(NOT EXISTS ${KEYSTORE}) if(NOT EXISTS ${KEYSTORE})
@ -791,13 +782,11 @@ if(NOT SIGN STREQUAL "NONE")
WORKING_DIRECTORY ${WOLFBOOT_ROOT} WORKING_DIRECTORY ${WOLFBOOT_ROOT}
COMMENT "Generating keystore.c and signing private key") COMMENT "Generating keystore.c and signing private key")
if(NOT PYTHON_KEYTOOLS)
add_custom_command( add_custom_command(
OUTPUT ${KEYSTORE} ${WOLFBOOT_SIGNING_PRIVATE_KEY} OUTPUT ${KEYSTORE} ${WOLFBOOT_SIGNING_PRIVATE_KEY}
DEPENDS ${KEYGEN_TOOL} DEPENDS ${KEYGEN_TOOL}
APPEND) APPEND)
endif() endif()
endif()
add_library(public_key) add_library(public_key)
target_sources(public_key PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/keystore.c) target_sources(public_key PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/keystore.c)

View File

@ -120,7 +120,7 @@ if(BUILD_TEST_APPS)
target_compile_definitions(image PRIVATE TARGET_${WOLFBOOT_TARGET} target_compile_definitions(image PRIVATE TARGET_${WOLFBOOT_TARGET}
${TEST_APP_COMPILE_DEFINITIONS} ${WOLFBOOT_DEFS}) ${TEST_APP_COMPILE_DEFINITIONS} ${WOLFBOOT_DEFS})
target_compile_options(image PRIVATE -Wall -Wstack-usage=1024 -ffreestanding -Wno-unused target_compile_options(image PRIVATE -Wall -Wstack-usage=1024 -ffreestanding -Wno-unused -nostartfiles -fomit-frame-pointer
-nostartfiles) -nostartfiles)
if(WOLFBOOT_TARGET STREQUAL "sim") if(WOLFBOOT_TARGET STREQUAL "sim")

View File

@ -29,9 +29,7 @@
#include <stdint.h> #include <stdint.h>
/* System */ /* System */
#ifndef WOLFBOOT_KEYTOOLS
#define WOLFBOOT_KEYTOOLS #define WOLFBOOT_KEYTOOLS
#endif
#define SINGLE_THREADED #define SINGLE_THREADED
#define WOLFCRYPT_ONLY #define WOLFCRYPT_ONLY