From b107b8a524eafc89999eb2dc1d1385635e92630c Mon Sep 17 00:00:00 2001
From: Avinash Mehta <avinash.mehta@arm.com>
Date: Thu, 29 Jul 2021 12:57:25 +0000
Subject: [PATCH] secure-partitions: Download dlmalloc via cmake

Leaving this to cmake can cause intermittent build issues

Signed-off-by: Ben Horgan <ben.horgan@arm.com>
---
 .../trusted-services/secure-partitions_git.bb             | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/recipes-security/trusted-services/secure-partitions_git.bb b/recipes-security/trusted-services/secure-partitions_git.bb
index 42275c2..67cb530 100644
--- a/recipes-security/trusted-services/secure-partitions_git.bb
+++ b/recipes-security/trusted-services/secure-partitions_git.bb
@@ -3,7 +3,7 @@ HOMEPAGE = "https://trusted-services.readthedocs.io/en/latest/index.html"
 
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 
-LICENSE = "Apache-2.0 & BSD-3-Clause & Zlib"
+LICENSE = "Apache-2.0 & BSD-3-Clause & Zlib & CC0-1.0"
 LIC_FILES_CHKSUM = "file://license.rst;md5=ea160bac7f690a069c608516b17997f4 \
                     file://../mbedcrypto/LICENSE;md5=302d50a6369f5f22efdb674db908167a \
                     file://../nanopb/LICENSE.txt;md5=9db4b73a55a3994384112efcdb37c01f \
@@ -29,6 +29,10 @@ SRC_URI_append = " ${SRC_URI_SHIM}"
 SRC_URI_SHIM = "git://git.gitlab.arm.com/arm-reference-solutions/sel1_shim.git;protocol=https;branch=master;name=shim;destsuffix=git/shim"
 SRCREV_shim = "211423431bd45151f4f9060728c41b3c794e5792"
 
+SRC_URI_append = " ${SRC_URI_DLMALLOC}"
+SRC_URI_DLMALLOC = "http://gee.cs.oswego.edu/pub/misc/malloc.c;name=dlmalloc"
+SRC_URI[dlmalloc.sha256sum] = "103602c3fcbe200d5e257cdd7353d84bcc033d887bea3b245321319bf5401f47"
+
 # Which secure partitions to create
 SP_CRYPTO ?= "1"
 SP_SECURE_STORAGE ?= "1"
@@ -92,6 +96,8 @@ do_configure() {
               -DSHIM_TAG=${SRCREV_shim} \
               -DNANOPB_URL=${S}/../nanopb \
               -DMBEDCRYPTO_URL=${S}/../mbedcrypto \
+              -DDLMALLOC_SOURCE_DIR=${DL_DIR} \
+              -DDLMALLOC_URL="INVALID_URL" \
               -S . -B build
         done
     fi
-- 
GitLab