Skip to content

Conversation

@gpoulios
Copy link
Contributor

Summary

Both optee_supplicant and libteec are found in the same external source repo (optee_client). optee_supplicant depends on libteec. A Kconfig dependency was in place, but not a makefile dependency.

So far, optee_supplicant would not re-download the optee_client archive (zip), and would expect to find it through libteec. In cases where optee_supplicant's context context target was invoked before libteec's context target, the supplicant would not have a rule available to download the archive.

Symptom: build-time log
Downloading: https://github.com/OP-TEE/optee_client/archive/refs/tags/4.6.0.zip
CP:  [...]/nuttx/include/nuttx/config.h
CC:  tcpblaster_host.c
CC:  tcpblaster_cmdline.c
CC:  tcpblaster_server.c
make[3]: *** No rule to make target '../libteec/4.6.0.zip', needed by 'optee_client'.  Stop.
make[2]: *** [Makefile:57:[...]/apps/tee/optee_supplicant_context] Error 2
make[2]: *** Waiting for unfinished jobs....

A more straightforward approach is to reflect optee_client file structure in NuttX apps repo, i.e. have an optee_client directory that contains both libteec and the supplicant.

Impact

No change for users. Kconfig semantics are the same (CONFIG_OPTEE_SUPPLICANT depends on CONFIG_LIBTEEC). Only change is CONFIG_LIBTEEC_VERSION and CONFIG_OPTEE_SUPPLICANT_VERSION are now both controlled by CONFIG_OPTEE_CLIENT_VERSION.

The result is a much more straightforward file structure without any out-of-dir dependencies or missing makefile rules.

Testing

Tests performed on an NXP i.MX93 with imx93-evk:koptee and:

CONFIG_DEV_OPTEE_SUPPLICANT=y
CONFIG_EXAMPLES_OPTEE_GP=y
CONFIG_LIBTEEC=y
CONFIG_OPTEE_SUPPLICANT=y

Results:

knsh> optee_gp
D/TC:0 0 core_mmu_xlat_table_alloc:691 xlat tables used 8
D/TC:? 0 tee_ta_init_pseudo_ta_session:303 Lookup pseudo TA 7011a688-ddde-4053-a5a9-7b3c4ddf13b8
D/TC:? 0 tee_ta_init_pseudo_ta_session:315 Open device.pta
D/TC:? 0 tee_ta_init_pseudo_ta_session:330 device.pta : 7011a688-ddde-4053-a5a9-7b3c4ddf13b8
INF [7] TEEC:mainD/TC:? 0 tee_ta_close_session:460 csess 0xd16150d0 id 1
D/TC:? 0 tee_ta_close_session:479 Destroy session
:164: Available devices:
INF [7] TEEC:main:174:   d96a5b40-c3e5-21e3-8794-1002a5d5c61b
INF [7] TEEC:main:174:   1619ec9c-18f9-48e3-889c-ed4ef567c806
INF [7] TEEC:main:174:   f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c

knsh> optee_supplicant -f /data/tee &
optee_supplicant [0:100]
knsh> DBG [6] TEEC:open_dev:441: using device "/dev/teepriv0"
DBG [6] TEEC:process_one_request:568: looping

cederom
cederom previously approved these changes Oct 29, 2025
Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @gpoulios :-)

Merges build file structure so that both libteec and optee_supplicant
are under the same nuttx-app directory. This better reflects external
source repo structrure (optee_client containing both libteec and
tee-supplicant) and avoids a case where build of supplicant
was attempted before libteec, leading to a missing .zip file
(zip file was only downloaded by libteec, but order of builds was
not enforced).

Signed-off-by: George Poulios <gpoulios@census-labs.com>
@gpoulios gpoulios dismissed stale reviews from cederom and xiaoxiang781216 via ce1ef21 October 29, 2025 15:09
@gpoulios gpoulios force-pushed the fix/optee-supp-build branch from e675b11 to ce1ef21 Compare October 29, 2025 15:09
@gpoulios
Copy link
Contributor Author

Minor amendments (removed a comment, and corrected some file headers)

Copy link
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @gpoulios :-)

@xiaoxiang781216 xiaoxiang781216 merged commit f3dc217 into apache:master Oct 30, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants