diff mbox series

[3/9] arm/trusted-services: fix MbedTLS build issue

Message ID 20240423163205.5885-3-gyorgy.szing@arm.com
State New
Headers show
Series [1/9] arm/trusted-services: Update FFA TEE driver to v2.0.0 | expand

Commit Message

Gyorgy Szing April 23, 2024, 4:31 p.m. UTC
From: Gyorgy Szing <Gyorgy.Szing@arm.com>

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 <Gyorgy.Szing@arm.com>
---
 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 mbox series

Patch

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