SiFive Yocto, kas, and install-buildtools

I’m trying to get SiFive’s “kas” based Yocto system working on an older RedHat installation. The compiler is very old and I need to use “install-buildtools”. However, even after running “install-buildtools” and sourcing the necessary script, kas is still trying to use the old compiler. How do I get kas to use the tools installed via “install-buildtools”?

I presume you mean that you want to use a later toolchain than the default on the older version of RHEL that you’re using? In that case don’t you install the relevant devtoolset-n? E.g. for GCC 8: Developer Toolset 8 — Software Collections

You might want to post more details - e.g. what version of RHEL, what version of GCC is there by default etc.

Sorry for the short post. I’m building on a CentOS 6.0 system where I do not have root access nor can the OS be updated. kas overrides any paths I set to use newer tool sets. I believe this describes the issue: Incompatibility with Yocto's Pre-Built buildtools Tarball · Issue #31 · siemens/kas · GitHub

I’ve gotten around that for now but I’ve hit an issue with the ‘tar’ included in the pre-built buildtools not being new enough: tar cannot handle a file list from ‘/dev/null’. My Yocto is based on the SiFive Freedom Yocto from 8/2022. In order to get a newer pre-built buildtools with a newer tar I have to upgrade my Yocto system; the Yocto from 4/2023 looks to have the newer tar.

Have you considered using kas-container instead of installing it directly on the host?

Why should I install containers? It worked fine previously. Seems like a lot of overhead for no gain.

Also, I still can’t build the SDK with kas due to it not finding qemu-x86_64:

  • ‘[’ True = False -a nativesdk-qemuwrapper-cross ‘!=’ nativesdk-qemuwrapper-cross ‘]’
  • qemu-x86_64 -r 3.2.0 -E LD_LIBRARY_PATH=/home/white/riscv-clx/build/tmp-glibc/work/hx40416_devboard-clx-linux/baseimage/1.0-r0/sdk/image/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-oesdk-linux/usr/lib:/home/white/riscv-clx/build/tmp-glibc/work/hx40416_devboard-clx-linux/baseimage/1.0-r0/sdk/image/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-oesdk-linux/lib -L /home/white/riscv-clx/build/tmp-glibc/work/hx40416_devboard-clx-linux/baseimage/1.0-r0/sdk/image /home/white/riscv-clx/build/tmp-glibc/work/hx40416_devboard-clx-linux/baseimage/1.0-r0/sdk/image/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-oesdk-linux/usr/libexec/nativesdk-gio-querymodules /home/white/riscv-clx/build/tmp-glibc/work/hx40416_devboard-clx-linux/baseimage/1.0-r0/sdk/image/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-oesdk-linux/usr/lib/gio/modules/
    /home/white/riscv-clx/build/tmp-glibc/work/hx40416_devboard-clx-linux/baseimage/1.0-r0/recipe-sysroot//usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-oesdk-linux/usr/bin/crossscripts/nativesdk-qemuwrapper: line 11: qemu-x86_64: command not found

$ which qemu-x86_64

I broke down and installed podman. I built my image using podman but building the SDK still fails due to lack of qemu-x86_64. From log.do_populate_sdk:

NOTE: Running intercept scripts:
NOTE: > Executing update_gio_module_cache-nativesdk intercept …
NOTE: Exit code 127. Output:

  • [ True = False -a nativesdk-qemuwrapper-cross != nativesdk-qemuwrapper-cross ]
  • qemu-x86_64 -r 3.2.0 -E LD_LIBRARY_PATH =/build/tmp-glibc/work/hx40416_devboard-clx-linux/baseimage/1.0-r0/sdk/image/usr/…
    /build/tmp-glibc/work/hx40416_devboard-clx-linux/baseimage/1.0-r0/recipe-sysroot//usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-oesdk-linux/usr/bin/crossscripts/nativesdk-qemuwrapper: 11: qemu-x86_64: not found

A few questions:

  • Why does the SDK need qemu-x86_64 rather than qemu-riscv64 (which is available)?
  • Is there a method for forcing the build of qemu-x86_64? Adding qemu-native doesn’t do it, and adding qemu-x86_64 results in “Nothing PROVIDES ‘qemu-x86_64’”.
  • (To @andersm) How is using a container supposed to resolve this? I can apt install qemu-x86_64 on my Ubuntu box and figure out how to add that to the container - is that what you’re referring to?

OK, figured out building qemu-x86_64. I had specified:

QEMU_TARGETS = “riscv64”

To build the SDK, I added x86_64:

QEMU_TARGETS = “riscv64 x86_64”