mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-06-05 02:20:30 +00:00
arm-bsp/psa-arch-tests: corstone1000: build the test applications
This commit adds support for building/installing the test application. Also fixing CMake issues on the current trusted-service CMake source files. Change-Id: Iae0fc9bf9362cf5b7d65cd7b9f0445f62f3b83eb Signed-off-by: Emekcan Aras <emekcan.aras@arm.com> Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
This commit is contained in:
committed by
Ross Burton
parent
d93f7c31c4
commit
49edcfc12d
@@ -0,0 +1,43 @@
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/psa-arch-tests/corstone1000:"
|
||||
|
||||
DEPENDS += "cmake-native"
|
||||
|
||||
export CMAKE_BUILD_PARALLEL_LEVEL
|
||||
CMAKE_BUILD_PARALLEL_LEVEL = "${@oe.utils.parallel_make(d, True)}"
|
||||
|
||||
COMPATIBLE_MACHINE = "corstone1000"
|
||||
|
||||
SRC_URI:append = "\
|
||||
file://0001-psa-arch-test-sysroot_compiler_flags_fix.patch \
|
||||
"
|
||||
|
||||
FILES:${PN} += "${libdir}/libts.so* ${libdir}/deployments ${bindir}/psa-*"
|
||||
FILES:${PN}-dev = "${includedir}/deployments/psa-api-test/"
|
||||
|
||||
INSANE_SKIP:${PN} += "rpaths"
|
||||
|
||||
do_configure() {
|
||||
for PSA_API_TEST in ${PSA_API_TESTS}; do
|
||||
cmake \
|
||||
-DSYSROOT_YOCTO=${RECIPE_SYSROOT} \
|
||||
-S ${S}/$PSA_API_TEST -B "${B}/$PSA_API_TEST"
|
||||
done
|
||||
}
|
||||
|
||||
do_compile() {
|
||||
for PSA_API_TEST in ${PSA_API_TESTS}; do
|
||||
cmake --build "${B}/$PSA_API_TEST"
|
||||
done
|
||||
}
|
||||
|
||||
do_install() {
|
||||
for PSA_API_TEST in ${PSA_API_TESTS}; do
|
||||
install -d -m 0755 ${D}${libdir}/${PSA_API_TEST}
|
||||
install -d -m 0755 ${D}${includedir}/${PSA_API_TEST}
|
||||
install -m 0755 ${B}/${PSA_API_TEST}/libts_install/arm-linux/lib/*.so* ${D}${libdir}
|
||||
install -d -m 0755 ${B}/${PSA_API_TEST}/libts_install/arm-linux/include ${D}${includedir}/${PSA_API_TEST}
|
||||
psafile_fullpath=`ls ${B}/${PSA_API_TEST}/psa-*`
|
||||
psafile_filename="`basename -s .bin ${psafile_fullpath}`"
|
||||
install -D -p -m 0755 ${psafile_fullpath} ${D}/${bindir}/${psafile_filename}
|
||||
done
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
Upstream-Status: Inappropriate [Not for upstreaming in the original repo]
|
||||
Signed-off-by: Emekcan Aras <Emekcan.Aras@arm.com>
|
||||
|
||||
From 340ef6788d2803543b15235bf16a79cbc02235bd Mon Sep 17 00:00:00 2001
|
||||
From: Emekcan Aras <Emekcan.Aras@arm.com>
|
||||
Date: Mon, 6 Dec 2021 10:21:59 +0000
|
||||
|
||||
[PATCH] arm-bsp/psa-arch-test: Integrate psa-arch-test
|
||||
|
||||
Signed-off-by: Emekcan Aras <emekcan.aras@arm.com>
|
||||
---
|
||||
deployments/libts/libts-import.cmake | 4 +++-
|
||||
external/MbedTLS/MbedTLS.cmake | 1 +
|
||||
external/psa_arch_tests/psa_arch_tests.cmake | 1 +
|
||||
3 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/deployments/libts/libts-import.cmake b/deployments/libts/libts-import.cmake
|
||||
index 792ba86..e3793e8 100644
|
||||
--- a/deployments/libts/libts-import.cmake
|
||||
+++ b/deployments/libts/libts-import.cmake
|
||||
@@ -19,7 +19,6 @@ if(NOT DEFINED PROCESSOR_COUNT)
|
||||
ProcessorCount(PROCESSOR_COUNT)
|
||||
set(PROCESSOR_COUNT ${PROCESSOR_COUNT} CACHE STRING "Number of cores to use for parallel builds.")
|
||||
endif()
|
||||
-
|
||||
set(LIBTS_INSTALL_PATH "${CMAKE_CURRENT_BINARY_DIR}/libts_install" CACHE PATH "libts installation directory")
|
||||
set(LIBTS_PACKAGE_PATH "${LIBTS_INSTALL_PATH}/lib/cmake" CACHE PATH "libts CMake package directory")
|
||||
set(LIBTS_SOURCE_DIR "${TS_ROOT}/deployments/libts/${TS_ENV}" CACHE PATH "libts source directory")
|
||||
@@ -27,9 +26,12 @@ set(LIBTS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/_deps/libts-build" CACHE PATH
|
||||
|
||||
file(MAKE_DIRECTORY ${LIBTS_BINARY_DIR})
|
||||
|
||||
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${SYSROOT_YOCTO}")
|
||||
+
|
||||
#Configure the library
|
||||
execute_process(COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
+ -DCMAKE_SYSROOT=${SYSROOT_YOCTO}
|
||||
-DCMAKE_INSTALL_PREFIX=${LIBTS_INSTALL_PATH}
|
||||
-GUnix\ Makefiles
|
||||
${LIBTS_SOURCE_DIR}
|
||||
diff --git a/external/MbedTLS/MbedTLS.cmake b/external/MbedTLS/MbedTLS.cmake
|
||||
index 3cbaed1..8c53f88 100644
|
||||
--- a/external/MbedTLS/MbedTLS.cmake
|
||||
+++ b/external/MbedTLS/MbedTLS.cmake
|
||||
@@ -59,6 +59,7 @@ set(PSA_CRYPTO_API_INCLUDE "${MBEDTLS_INSTALL_PATH}/include" CACHE STRING "PSA C
|
||||
#Configure the library
|
||||
execute_process(COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
+ -DCMAKE_SYSROOT=${SYSROOT_YOCTO}
|
||||
-DENABLE_PROGRAMS=OFF
|
||||
-DENABLE_TESTING=OFF
|
||||
-DUNSAFE_BUILD=ON
|
||||
diff --git a/external/psa_arch_tests/psa_arch_tests.cmake b/external/psa_arch_tests/psa_arch_tests.cmake
|
||||
index e6ab73f..af00cfc 100644
|
||||
--- a/external/psa_arch_tests/psa_arch_tests.cmake
|
||||
+++ b/external/psa_arch_tests/psa_arch_tests.cmake
|
||||
@@ -52,6 +52,7 @@ string(REPLACE ";" " " PSA_ARCH_TEST_EXTERNAL_DEFS "${PSA_ARCH_TEST_EXTERNAL_DEF
|
||||
# Configure the psa-arch-test library
|
||||
execute_process(COMMAND
|
||||
${CMAKE_COMMAND}
|
||||
+ -DCMAKE_SYSROOT=${SYSROOT_YOCTO}
|
||||
-DTOOLCHAIN=INHERIT
|
||||
-DCMAKE_TOOLCHAIN_FILE=${TS_EXTERNAL_LIB_TOOLCHAIN_FILE}
|
||||
-DPSA_INCLUDE_PATHS=${PSA_ARCH_TESTS_EXTERNAL_INCLUDE_PATHS}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
# Machine specific configurations
|
||||
|
||||
MACHINE_PSA_REQUIRE ?= ""
|
||||
MACHINE_PSA_REQUIRE:corstone1000 = "psa-arch-tests-corstone1000.inc"
|
||||
|
||||
require ${MACHINE_PSA_REQUIRE}
|
||||
Reference in New Issue
Block a user