Yocto CROPS 6.x build fails on elfutils

I am using the Containerized build according to this document Build Torizon OS from Source With Yocto Project/OpenEmbedded | Toradex Developer Center, so I am using the torizon/crops:kirkstone-6.x.y container with 6.8.X tag (tried various ones like 6.8.2 or 6.8.1)
The host system is Ubuntu 22.04.4 LTS

My build command looks like this

docker run --rm -it --name=crops -v ~/projects/aktina/code/yocto-workdir:/workdir --workdir=/workdir -e MACHINE=verdin-imx8mp -e IMAGE=torizon-core-docker -e BRANCH=refs/tags/6.8.0 -e EULA=1 torizon/crops:kirkstone-6.x.y startup-tdx.sh

It fails with following error similar to the one described here Bitbake fails to build elfutils

|  1158 |           if (curl_easy_getinfo(target_handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD,
|       |           ^~
| /workdir/torizon/build-torizon/tmp/work/x86_64-linux/elfutils-native/0.186-r0/recipe-sysroot-native/usr/include/curl/curl.h:2879:3: note: declared here 
|  2879 |   CURLINFO_CONTENT_LENGTH_DOWNLOAD
|       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| cc1: all warnings being treated as errors

The problem is that the torizon/crops is based on Debian 12 which is giving an error. I am trying to find the way to get the Ubuntu version for torizon/crops (if any) or at least to build the docker similar to the one provided from Torizon in order to achieve the same output image.

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for your detailed description of the issue.

The error you’re facing with the Torizon containerized Yocto build is known and was discussed in the community post you referenced. It relates to how newer toolchains treat some code as errors, which causes failures in recipes like elfutils.

Choosing the Correct Torizon/Crops Version

  • There isn’t an official Ubuntu-based torizon/crops container; the provided containers are based on Debian for both the Kirkstone (6.x.y) and Scarthgap (7.x.y) versions.
  • The recommended practice is to use the latest supported Torizon container for your Torizon OS version—e.g., for Torizon OS 7.x.y, use torizon/crops:scarthgap-7.x.y. However, for 6.x.y (Kirkstone), you may face issues as some host/container combinations receive fewer updates as support focus moves to recent releases.

Workarounds

1. Upgrade to Torizon OS 7.x.y (Recommended if Possible)

If you are able, consider upgrading to Torizon OS 7.x.y and use its corresponding container torizon/crops:scarthgap-7.x.y. The build scripts have improved compatibility and maintenance for newer distributions:

2. Use a Native Build on Ubuntu

Since you are using Ubuntu 22.04 (an officially supported distribution for Yocto builds), you could set up a native build environment instead of a container. This avoids the host/container compatibility issues:

3. Patch the Problematic Recipe

The elfutils build failure might be fixable by locally patching the recipe to relax -Werror usage or adjust flag handling. This is more advanced and may be necessary for Kirkstone builds if you must stick with an older release. Refer to this workaround for more information.

4. Custom CROPS Container (Advanced)

If you require a custom build environment (e.g., based on Ubuntu), you could create your own Docker image using the Dockerfile from the crops repository as a base, adapting it for Ubuntu. However, this approach would require careful dependency handling and is only recommended for advanced users.

Summary Table

Approach Links Recommended When
Use Torizon OS 7.x.y Build instructions for 7.x.y New designs/upgrades
Native build on Ubuntu Yocto build natively Host is Ubuntu/Debian
Patch troublesome recipe Community workaround Must stay with 6.x.y
Custom CROPS container CROPS Dockerfile repo Custom expertise needed

If possible, moving to a native build on your Ubuntu host or updating to Torizon OS 7.x.y will provide the most stability and compatibility with current container images and dependencies.

Best regards,
Toradex AI Assistant.

Hello @ollamh

I’m trying to reproduce this now but that will take a while. If my build does fail, my next step will be to run the torizon/crops:dunfell-5.x.y container to see if that helps. If it is indeed due to the newer version of Debian in the current scarthgap container, moving to the older one might be a workaround until we can figure out the ultimate root cause.

Drew

No luck with the dunfell container. It failed due to some missing HOSTTOOLS. I’ll get back to you when I have more to share.

Drew

Hi @ollamh

I was able to successfully build the elfutils package by applying the upstream patch to my checked out sources.

You can replicate what I did with the following:

$ cd layers/openembedded-core
$ vrepo start fix-elf-utils-build-failure .
$ git cherry-pick 7a12834052fc622eb22eab2dc77fe717a4263ecf

Hopefully that gets you unblocked while we discuss internally.

Drew