From 7f30d19df1f5fef12639b909ffb1482fbbcce40d Mon Sep 17 00:00:00 2001 From: Gyorgy Szing Date: Tue, 23 Apr 2024 18:31:59 +0200 Subject: [PATCH] arm/trusted-services: fix MbedTLS build issue MbedTLS fails to build when FORTIFY_SOURCE is enabled and the NWd configuration is used. Disable the compilation option temporary till the root cause can be fund and a proper fix be made. The build only fails when building from yocto. The OP-TEE integration works fine with gcc v13.2_rel1. Signed-off-by: Gyorgy Szing Signed-off-by: Jon Mason --- meta-arm/recipes-security/trusted-services/ts-demo_git.bb | 4 ++++ .../trusted-services/ts-psa-iat-api-test_git.bb | 3 +++ 2 files changed, 7 insertions(+) diff --git a/meta-arm/recipes-security/trusted-services/ts-demo_git.bb b/meta-arm/recipes-security/trusted-services/ts-demo_git.bb index 668bde56..a17c1720 100644 --- a/meta-arm/recipes-security/trusted-services/ts-demo_git.bb +++ b/meta-arm/recipes-security/trusted-services/ts-demo_git.bb @@ -18,6 +18,10 @@ TOOLCHAIN = "gcc" FILES:${PN} = "${bindir}/ts-demo" +# TODO: remove FORTIFY_SOURCE as MbedTLS fails to build in yocto if this +# compilation flag is used. +lcl_maybe_fortify = "${@oe.utils.conditional('OPTLEVEL','-O0','','${OPTLEVEL}',d)}" + do_install:append () { install -d ${D}${bindir} mv ${D}${TS_INSTALL}/bin/ts-demo ${D}${bindir} diff --git a/meta-arm/recipes-security/trusted-services/ts-psa-iat-api-test_git.bb b/meta-arm/recipes-security/trusted-services/ts-psa-iat-api-test_git.bb index e5c662e4..c39554a6 100644 --- a/meta-arm/recipes-security/trusted-services/ts-psa-iat-api-test_git.bb +++ b/meta-arm/recipes-security/trusted-services/ts-psa-iat-api-test_git.bb @@ -16,6 +16,9 @@ SRCREV_psaqcbor = "42272e466a8472948bf8fca076d113b81b99f0e0" EXTRA_OECMAKE += "-DPSA_TARGET_QCBOR=${WORKDIR}/git/psaqcbor \ " +# TODO: remove FORTIFY_SOURCE as MbedTLS fails to build in yocto if this +# compilation flag is used. +lcl_maybe_fortify = "${@oe.utils.conditional('OPTLEVEL','-O0','','${OPTLEVEL}',d)}" # Mbedtls 3.1.0 does not compile with clang. # This can be removed after TS updated required mbedtls version