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 <[email protected]>
@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".

@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.

@github-actions
Copy link

github-actions bot commented Jan 2, 2026

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.

Also fix indentation for existing code as per guidelines.

Signed-off-by: Shiva Tripathi <[email protected]>
@github-actions
Copy link

github-actions bot commented Jan 2, 2026

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".


.. parsed-literal::
$ make CROSS_COMPILE="$CROSS_COMPILE_32" CROSS_COMPILE64="$CROSS_COMPILE_64" PLATFORM=|__OPTEE_PLATFORM_FLAVOR__| CFG_ARM64_core=y
Copy link
Contributor

Choose a reason for hiding this comment

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

I think looking at AM62LX, in these as well CROSS_COMPILE_32 can be purged out by adding CFG_USER_TA_TARGETS=ta_arm64 but since it's not tested we can keep it as is for now and update it once tested later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

a quick test on am62x does confirm that using the same command for AM62L builds optee for AM62X also.

For AM62L, there's no 32 bit toolchain- hence there's no other option then to use ta_arm64. But for non-AM62L platforms, both architectures can be supported. Hence I feel it's good to have both 32 and 64 mentioned. For e.g. some customer might be using a legacy 32 bit TA or some application

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I just didn't know at the time that we had CFG_USER_TA_TARGETS=ta_arm64 so had to keep 32 bit compilers then to satisfy the builds and boot but yeah, it's been time so people might've started using it, but I still feel that we should just keep 64 bit builds, I don't see any reason why they'd stick to 32 bit when the architecture does support 64 bit.. we can add both the build commands as well if you see fit but no strong opinions as such from my side

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.