From patchwork Wed Jan 29 17:38:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 183001 Delivered-To: patches@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp891498ile; Wed, 29 Jan 2020 09:41:41 -0800 (PST) X-Received: by 2002:a5d:4d06:: with SMTP id z6mr36766286wrt.339.1580319701388; Wed, 29 Jan 2020 09:41:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580319701; cv=none; d=google.com; s=arc-20160816; b=a4/EC7v4zWwJqaTTyP69Jg/3BvJjqvQsi4zQW62GcADyZxlfQouQ9S3yjDDz80tJsa wtEAqNihw46G4fXQS+ZFwq5OqW+wOTKZSF6+waNTa9UmSwWJSKImJ4uDrm1RiME7OQ/0 hDdjIS1OcNsXl9Ghfj27HPj8do2D4MAD+OO7zaPEPH1Fa0g6Y6fpqZxSjQJKl+tIJg9E jPrZeo2v2MtPJhv92sFsC/LqYDDSI3WQimXhPGbSlil15B7FvnVSC+tm+DwUt5QFcHjU yhSZNPoRTJUsBmRxyUdQC03OA0A6TtZToaKENHOQM14+3/ZSqAiavSM3L1Yi/QuijDhX 1qvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2gcStzD0f5T0WrzotQhNNLnYgjIS2cQtSioQGjjk4hk=; b=OlpYPncuPPP0pJ/WKG5zoDWDKjDzKkOptzcr3Z2GNpwwpCLS6B0vOXG0/ju8f2FE08 8tU2Q9BK/t/4sWY/zGI/S8ftzA69RPaB5+K9MNEHcEyxjTQKl1G4TDQsPePFEysti8Zl xB3up5wwKZNq3RL3r3ioWyCzdeDGJ96YdRg+Cf9QFpqZNXq6f45lP4Ji3k/J4+ksmINf 17x4n6zI2k/EzC8ET4i6NzpoJAAhTTkDpeYPxVHvpm6dAUZSAK9ExC9jeH70hamxZUIv 8fhYywn+P+/zFM3WWpj+UCcyFovZWzdnxJeg5P6craGwZdPx4lw5dPTFrXEuudwiEM99 t/yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zesdVu3/"; spf=pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.griffin@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v129sor1713079wma.1.2020.01.29.09.41.41 for (Google Transport Security); Wed, 29 Jan 2020 09:41:41 -0800 (PST) Received-SPF: pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zesdVu3/"; spf=pass (google.com: domain of peter.griffin@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=peter.griffin@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2gcStzD0f5T0WrzotQhNNLnYgjIS2cQtSioQGjjk4hk=; b=zesdVu3/Xg7Qpv+eSeK6SjOiJ8GTEw9cMH/cTRkJ9shNSWbPbXmMJ5h49mtMCdUMRE LZ9qGUetYgQFlgjEx9BSfLpHCo4rKmJEAZI0VhL7qKh4miOrFr69CYkfEsCPEEW6p32T y07U4EAX+/GGs+YkhrK3aiSKSfRJEWcTJ8Yx1JAMDyeyRtj7NpHg3COZOKt2l4vVnlfN ZOF08h4EZhUQQ35AU4/cPhHGtW4ePo7L8KJcuXhKqGzFLMmWjzsTfRNVCKXAiu6hzTV3 KF5xK51bjL+TmqefJ1HDlSqq8IIgrjuvQIe5EXN1F2hwAzhnJTKZcZfz/z+tdHeDO0l4 5syQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2gcStzD0f5T0WrzotQhNNLnYgjIS2cQtSioQGjjk4hk=; b=UIPK/wIFmyMl8OARpVtW3Yc5XZ9oF1EJRefa7eRr0Aqvr0i1/P97UWDjyOWYHfhSV5 +d2mmK0d1JDhGxJvR9LoNVRZ/uZ8uq3ytQf75guY+yDbVcqhKeLeGCTArI/D0gi0Pxw4 NflExz+2HIczNt24xo6jIABk+nKAFWHH3XXHUkPqp7CdMtkw53tYRjbIkbM/JLD3tjJV z4OYFyoPpMQYLNF9EREQgh+KIztTpNiYazf7s6tIfryGtUAW3xsRmfBGcC/ZuGAYJmVc q0AeWp72YyiNmPx6FRXAfs+vqsqNehGWv6pQIsjlhWkYUh2yjlaLbx8N83AugHeiDf1e z0yg== X-Gm-Message-State: APjAAAXq3PmxelVWrkb2id5dJrhsCYJTY+1oJAsBvLh3pc8DK3AqANzI wZwO28f/Oy77Qv97V2CeHg0EvzYWRgwC1Q== X-Google-Smtp-Source: APXvYqxMX/eL3H4JBJAOAagNov89p1v2MJ6wRzIECAc2A410PvznYed2FP/GeEYknNNZkdeYGLS10w== X-Received: by 2002:a05:600c:294:: with SMTP id 20mr341195wmk.135.1580319701011; Wed, 29 Jan 2020 09:41:41 -0800 (PST) Return-Path: Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust4998.18-1.cable.virginm.net. [86.31.179.135]) by smtp.gmail.com with ESMTPSA id y185sm3231525wmg.2.2020.01.29.09.41.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Jan 2020 09:41:40 -0800 (PST) From: Peter Griffin To: meta-arm@lists.yoctoproject.org, denis@denix.org, jon.mason@arm.com, raj.khem@gmail.com, nicolas.dechesne@linaro.org Cc: joakim.bech@linaro.org, moorthy.baskaravenkatraman-sambamoorthy@linaro.org, alexandre.jutras@linaro.org, Peter Griffin Subject: [PATCH 2/5] optee-os_git.bb: add optee-os recipe and patches Date: Wed, 29 Jan 2020 17:38:42 +0000 Message-Id: <1580319525-32054-3-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1580319525-32054-1-git-send-email-peter.griffin@linaro.org> References: <1580319525-32054-1-git-send-email-peter.griffin@linaro.org> This has moved from meta-linaro to meta-arm as this is the new place for general recipes for Arm arch and has a mailing list for external contributors. Signed-off-by: Peter Griffin --- ...1-allow-setting-sysroot-for-libgcc-lookup.patch | 13 ++++ meta-arm/recipes-security/optee/optee-os_git.bb | 69 ++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 meta-arm/recipes-security/optee/optee-os/0001-allow-setting-sysroot-for-libgcc-lookup.patch create mode 100644 meta-arm/recipes-security/optee/optee-os_git.bb -- 2.7.4 diff --git a/meta-arm/recipes-security/optee/optee-os/0001-allow-setting-sysroot-for-libgcc-lookup.patch b/meta-arm/recipes-security/optee/optee-os/0001-allow-setting-sysroot-for-libgcc-lookup.patch new file mode 100644 index 0000000..17127d0 --- /dev/null +++ b/meta-arm/recipes-security/optee/optee-os/0001-allow-setting-sysroot-for-libgcc-lookup.patch @@ -0,0 +1,13 @@ +diff --git a/mk/gcc.mk b/mk/gcc.mk +index fc38c4d..77b8d74 100644 +--- a/mk/gcc.mk ++++ b/mk/gcc.mk +@@ -12,7 +12,7 @@ nostdinc$(sm) := -nostdinc -isystem $(shell $(CC$(sm)) \ + -print-file-name=include 2> /dev/null) + + # Get location of libgcc from gcc +-libgcc$(sm) := $(shell $(CC$(sm)) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ ++libgcc$(sm) := $(shell $(CC$(sm)) $(LIBGCC_LOCATE_CFLAGS) $(CFLAGS$(arch-bits-$(sm))) $(comp-cflags$(sm)) \ + -print-libgcc-file-name 2> /dev/null) + + # Define these to something to discover accidental use diff --git a/meta-arm/recipes-security/optee/optee-os_git.bb b/meta-arm/recipes-security/optee/optee-os_git.bb new file mode 100644 index 0000000..872fd48 --- /dev/null +++ b/meta-arm/recipes-security/optee/optee-os_git.bb @@ -0,0 +1,69 @@ +SUMMARY = "OP-TEE Trusted OS" +DESCRIPTION = "OPTEE OS" + +LICENSE = "BSD" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" + +PV="3.7.0+git${SRCPV}" + +inherit deploy python3native + +DEPENDS = "python3-pycrypto-native python3-pyelftools-native" + +SRCREV = "a2fa5018cb595a9cd9ab62e82c7485ca57a62084" +SRC_URI = "git://github.com/OP-TEE/optee_os.git \ + file://0001-allow-setting-sysroot-for-libgcc-lookup.patch \ + " + +S = "${WORKDIR}/git" + +OPTEEMACHINE ?= "${MACHINE}" +OPTEEOUTPUTMACHINE ?= "${MACHINE}" + +EXTRA_OEMAKE = "PLATFORM=${OPTEEMACHINE} CFG_ARM64_core=y \ + CROSS_COMPILE_core=${HOST_PREFIX} \ + CROSS_COMPILE_ta_arm64=${HOST_PREFIX} \ + NOWERROR=1 \ + ta-targets=ta_arm64 \ + LDFLAGS= \ + LIBGCC_LOCATE_CFLAGS=--sysroot=${STAGING_DIR_HOST} \ + " + +OPTEE_ARCH_armv7a = "arm32" +OPTEE_ARCH_aarch64 = "arm64" + +do_compile() { + unset LDFLAGS + oe_runmake all CFG_TEE_TA_LOG_LEVEL=0 +} + +do_install() { + #install core on boot directory + install -d ${D}${nonarch_base_libdir}/firmware/ + + install -m 644 ${B}/out/arm-plat-${OPTEEOUTPUTMACHINE}/core/*.bin ${D}${nonarch_base_libdir}/firmware/ + #install TA devkit + install -d ${D}/usr/include/optee/export-user_ta/ + + for f in ${B}/out/arm-plat-${OPTEEOUTPUTMACHINE}/export-ta_${OPTEE_ARCH}/* ; do + cp -aR $f ${D}/usr/include/optee/export-user_ta/ + done +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_deploy() { + install -d ${DEPLOYDIR}/optee + for f in ${D}${nonarch_base_libdir}/firmware/*; do + install -m 644 $f ${DEPLOYDIR}/optee/ + done +} + +addtask deploy before do_build after do_install + +FILES_${PN} = "${nonarch_base_libdir}/firmware/" +FILES_${PN}-dev = "/usr/include/optee" + +INSANE_SKIP_${PN}-dev = "staticdev" + +INHIBIT_PACKAGE_STRIP = "1"