From c039d1601f7b643fd6ffc9054d7c22f58362b40b Mon Sep 17 00:00:00 2001 From: Rui Miguel Silva Date: Tue, 6 Sep 2022 17:45:38 +0100 Subject: [PATCH] arm-bsp: trusted-services: fix openamp build With the latest gcc, there were some unresolved symbols on opemamp linkage, add the implementation of that symbol for the outline of atomics. Signed-off-by: Rui Miguel Silva Signed-off-by: Jon Mason --- ...mic-outline-to-fix-build-for-opemamp.patch | 44 +++++++++++++++++++ .../trusted-services/ts-corstone1000.inc | 1 + 2 files changed, 45 insertions(+) create mode 100644 meta-arm-bsp/recipes-security/trusted-services/secure-partitions/corstone1000/0049-Add-atomic-outline-to-fix-build-for-opemamp.patch diff --git a/meta-arm-bsp/recipes-security/trusted-services/secure-partitions/corstone1000/0049-Add-atomic-outline-to-fix-build-for-opemamp.patch b/meta-arm-bsp/recipes-security/trusted-services/secure-partitions/corstone1000/0049-Add-atomic-outline-to-fix-build-for-opemamp.patch new file mode 100644 index 00000000..649b9678 --- /dev/null +++ b/meta-arm-bsp/recipes-security/trusted-services/secure-partitions/corstone1000/0049-Add-atomic-outline-to-fix-build-for-opemamp.patch @@ -0,0 +1,44 @@ +From 0d8394ee5c52e97e82ebe4641cf0d9ebcbe147ff Mon Sep 17 00:00:00 2001 +From: Rui Miguel Silva +Date: Tue, 6 Sep 2022 16:47:06 +0100 +Subject: [PATCH] Add atomic outline to fix build for opemamp + +Add memory model 5 atomic ouline support (_sync) to fix +missing symbol when compiling with recent gcc (12.2). + +Signed-off-by: Rui Miguel Silva + +Upstream-Status: Pending [Not submitted to upstream yet] +Signed-off-by: Rui Miguel Silva +--- + deployments/se-proxy/opteesp/lse.S | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/deployments/se-proxy/opteesp/lse.S b/deployments/se-proxy/opteesp/lse.S +index 840683a6671a..8e466d65fc2b 100644 +--- a/deployments/se-proxy/opteesp/lse.S ++++ b/deployments/se-proxy/opteesp/lse.S +@@ -5,6 +5,7 @@ + + .text + .globl __aarch64_cas4_acq_rel ++.globl __aarch64_cas4_sync + + __aarch64_cas4_acq_rel: + mov w16, w0 +@@ -16,4 +17,12 @@ __aarch64_cas4_acq_rel: + cbnz w17, 0b + 1: ret + ++__aarch64_cas4_sync: ++ mov w16, w0 ++ ldxr w0, [x2] ++ cmp w0, w16 ++0: bne 1f + ++ stlxr w17, w1, [x2] ++ cbnz w17, 0b ++1: ret +-- +2.37.3 + diff --git a/meta-arm-bsp/recipes-security/trusted-services/ts-corstone1000.inc b/meta-arm-bsp/recipes-security/trusted-services/ts-corstone1000.inc index b04863fc..9d1c3272 100644 --- a/meta-arm-bsp/recipes-security/trusted-services/ts-corstone1000.inc +++ b/meta-arm-bsp/recipes-security/trusted-services/ts-corstone1000.inc @@ -60,6 +60,7 @@ SRC_URI:append = " \ file://0047-Fixes-in-AEAD-for-psa-arch-test-54-and-58.patch \ file://0003-corstone1000-port-crypto-config.patch;patchdir=../psa-arch-tests \ file://0048-Fix-UEFI-get_variable-with-small-buffer.patch \ + file://0049-Add-atomic-outline-to-fix-build-for-opemamp.patch \ " SRC_URI_MBEDTLS = "git://github.com/ARMmbed/mbedtls.git;protocol=https;branch=development;name=mbedtls;destsuffix=git/mbedtls"