blob: 8adb6996d01f09f0a7b54ca4ba354138a6ad6171 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "OP-TEE Trusted OS"
2DESCRIPTION = "Open Portable Trusted Execution Environment - Trusted side of the TEE"
3HOMEPAGE = "https://www.op-tee.org/"
4
5LICENSE = "BSD-2-Clause"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173"
7
8inherit deploy python3native
9require optee.inc
10
11FILESEXTRAPATHS:prepend := "${THISDIR}/optee-os-3_19:"
12
13CVE_PRODUCT = "linaro:op-tee op-tee:op-tee_os"
14
15DEPENDS = "python3-pyelftools-native python3-cryptography-native"
16
17DEPENDS:append:toolchain-clang = " compiler-rt"
18
19SRC_URI = "git://github.com/OP-TEE/optee_os.git;branch=master;protocol=https"
20
21SRC_URI:append = " \
22 file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
23 file://0007-allow-setting-sysroot-for-clang.patch \
24 file://0008-no-warn-rwx-segments.patch \
25 "
26
27S = "${WORKDIR}/git"
28B = "${WORKDIR}/build"
29
30EXTRA_OEMAKE += " \
31 PLATFORM=${OPTEEMACHINE} \
32 CFG_${OPTEE_CORE}_core=y \
33 CROSS_COMPILE_core=${HOST_PREFIX} \
34 CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
35 NOWERROR=1 \
36 ta-targets=ta_${OPTEE_ARCH} \
37 O=${B} \
38"
39EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}"
40EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}"
41
42CFLAGS[unexport] = "1"
43LDFLAGS[unexport] = "1"
44CPPFLAGS[unexport] = "1"
45AS[unexport] = "1"
46LD[unexport] = "1"
47
48do_compile:prepend() {
49 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name)
50}
51
52do_compile() {
53 oe_runmake -C ${S} all
54}
55do_compile[cleandirs] = "${B}"
56
57do_install() {
58 #install core in firmware
59 install -d ${D}${nonarch_base_libdir}/firmware/
60 install -m 644 ${B}/core/*.bin ${B}/core/tee.elf ${D}${nonarch_base_libdir}/firmware/
61}
62
63PACKAGE_ARCH = "${MACHINE_ARCH}"
64
65do_deploy() {
66 install -d ${DEPLOYDIR}/${MLPREFIX}optee
67 install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee
68}
69
70addtask deploy before do_build after do_install
71
72SYSROOT_DIRS += "${nonarch_base_libdir}/firmware"
73
74FILES:${PN} = "${nonarch_base_libdir}/firmware/"
75
76# note: "textrel" is not triggered on all archs
77INSANE_SKIP:${PN} = "textrel"
78# Build paths are currently embedded
79INSANE_SKIP:${PN} += "buildpaths"
80INSANE_SKIP:${PN}-dev = "staticdev"
81INHIBIT_PACKAGE_STRIP = "1"
82