Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-std branch] Rust examples build environment cleanup #116

Merged
merged 8 commits into from
Jan 3, 2024

Conversation

b49020
Copy link
Contributor

@b49020 b49020 commented Dec 29, 2023

Allow OP-TEE rust examples to be compiled using standard OP-TEE environment variables:

  • CROSS_COMPILE
  • TA_DEV_KIT_DIR
  • OPTEE_CLIENT_EXPORT

Dependency: OP-TEE/build#715

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Similar to C counterparts, use OPTEE_CLIENT_EXPORT as a standard path to
export pre-built optee-client libraries and headers.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Similar to C counterparts, use TA_DEV_KIT_DIR as a standard path to
export pre-built TA libraries and headers.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Refactor OP-TEE rust examples build infrastructure to rather use
standard environment variables like:
- CROSS_COMPILE
- TA_DEV_KIT_DIR

With that remove any custom OPTEE_* environment variables.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Rather than automatically building OP-TEE OS and OP-TEE Client, we
should ask users to build them for their particular platforms using
whichever OP-TEE release they are targeting.

Users just have to export paths for OP-TEE OS build artifacts via
TA_DEV_KIT_DIR and for OP-TEE Client via OPTEE_CLIENT_EXPORT. This is
the common practice followed by C counterparts like optee_test and
optee_examples. Along with that it make OP-TEE rust examples compatible
with build systems like Yocto etc.

Regarding toolchains, we don't need to fetch them explicitly but rather
users can use the distro cross compiler or the one they have installed
on a particular location via CROSS_COMPILE environment variable.

With that build command simplifies to just following:

$ make CROSS_COMPILE=aarch64-linux-gnu- \
       TA_DEV_KIT_DIR=<optee_os>/out/arm-plat-vexpress/export-ta_arm64/ \
       OPTEE_CLIENT_EXPORT=<optee_client>/out/export/

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Since we don't have a similar linker script pre-processing capability in
rust build script as we have with C Makefile. So manually fix following
build error seen with older GCC linker while parsing linker scripts:

aarch64-linux-gnu-ld.bfd:ta.lds:3: ignoring invalid character `#' in expression

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
arm-none-linux-gnueabihf-ld.bfd reports EABI version mismatch issue,
drop that error via adding "--no-warn-mismatch" linker flag.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Extend CI to build OP-TEE rust examples for both Arm 64-bit and Arm
32-bit mode.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
@b49020
Copy link
Contributor Author

b49020 commented Jan 2, 2024

@DemesneGH The CI has been updated now for refactored build infrastructure. Also, I have added standalone rust examples build too for both Arm 64-bit as well as Arm 32-bit. Please trigger CI again.

Although, there is still one dependency as OP-TEE/build#715 left for CI to completely pass.

@b49020
Copy link
Contributor Author

b49020 commented Jan 3, 2024

@DemesneGH,

Although, there is still one dependency as OP-TEE/build#715 left for CI to completely pass.

Since this is merged, can you re-trigger the CI build now? I hope it should pass now.

@DemesneGH DemesneGH merged commit b6849b7 into apache:no-std Jan 3, 2024
4 checks passed
@DemesneGH
Copy link
Contributor

merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants