Skip to content

Conversation

@shiva-ti
Copy link
Collaborator

While building OP-TEE with the SDK's Yocto-generated toolchain, the build fails with 'cannot find libgcc.a' linker error. This occurs because the toolchain requires explicit sysroot configuration.

OP-TEE's mk/gcc.mk uses CFLAGS64 and CFLAGS32 while querying gcc for library locations ensuring the compiler returns full paths. Add documentation instructing users to export CFLAGS64 and CFLAGS32 with --sysroot flags before building OP-TEE.

@github-actions
Copy link

New warnings found with rstcheck:

source/linux/Foundational_Components_OPTEE.rst:61: (SEVERE/4) Title level inconsistent:
source/linux/Foundational_Components_OPTEE.rst:68: (SEVERE/4) Title level inconsistent:
source/linux/Foundational_Components_OPTEE.rst:77: (SEVERE/4) Title level inconsistent:
source/linux/Foundational_Components_OPTEE.rst:91: (SEVERE/4) Title level inconsistent:

@praneethbajjuri
Copy link
Collaborator

@manorit2001, @ti-kamlesh please review.

@StaticRocket
Copy link
Member

Yeah, toolchains are, unfortunately, device specific. We used to have a nice overview explaining all of this. That was removed in favor of using the advanced include directive functions to put example commands all over the place. All of those are now wrong...

@manorit2001
Copy link
Contributor

ig this toolchain problem won't be specific to just optee I presume, it should be updated in some common place ig, IIRC every build requires this sysroot set correctly?

Current toolchain setup steps are missing sysroot flags required by
OP-TEE and U-Boot build systems, causing "cannot find libgcc.a" linker
errors.

Add CFLAGS64, KCFLAGS, and LDFLAGS exports with sysroot for 64-bit
builds. Add SYSROOT_32 and CFLAGS32 for 32-bit builds.

Signed-off-by: Shiva Tripathi <s-tripathi1@ti.com>
@github-actions
Copy link

New warnings found with rstcheck:

source/linux/Overview/GCC_ToolChain.rst:68: (INFO/1) Duplicate implicit target name: "linux-devkit".
source/linux/Overview/GCC_ToolChain.rst:279: (INFO/1) Duplicate implicit target name: "k3r5-devkit".

Building U-Boot with current SDK documentation steps results in
missing tee-os blob errors on AM62LX. Include OP-TEE support in
U-Boot build steps to resolve this.

AM62LX SDK does not include 32-bit ARM toolchain (k3r5-devkit),
unlike other K3 platforms. Remove CROSS_COMPILE_32 requirement
from OP-TEE build commands and add CFG_USER_TA_TARGETS=ta_arm64
to restrict OP-TEE to build only 64-bit TAs.

This resolves "cannot find libgcc.a" errors during OP-TEE build
and "missing external blobs" errors during U-Boot build.

Signed-off-by: Shiva Tripathi <s-tripathi1@ti.com>
@github-actions
Copy link

New warnings found with rstcheck:

source/linux/Overview/GCC_ToolChain.rst:68: (INFO/1) Duplicate implicit target name: "linux-devkit".
source/linux/Overview/GCC_ToolChain.rst:279: (INFO/1) Duplicate implicit target name: "k3r5-devkit".

@shiva-ti
Copy link
Collaborator Author

ig this toolchain problem won't be specific to just optee I presume, it should be updated in some common place ig, IIRC every build requires this sysroot set correctly?

yes it was required in u-boot as well. Added these flags in generic section which is used across.

Comment on lines +90 to +100
.. ifconfig:: CONFIG_part_variant not in ('AM62LX')

.. parsed-literal::
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=k3-|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_WITH_SOFTWARE_PRNG=y
.. ifconfig:: CONFIG_part_variant in ('AM62LX')

.. parsed-literal::
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=k3-|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_WITH_SOFTWARE_PRNG=y
$ make CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=k3-|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y CFG_WITH_SOFTWARE_PRNG=y CFG_USER_TA_TARGETS=ta_arm64
Copy link
Member

Choose a reason for hiding this comment

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

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.