siemens / meta-iot2050

SIMATIC IOT2050 Isar/Debian Board Support Package
MIT License
129 stars 76 forks source link

recipes-bsp/optee-ftpm: optee-ftpm package needs to be cross compiled #547

Open rakeshk7097 opened 1 month ago

rakeshk7097 commented 1 month ago

optee-ftpm builds successfully only in cross-compilation mode; therefore, setting the recipe to default to cross-compilation can resolve the following build error.

make[2]: Entering directory '/<>/Samples/ARM32-FirmwareTPM/optee_ta' /usr/bin/make -C fTPM CROSS_COMPILE= make[3]: Entering directory '/<>/Samples/ARM32-FirmwareTPM/optee_ta/fTPM' Checking symlink to the TPM folder: /<> Checking symlink to the WolfSSL folder: /<>/external/wolfssl Establishing symlink. Establishing symlink. CC ../out/fTPM/platform/AdminPPI.o CC ../out/fTPM/platform/Cancel.o make[3]: No rule to make target 'lib/wolf/wolf_symlink/wolfcrypt/src/aes.c', needed by '../out/fTPM/./lib/wolf/wolf_symlink/wolfcrypt/src/aes.o'. Stop. make[3]: Waiting for unfinished jobs.... CC ../out/fTPM/platform/Clock.o CC ../out/fTPM/platform/Entropy.o CC ../out/fTPM/platform/LocalityPlat.o CC ../out/fTPM/platform/NvAdmin.o CC ../out/fTPM/platform/NVMem.o CC ../out/fTPM/platform/PowerPlat.o CC ../out/fTPM/platform/PlatformData.o CC ../out/fTPM/platform/PPPlat.o CC ../out/fTPM/platform/RunCommand.o CC ../out/fTPM/platform/Unique.o CC ../out/fTPM/platform/EPS.o CC ../out/fTPM/platform/PlatformACT.o CC ../out/fTPM/reference/RuntimeSupport.o CC ../out/fTPM/platform/fTPM_helpers.o CC ../out/fTPM/fTPM.o make[3]: Leaving directory '/<>/Samples/ARM32-FirmwareTPM/optee_ta/fTPM' make[2]: *** [Makefile:6: all] Error 2

rakeshk7097 commented 1 month ago

Hi @BaochengSu , could you please review the PR.

jan-kiszka commented 1 month ago

This rather looks like an issue that is independent of the recipe in meta-iot2050, rather shared by all that use optee-ftpm.inc from isar. But just dropping it there will also not solve the underlying issue because this would still break on arm64 build hosts - which we kind of supported once.

But why are you running into this at all? Are you actually building inside QEMU?

rakeshk7097 commented 1 month ago

Hi @jan-kiszka , thanks for your comment.

This rather looks like an issue that is independent of the recipe in meta-iot2050, rather shared by all that use optee-ftpm.inc from isar. But just dropping it there will also not solve the underlying issue because this would still break on arm64 build hosts - which we kind of supported once.

But why are you running into this at all? Are you actually building inside QEMU?

Actually, I am building on an x86 host machine and attempted to build the optee-ftpm-iot2050 package without setting ISAR_CROSS_COMPILE = 1 in local.conf, but the build process reported an error.

Building only optee-ftpm package for cross-compilation might be beneficial rather than setting ISAR_CROSS_COMPILE = 1 in local.conf and compiling all packages in cross-compilation mode, as is the current practice with meta-iot2050 for enabling secure boot.

What would be your suggestion regarding this matter?