1

We have a Yocto project (mickledore) to create a custom Linux for an ARM A7 system. To be able to write code for this target, we also created the SDK. Inside local.conf we have:

SDKMACHINE = "i686"
SDK_ARCHIVE_TYPE = "tar.xz"

We execute:

bitbake core-image-minimal -c populate_sdk -f

Everything looks good and works so far. But. In the SDK there are a lot of symbolic links:

/home/foobar/buildtools/sdk/sysroots/i686-pokysdk-linux/usr/bin$ ls -l
xz -> /home/foobar/poky/build/tmp/deploy/sdk/i686/sysroots/i686-pokysdk-linux/usr/bin/xz.xz

We need to give the SDK to every member of the team so it would be nice to have a portable SDK without links or with relative links, but we could not find any options to make yocto create such a thing.

It seems to us as if the only option is, to write a script that converts all links from absolute to relative. Is it really that complicated or does anybody have a different idea on how to make the SDK portable?

2
  • 1
    I'm just curious… Are you really using 32-bit x86 for the SDK host machine in 2025? Commented Oct 29 at 13:09
  • Yes, we do. The ARM target is 32 bit so we need to compile that with a 32bit compiler. We compile the same application to run on our host machines. To have a similar behavior we also compile as 32bit for our hosts. Directly taking the i686 SDK seemed to be easier than to take the x86_64 one and try to make the compiler use only 32bit. Commented Oct 29 at 13:31

1 Answer 1

1

What you're looking at is the unpacked SDK. There you have many links specific to the system where it was unpacked on. You cannot even move that folder without breaking things.

What you want instead is the .sh file (it's actually a self extracting zip archive) inside the build folder. For me it's named like this:

tmp/deploy/sdk/poky-glibc-x86_64-my-image..aarch64..toolchain-4.2.0.sh

Then each member simply gets the file and runs it. The shell script will automatically add the right paths in the appropriate places. Should look something like this:

sh poky-glibc-x86_64-my-image..aarch64..toolchain-4.2.0.sh
Poky SDK installer version 4.2.0
=====================================================================
Enter target directory for SDK (default: /opt/poky/4.2.0): 
You are about to install the SDK to "/opt/poky/4.2.0". Proceed [Y/n]? n
...

From what you said in the comment about needing to have 32-bit hosts for building: I'd simply cross compile, if you're not relying on some assembler optimizations or other unusual things. In fact, the .sh file has all the info in it's name according to the docs on the SDK:

poky-glibc-host_system-image_type-arch-toolchain-release_version.sh

Where:

host_system is a string representing your development system:

           i686 or x86_64.

image_type is the image for which the SDK was built:

           core-image-minimal or core-image-sato.

is a string representing the tuned target architecture:

           aarch64, armv5e, core2-64, i586, mips32r2, mips64, ppc7400, or cortexa8hf-neon.

release_version is a string representing the release number of the Yocto Project:

           5.2.999, 5.2.999+snapshot 

For example, the following SDK installer is for a 64-bit development host system and a i586-tuned target architecture based off the SDK for core-image-sato and using the current DISTRO snapshot:

poky-glibc-x86_64-core-image-sato-i586-toolchain-DISTRO.sh
Sign up to request clarification or add additional context in comments.

2 Comments

"Then each member simply gets the file and runs it." That was the part I was trying to avoid. At the moment we have a git repository with SDK, compilers, libs, everything - everyone just pulls that and have everything they need. Having to run a script is an additional step that will be forgotten when someone tries to setup a new workstation in 5 or 10 years time. Thank you. Then I will probably now look into git hooks to automate unpacking the .sh or think about how to automate this step otherwise.
everyone just pulls that and have everything they need - That's a noble goal, but I know of no way to achieve it with Yocto. Though I personally wouldn't check the SDK into version control due to its size. For practical approach, running setup.sh or similar script that does all the setup after clone would be comfortable enough for most, I'd say.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.