Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 1 | SUMMARY = "OP-TEE Trusted OS" |
| 2 | DESCRIPTION = "Open Portable Trusted Execution Environment - Trusted side of the TEE" |
| 3 | HOMEPAGE = "https://www.op-tee.org/" |
| 4 | |
| 5 | LICENSE = "BSD-2-Clause" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=c1f21c4f72f372ef38a5a4aee55ec173" |
| 7 | |
| 8 | inherit deploy python3native |
| 9 | require optee.inc |
| 10 | |
Andrew Geissler | ea144b03 | 2023-01-27 16:03:57 -0600 | [diff] [blame^] | 11 | FILESEXTRAPATHS:prepend := "${THISDIR}/optee-os-3.19.0:" |
Andrew Geissler | 517393d | 2023-01-13 08:55:19 -0600 | [diff] [blame] | 12 | |
| 13 | CVE_PRODUCT = "linaro:op-tee op-tee:op-tee_os" |
| 14 | |
| 15 | DEPENDS = "python3-pyelftools-native python3-cryptography-native" |
| 16 | |
| 17 | DEPENDS:append:toolchain-clang = " compiler-rt" |
| 18 | |
| 19 | SRC_URI = "git://github.com/OP-TEE/optee_os.git;branch=master;protocol=https" |
| 20 | |
| 21 | SRC_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 | |
| 27 | S = "${WORKDIR}/git" |
| 28 | B = "${WORKDIR}/build" |
| 29 | |
| 30 | EXTRA_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 | " |
| 39 | EXTRA_OEMAKE += " HOST_PREFIX=${HOST_PREFIX}" |
| 40 | EXTRA_OEMAKE += " CROSS_COMPILE64=${HOST_PREFIX}" |
| 41 | |
| 42 | CFLAGS[unexport] = "1" |
| 43 | LDFLAGS[unexport] = "1" |
| 44 | CPPFLAGS[unexport] = "1" |
| 45 | AS[unexport] = "1" |
| 46 | LD[unexport] = "1" |
| 47 | |
| 48 | do_compile:prepend() { |
| 49 | PLAT_LIBGCC_PATH=$(${CC} -print-libgcc-file-name) |
| 50 | } |
| 51 | |
| 52 | do_compile() { |
| 53 | oe_runmake -C ${S} all |
| 54 | } |
| 55 | do_compile[cleandirs] = "${B}" |
| 56 | |
| 57 | do_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 | |
| 63 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 64 | |
| 65 | do_deploy() { |
| 66 | install -d ${DEPLOYDIR}/${MLPREFIX}optee |
| 67 | install -m 644 ${D}${nonarch_base_libdir}/firmware/* ${DEPLOYDIR}/${MLPREFIX}optee |
| 68 | } |
| 69 | |
| 70 | addtask deploy before do_build after do_install |
| 71 | |
| 72 | SYSROOT_DIRS += "${nonarch_base_libdir}/firmware" |
| 73 | |
| 74 | FILES:${PN} = "${nonarch_base_libdir}/firmware/" |
| 75 | |
| 76 | # note: "textrel" is not triggered on all archs |
| 77 | INSANE_SKIP:${PN} = "textrel" |
| 78 | # Build paths are currently embedded |
| 79 | INSANE_SKIP:${PN} += "buildpaths" |
| 80 | INSANE_SKIP:${PN}-dev = "staticdev" |
| 81 | INHIBIT_PACKAGE_STRIP = "1" |
| 82 | |