Merge pull request #10617 from ronald-cron-arm/tf-psa-crypto-reorg-prep

Prepare for TF-PSA-Crypto repository reorganization
This commit is contained in:
Valerio Setti
2026-03-09 11:49:28 +00:00
committed by GitHub
12 changed files with 178 additions and 44 deletions

View File

@@ -373,6 +373,20 @@ foreach(target IN LISTS tf_psa_crypto_library_targets)
endif() endif()
endforeach(target) endforeach(target)
#
# TF-PSA-Crypto directories with internal headers that are currently still
# consumed by Mbed TLS. When we have finished cleaning up this list should be
# empty.
#
set(TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/core
${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/dispatch
${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/drivers/builtin/src
${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/extras
${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/platform
${CMAKE_CURRENT_SOURCE_DIR}/tf-psa-crypto/utilities
)
add_subdirectory(library) add_subdirectory(library)
add_subdirectory(pkgconfig) add_subdirectory(pkgconfig)
@@ -416,16 +430,16 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
endif() endif()
target_include_directories(mbedtls_test target_include_directories(mbedtls_test
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tests/include PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tests/include
PRIVATE ${MBEDTLS_FRAMEWORK_DIR}/tests/include ${MBEDTLS_FRAMEWORK_DIR}/tests/include
PRIVATE tests/include tests/include
PRIVATE include include
PRIVATE tf-psa-crypto/include tf-psa-crypto/include
PRIVATE tf-psa-crypto/drivers/builtin/include tf-psa-crypto/drivers/builtin/include
PRIVATE tf-psa-crypto/drivers/everest/include tf-psa-crypto/drivers/everest/include
PRIVATE tf-psa-crypto/drivers/pqcp/include tf-psa-crypto/drivers/pqcp/include
PRIVATE library library
PRIVATE tf-psa-crypto/core ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS}
PRIVATE tf-psa-crypto/drivers/builtin/src) )
# Request C11, needed for memory poisoning tests # Request C11, needed for memory poisoning tests
set_target_properties(mbedtls_test PROPERTIES C_STANDARD 11) set_target_properties(mbedtls_test PROPERTIES C_STANDARD 11)
set_config_files_compile_definitions(mbedtls_test) set_config_files_compile_definitions(mbedtls_test)
@@ -453,16 +467,15 @@ if(ENABLE_TESTING OR ENABLE_PROGRAMS)
endif() endif()
target_include_directories(mbedtls_test_helpers target_include_directories(mbedtls_test_helpers
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tests/include PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/tests/include
PRIVATE ${MBEDTLS_FRAMEWORK_DIR}/tests/include ${MBEDTLS_FRAMEWORK_DIR}/tests/include
PRIVATE tests/include tests/include
PRIVATE include include
PRIVATE tf-psa-crypto/include tf-psa-crypto/include
PRIVATE tf-psa-crypto/drivers/builtin/include tf-psa-crypto/drivers/builtin/include
PRIVATE library library
PRIVATE tf-psa-crypto/core tf-psa-crypto/drivers/everest/include
PRIVATE tf-psa-crypto/drivers/builtin/src tf-psa-crypto/drivers/pqcp/include
PRIVATE tf-psa-crypto/drivers/everest/include ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS}
PRIVATE tf-psa-crypto/drivers/pqcp/include
) )
set_config_files_compile_definitions(mbedtls_test_helpers) set_config_files_compile_definitions(mbedtls_test_helpers)

View File

@@ -236,15 +236,14 @@ foreach(target IN LISTS target_libraries)
add_library(MbedTLS::${target} ALIAS ${target}) # add_subdirectory support add_library(MbedTLS::${target} ALIAS ${target}) # add_subdirectory support
# Include public header files from /include, /tf-psa-crypto/include/ and # Include public header files from /include, /tf-psa-crypto/include/ and
# tf-psa-crypto/drivers/builtin/include/. Include private header files # tf-psa-crypto/drivers/builtin/include/. Include private header files
# from /library, tf-psa-crypto/core/ and tf-psa-crypto/drivers/builtin/src/. # from /library and ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS}.
target_include_directories(${target} target_include_directories(${target}
PUBLIC $<BUILD_INTERFACE:${MBEDTLS_DIR}/include/> PUBLIC $<BUILD_INTERFACE:${MBEDTLS_DIR}/include/>
$<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/include/> $<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/include/>
$<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/include/> $<BUILD_INTERFACE:${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/include/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${MBEDTLS_DIR}/library/ PRIVATE ${MBEDTLS_DIR}/library/
${MBEDTLS_DIR}/tf-psa-crypto/core ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS}
${MBEDTLS_DIR}/tf-psa-crypto/drivers/builtin/src
# needed for generated headers # needed for generated headers
${CMAKE_CURRENT_BINARY_DIR}) ${CMAKE_CURRENT_BINARY_DIR})
set_config_files_compile_definitions(${target}) set_config_files_compile_definitions(${target})

View File

@@ -199,7 +199,7 @@ endif
test/metatest$(EXEXT): $(FRAMEWORK)/tests/programs/metatest.c $(DEP) test/metatest$(EXEXT): $(FRAMEWORK)/tests/programs/metatest.c $(DEP)
echo " CC $(FRAMEWORK)/tests/programs/metatest.c" echo " CC $(FRAMEWORK)/tests/programs/metatest.c"
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I../library -I../tf-psa-crypto/core -I../tf-psa-crypto/drivers/builtin/include -I../tf-psa-crypto/drivers/builtin/src $(FRAMEWORK)/tests/programs/metatest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -I../library -I../tf-psa-crypto/core -I../tf-psa-crypto/drivers/builtin/src -I../tf-psa-crypto/platform $(FRAMEWORK)/tests/programs/metatest.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@
test/query_config.o: test/query_config.c $(FRAMEWORK)/tests/programs/query_config.h $(DEP) test/query_config.o: test/query_config.c $(FRAMEWORK)/tests/programs/query_config.h $(DEP)
echo " CC test/query_config.c" echo " CC test/query_config.c"

View File

@@ -103,9 +103,9 @@ foreach(exe IN LISTS executables)
endforeach() endforeach()
target_include_directories(metatest target_include_directories(metatest
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/drivers/builtin/include PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/drivers/builtin/src
${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/drivers/builtin/src) ${CMAKE_CURRENT_SOURCE_DIR}/../../tf-psa-crypto/platform
)
install(TARGETS ${executables} install(TARGETS ${executables}
DESTINATION "bin" DESTINATION "bin"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

View File

@@ -180,6 +180,10 @@ C_SOURCE_FILES = $(wildcard \
tf-psa-crypto/drivers/*/*/*.c \ tf-psa-crypto/drivers/*/*/*.c \
tf-psa-crypto/drivers/*/*/*/*.c \ tf-psa-crypto/drivers/*/*/*/*.c \
tf-psa-crypto/drivers/*/*/*/*/*.c \ tf-psa-crypto/drivers/*/*/*/*/*.c \
tf-psa-crypto/dispatch/*.[hc] \
tf-psa-crypto/extras/*.[hc] \
tf-psa-crypto/platform/*.[hc] \
tf-psa-crypto/utilities/*.[hc] \
programs/*/*.[hc] \ programs/*/*.[hc] \
framework/tests/include/*/*.h framework/tests/include/*/*/*.h \ framework/tests/include/*/*.h framework/tests/include/*/*/*.h \
framework/tests/src/*.c framework/tests/src/*/*.c \ framework/tests/src/*.c framework/tests/src/*/*.c \
@@ -200,5 +204,9 @@ cscope.in.out cscope.po.out cscope.out: $(C_SOURCE_FILES)
cscope -bq -u -Iinclude -Ilibrary -Itf-psa-crypto/core \ cscope -bq -u -Iinclude -Ilibrary -Itf-psa-crypto/core \
-Itf-psa-crypto/include \ -Itf-psa-crypto/include \
-Itf-psa-crypto/drivers/builtin/src \ -Itf-psa-crypto/drivers/builtin/src \
-Itf-psa-crypto/dispatch \
-Itf-psa-crypto/extras \
-Itf-psa-crypto/platform \
-Itf-psa-crypto/utilities \
$(patsubst %,-I%,$(wildcard tf-psa-crypto/drivers/*/include)) -Iframework/tests/include $(C_SOURCE_FILES) $(patsubst %,-I%,$(wildcard tf-psa-crypto/drivers/*/include)) -Iframework/tests/include $(C_SOURCE_FILES)
.PHONY: cscope global .PHONY: cscope global

View File

@@ -177,11 +177,11 @@ function(add_test_suite suite_name)
# them as PUBLIC. # them as PUBLIC.
target_include_directories(test_suite_${data_name} target_include_directories(test_suite_${data_name}
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../framework/tests/include ${PROJECT_SOURCE_DIR}/framework/tests/include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../library ${PROJECT_SOURCE_DIR}/library
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../tf-psa-crypto/core ${TF_PSA_CRYPTO_PRIVATE_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../tf-psa-crypto/drivers/builtin/src) )
# Request C11, which is needed for memory poisoning tests # Request C11, which is needed for memory poisoning tests
set_target_properties(test_suite_${data_name} PROPERTIES C_STANDARD 11) set_target_properties(test_suite_${data_name} PROPERTIES C_STANDARD 11)

View File

@@ -252,7 +252,19 @@ libtestdriver1.a:
cp -Rf ../scripts ./libtestdriver1 cp -Rf ../scripts ./libtestdriver1
cp -Rf ../tf-psa-crypto/core ./libtestdriver1/tf-psa-crypto cp -Rf ../tf-psa-crypto/core ./libtestdriver1/tf-psa-crypto
cp -Rf ../tf-psa-crypto/include ./libtestdriver1/tf-psa-crypto cp -Rf ../tf-psa-crypto/include ./libtestdriver1/tf-psa-crypto
cp -Rf ../tf-psa-crypto/drivers/builtin ./libtestdriver1/tf-psa-crypto/drivers cp -Rf ../tf-psa-crypto/drivers/builtin ./libtestdriver1/tf-psa-crypto/drivers/builtin
if [ -d ../tf-psa-crypto/dispatch ]; then \
cp -Rf ../tf-psa-crypto/dispatch ./libtestdriver1/tf-psa-crypto/dispatch; \
fi
if [ -d ../tf-psa-crypto/extras ]; then \
cp -Rf ../tf-psa-crypto/extras ./libtestdriver1/tf-psa-crypto/extras; \
fi
if [ -d ../tf-psa-crypto/platform ]; then \
cp -Rf ../tf-psa-crypto/platform ./libtestdriver1/tf-psa-crypto/platform; \
fi
if [ -d ../tf-psa-crypto/utilities ]; then \
cp -Rf ../tf-psa-crypto/utilities ./libtestdriver1/tf-psa-crypto/utilities; \
fi
cp -Rf ../tf-psa-crypto/scripts ./libtestdriver1/tf-psa-crypto cp -Rf ../tf-psa-crypto/scripts ./libtestdriver1/tf-psa-crypto
# Set the test driver base (minimal) configuration. # Set the test driver base (minimal) configuration.
@@ -285,7 +297,18 @@ libtestdriver1.a:
perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/include/*/*.h perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/include/*/*.h
perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/include/*/*/*.h perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/include/*/*/*.h
perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/src/*.[ch] perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/drivers/builtin/src/*.[ch]
if [ -d ../tf-psa-crypto/dispatch ]; then \
perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/dispatch/*.[ch]; \
fi
if [ -d ../tf-psa-crypto/extras ]; then \
perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/extras/*.[ch]; \
fi
if [ -d ../tf-psa-crypto/platform ]; then \
perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/platform/*.[ch]; \
fi
if [ -d ../tf-psa-crypto/utilities ]; then \
perl -i ./scripts/libtestdriver1_rewrite.pl ./libtestdriver1/tf-psa-crypto/utilities/*.[ch]; \
fi
$(MAKE) -C ./libtestdriver1/library CFLAGS="-I../../ $(CFLAGS)" LDFLAGS="$(LDFLAGS)" libmbedcrypto.a $(MAKE) -C ./libtestdriver1/library CFLAGS="-I../../ $(CFLAGS)" LDFLAGS="$(LDFLAGS)" libmbedcrypto.a
cp ./libtestdriver1/library/libmbedcrypto.a ../library/libtestdriver1.a cp ./libtestdriver1/library/libmbedcrypto.a ../library/libtestdriver1.a

View File

@@ -12,8 +12,6 @@
component_check_recursion () { component_check_recursion () {
msg "Check: recursion.pl" # < 1s msg "Check: recursion.pl" # < 1s
./framework/scripts/recursion.pl library/*.c ./framework/scripts/recursion.pl library/*.c
./framework/scripts/recursion.pl ${PSA_CORE_PATH}/*.c
./framework/scripts/recursion.pl ${BUILTIN_SRC_PATH}/*.c
} }
component_check_generated_files () { component_check_generated_files () {

View File

@@ -10,6 +10,7 @@
################################################################ ################################################################
CMAKE_BUILTIN_BUILD_DIR="tf-psa-crypto/drivers/builtin/CMakeFiles/builtin.dir/src" CMAKE_BUILTIN_BUILD_DIR="tf-psa-crypto/drivers/builtin/CMakeFiles/builtin.dir/src"
CMAKE_EXTRAS_BUILD_DIR="tf-psa-crypto/extras/CMakeFiles/extras.dir"
component_test_psa_crypto_key_id_encodes_owner () { component_test_psa_crypto_key_id_encodes_owner () {
msg "build: full config + PSA_CRYPTO_KEY_ID_ENCODES_OWNER, cmake, gcc, ASan" msg "build: full config + PSA_CRYPTO_KEY_ID_ENCODES_OWNER, cmake, gcc, ASan"
@@ -280,8 +281,13 @@ component_full_no_pkparse_pkwrite () {
cmake --build . cmake --build .
# Ensure that PK_[PARSE|WRITE]_C were not re-enabled accidentally (additive config). # Ensure that PK_[PARSE|WRITE]_C were not re-enabled accidentally (additive config).
not grep mbedtls_pk_parse_key ${CMAKE_BUILTIN_BUILD_DIR}/pkparse.c.o if [ -f ${TF_PSA_CRYPTO_ROOT_DIR}/extras/pkparse.c ]; then
not grep mbedtls_pk_write_key_der ${CMAKE_BUILTIN_BUILD_DIR}/pkwrite.c.o not grep mbedtls_pk_parse_key ${CMAKE_EXTRAS_BUILD_DIR}/pkparse.c.o
not grep mbedtls_pk_write_key_der ${CMAKE_EXTRAS_BUILD_DIR}/pkwrite.c.o
else
not grep mbedtls_pk_parse_key ${CMAKE_BUILTIN_BUILD_DIR}/pkparse.c.o
not grep mbedtls_pk_write_key_der ${CMAKE_BUILTIN_BUILD_DIR}/pkwrite.c.o
fi
msg "test: full without pkparse and pkwrite" msg "test: full without pkparse and pkwrite"
ctest ctest
@@ -302,7 +308,11 @@ component_full_no_pkwrite () {
make make
# Ensure that PK_WRITE_C was not re-enabled accidentally (additive config). # Ensure that PK_WRITE_C was not re-enabled accidentally (additive config).
not grep mbedtls_pk_write_key_der ${CMAKE_BUILTIN_BUILD_DIR}/pkwrite.c.o if [ -f ${TF_PSA_CRYPTO_ROOT_DIR}/extras/pkwrite.c ]; then
not grep mbedtls_pk_write_key_der ${CMAKE_EXTRAS_BUILD_DIR}/pkwrite.c.o
else
not grep mbedtls_pk_write_key_der ${CMAKE_BUILTIN_BUILD_DIR}/pkwrite.c.o
fi
msg "test: full without pkwrite" msg "test: full without pkwrite"
make test make test
@@ -329,8 +339,13 @@ component_test_crypto_full_md_light_only () {
cmake --build . cmake --build .
# Make sure we don't have the HMAC functions, but the hashing functions # Make sure we don't have the HMAC functions, but the hashing functions
not grep mbedtls_md_hmac ${CMAKE_BUILTIN_BUILD_DIR}/md.c.o if [ -f ${TF_PSA_CRYPTO_ROOT_DIR}/extras/md.c ]; then
grep mbedtls_md ${CMAKE_BUILTIN_BUILD_DIR}/md.c.o not grep mbedtls_md_hmac ${CMAKE_EXTRAS_BUILD_DIR}/md.c.o
grep mbedtls_md ${CMAKE_EXTRAS_BUILD_DIR}/md.c.o
else
not grep mbedtls_md_hmac ${CMAKE_BUILTIN_BUILD_DIR}/md.c.o
grep mbedtls_md ${CMAKE_BUILTIN_BUILD_DIR}/md.c.o
fi
msg "test: crypto_full with only the light subset of MD" msg "test: crypto_full with only the light subset of MD"
ctest ctest
@@ -1668,7 +1683,11 @@ component_test_psa_crypto_config_accel_hmac () {
helper_libtestdriver1_make_main "$loc_accel_list" helper_libtestdriver1_make_main "$loc_accel_list"
# Ensure that built-in support for HMAC is disabled. # Ensure that built-in support for HMAC is disabled.
not grep mbedtls_md_hmac ${BUILTIN_SRC_PATH}/md.o if [ -f ${TF_PSA_CRYPTO_ROOT_DIR}/extras/md.c ]; then
not grep mbedtls_md_hmac ${TF_PSA_CRYPTO_ROOT_DIR}/extras/md.o
else
not grep mbedtls_md_hmac ${BUILTIN_SRC_PATH}/md.o
fi
# Run the tests # Run the tests
# ------------- # -------------

View File

@@ -439,6 +439,18 @@ component_build_arm_none_eabi_gcc () {
${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o
${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o
${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o
fi
} }
component_build_arm_linux_gnueabi_gcc_arm5vte () { component_build_arm_linux_gnueabi_gcc_arm5vte () {
@@ -455,6 +467,18 @@ component_build_arm_linux_gnueabi_gcc_arm5vte () {
${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t library/*.o ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t library/*.o
${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o
${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o ${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then
${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then
${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then
${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then
${ARM_LINUX_GNUEABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o
fi
} }
support_build_arm_linux_gnueabi_gcc_arm5vte () { support_build_arm_linux_gnueabi_gcc_arm5vte () {
@@ -473,6 +497,18 @@ component_build_arm_none_eabi_gcc_arm5vte () {
${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o
${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o
${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o
fi
} }
component_build_arm_none_eabi_gcc_m0plus () { component_build_arm_none_eabi_gcc_m0plus () {
@@ -484,6 +520,18 @@ component_build_arm_none_eabi_gcc_m0plus () {
${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t library/*.o
${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${PSA_CORE_PATH}/*.o
${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o ${ARM_NONE_EABI_GCC_PREFIX}size -t ${BUILTIN_SRC_PATH}/*.o
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then
${ARM_NONE_EABI_GCC_PREFIX}size -t ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o
fi
for lib in library/*.a; do for lib in library/*.a; do
echo "$lib:" echo "$lib:"
${ARM_NONE_EABI_GCC_PREFIX}size -t $lib | grep TOTALS ${ARM_NONE_EABI_GCC_PREFIX}size -t $lib | grep TOTALS
@@ -499,6 +547,18 @@ component_build_arm_none_eabi_gcc_no_udbl_division () {
not grep __aeabi_uldiv library/*.o not grep __aeabi_uldiv library/*.o
not grep __aeabi_uldiv ${PSA_CORE_PATH}/*.o not grep __aeabi_uldiv ${PSA_CORE_PATH}/*.o
not grep __aeabi_uldiv ${BUILTIN_SRC_PATH}/*.o not grep __aeabi_uldiv ${BUILTIN_SRC_PATH}/*.o
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then
not grep __aeabi_uldiv ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then
not grep __aeabi_uldiv ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then
not grep __aeabi_uldiv ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then
not grep __aeabi_uldiv ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o
fi
} }
component_build_arm_none_eabi_gcc_no_64bit_multiplication () { component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
@@ -510,6 +570,18 @@ component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
not grep __aeabi_lmul library/*.o not grep __aeabi_lmul library/*.o
not grep __aeabi_lmul ${PSA_CORE_PATH}/*.o not grep __aeabi_lmul ${PSA_CORE_PATH}/*.o
not grep __aeabi_lmul ${BUILTIN_SRC_PATH}/*.o not grep __aeabi_lmul ${BUILTIN_SRC_PATH}/*.o
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o" > /dev/null; then
not grep __aeabi_lmul ${TF_PSA_CRYPTO_ROOT_DIR}/dispatch/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o" > /dev/null; then
not grep __aeabi_lmul ${TF_PSA_CRYPTO_ROOT_DIR}/extras/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o" > /dev/null; then
not grep __aeabi_lmul ${TF_PSA_CRYPTO_ROOT_DIR}/platform/*.o
fi
if compgen -G "${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o" > /dev/null; then
not grep __aeabi_lmul ${TF_PSA_CRYPTO_ROOT_DIR}/utilities/*.o
fi
} }
component_build_arm_clang_thumb () { component_build_arm_clang_thumb () {

View File

@@ -37,7 +37,9 @@ def main():
"include/mbedtls/*_internal.h", "include/mbedtls/*_internal.h",
"library/*.h", "library/*.h",
"tf-psa-crypto/core/*.h", "tf-psa-crypto/core/*.h",
"tf-psa-crypto/drivers/builtin/src/*.h" "tf-psa-crypto/drivers/builtin/src/*.h",
"tf-psa-crypto/platform/*.h",
"tf-psa-crypto/utilities/*.h",
])[0] ])[0]
result.sort(key=lambda x: x.name) result.sort(key=lambda x: x.name)