blob: a03ea6a3b7a5bb5f572b8271a5f676ff647f9bd2 [file] [log] [blame]
Brad Bishopbec4ebc2022-08-03 09:55:16 -04001SUMMARY = "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
11CVE_PRODUCT = "linaro:op-tee op-tee:op-tee_os"
12
13DEPENDS = "python3-pyelftools-native python3-cryptography-native"
14
15DEPENDS:append:toolchain-clang = " compiler-rt"
16
17SRC_URI = "git://github.com/OP-TEE/optee_os.git;branch=master;protocol=https"
18
19SRC_URI:append = " \
20 file://0006-allow-setting-sysroot-for-libgcc-lookup.patch \
21 file://0007-allow-setting-sysroot-for-clang.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050022 file://0008-no-warn-rwx-segments.patch \
Brad Bishopbec4ebc2022-08-03 09:55:16 -040023 "
24
25S = "${WORKDIR}/git"
26B = "${WORKDIR}/build"
27
28EXTRA_OEMAKE += " \
29 PLATFORM=${OPTEEMACHINE} \
30 CFG_${OPTEE_CORE}_core=y \
31 CROSS_COMPILE_core=${HOST_PREFIX} \
32 CROSS_COMPILE_ta_${OPTEE_ARCH}=${HOST_PREFIX} \
33 NOWERROR=1 \
34 ta-targets=ta_${OPTEE_ARCH} \
35 O=${B} \
36"
Patrick Williams92b42cb2022-09-03 06:53:57 -050037EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}"
38EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}"
Brad Bishopbec4ebc2022-08-03 09:55:16 -040039
40CFLAGS[unexport] = "1"
41LDFLAGS[unexport] = "1"
42CPPFLAGS[unexport] = "1"
43AS[unexport] = "1"
44LD[unexport] = "1"
45
Patrick Williams92b42cb2022-09-03 06:53:57 -050046do_compile:prepend() {
47 PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name)
48}
Brad Bishopbec4ebc2022-08-03 09:55:16 -040049
50do_compile() {
51 oe_runmake -C ${S} all
52}
53do_compile[cleandirs] = "${B}"
54
55do_install() {
56 #install core in firmware
57 install -d ${D}${nonarch_base_libdir}/firmware/
58 install -m 644 ${B}/core/*.bin ${B}/core/tee.elf ${D}${nonarch_base_libdir}/firmware/
59}
60
61PACKAGE_ARCH = "${MACHINE_ARCH}"
62
63do_deploy() {
64 install -d ${DEPLOYDIR}/${MLPREFIX}optee
65 install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee
66}
67
68addtask deploy before do_build after do_install
69
70SYSROOT_DIRS += "${nonarch_base_libdir}/firmware"
71
72FILES:${PN} = "${nonarch_base_libdir}/firmware/"
73
74# note: "textrel" is not triggered on all archs
75INSANE_SKIP:${PN} = "textrel"
76# Build paths are currently embedded
77INSANE_SKIP:${PN} += "buildpaths"
78INSANE_SKIP:${PN}-dev = "staticdev"
79INHIBIT_PACKAGE_STRIP = "1"
80