Compiling multimedia image, getting error gcc 7.1 for mozjs

Hey,

I tried compiling the multimedia image following the tutorial article in the toradex developer site. I’ve configured everything correctly because bitbake does compile most of everything, but there’s one part where it fails. If I look at the logs for mozjs for firefox there are multiple errors for different functions where it says: “parameter passing for argument of type ‘(various different functions)’ changed in gcc 7.1”.

I think my issue is with regards to the version of gcc that is being used. On my Ubuntu in wsl2 I have gcc version 9.4, but I’m not sure how to check which version bitbake is acctualy using. Does anyone know where to look for that information?

Either it’s using an older version of gcc and I need to tell it to use either 7.1 or 9.4, or it’s using 9.4 and I need to tell it to compile using 7.1.

Would anyone have any suggestions on how to deal with the difference of gcc version I have vs what bitbake is trying to use?

Thank you,

Luc Charbonneau

Hi @SterlingArcher,

Yocto will use the GCC which is installed in your host system. You can check the version of GCC that is being used by Yocto by running:

$ bitbake -e | grep "^GCCVERSION="

It will probably show you something as:

GCCVERSION="9.%"

As you said, the GCC from your system is 9.4, which is being used by Yocto.

Of course, you could try to manually change this value inside your Yocto configuration, but I’m not sure that is going to work. I believe it isn’t possible to install an older version of GCC in newer ubuntu WSLs.

And checking the Yocto documentation, it says

gcc 7.5 or greater

Therefore, using GCC 7.1 is probably not a good idea here.

If you still want to try it, I would recommend using a container with an older version of ubuntu inside of it. For example, you could get an image of older ubuntu, run the container and install everything for Yocto to work inside this container. So inside of it, you would have access to an older gcc version, like 7.1. Then Yocto will get the GCC version from inside the container and try to compile everything.

What exactly are you trying to add to your image? Have you checked if there are recipes or layers to add this feature to your image without this problem?

Best Regards,
Hiago.

That’s good to know thank you. I checked the command you suggested and I see “GCCVERSION=9.%” as you predicted.

At the moment I’m trying to complete the initial tutorial to make sure everything is working, then I’ll start making my modifications. The only thing I changed is in the config file to add that I accept EULA and which default image I want to build, which is the multimedia reference image. I didn’t touch anything else so it’s vanilla straight from toradex repo.

Ultimately I just want the basic build to work in the easiest way possible. I’m happy just using the newest version of gcc, but I’m not sure how to resolve the error. I saw a reference online that you could tell the compiler to ignore the error, but I’m not sure if that would cause more issues down the line. Like you said though it requires gcc 7.5 or greater so maybe it would be okay?

Hi @SterlingArcher,

So are you trying the multimedia image without any modifications (the EULA here is required, so I’m not counting it as a modification) and you’re getting this error?

This shouldn’t happen. Please, can you check if you followed all the steps from the guide below?

Also, can you check if you installed all Yocto dependencies?

$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev

Best Regards,
Hiago.

Hey Hiago,

I tried to install the dependencies again like the ones you suggested but it didn’t work. I entered the exact command you gave. I then tried to delete the entire oe-core folder to start over, but now I can’t download the repo anymore.

When I enter the following command in the oe-core/ folder, I get an error where it says that a new version of repo (2.29) is available and that I should upgrade soon.

repo init -u Index of /toradex-manifest.git -b dunfell-5.x.y -m tdxref/default.xml

I checked and I am using repo version 2.38.1. I tried deleting repo as well all together and re-install repo as per the instructions in the guide you provided, which I was following previously, and I am able to install it. I still get the same error.

I’m not sure I understand what’s happening because I didn’t get this issue originally. I was able to sync the repo and execute bitbake and all that. Now I can’t even get past initializing the repo. Would you have any ideas?

Gonna keep trying to fix this in the mean time.

Sorry, it looks like I am running git version 2.38.1, but getting the repo version it gives me this:

oe-core$ repo --version

... A new version of repo (2.29) is available.
... You should upgrade soon:
    cp /home/sterlinga/galaxia/galaxia-os/oe-core/.repo/repo/repo /home/sterlinga/bin/repo

repo version v2.29.4
       (from https://gerrit.googlesource.com/git-repo)
       (tracking refs/heads/stable)
       (Tue, 25 Oct 2022 22:46:47 +0000)
repo launcher version 2.21
       (from /home/sterlinga/bin/repo)
       (currently at 2.29.4)
repo User-Agent git-repo/2.29.4 (Linux) git/2.38.1 Python/3.8.10
git 2.38.1
git User-Agent git/2.38.1 (Linux) git-repo/2.29.4
Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0]
OS Linux 5.4.72-microsoft-standard-WSL2 (#1 SMP Wed Oct 28 23:40:43 UTC 2020)
CPU x86_64 (x86_64)
Bug reports: https://bugs.chromium.org/p/gerrit/issues/entry?template=Repo+tool+issue

Hi @SterlingArcher,

I think there are some errors going on due to WSL or something that isn’t fully supported.

Checking the Yocto Documentation, we can check what distros are supported:

Ubuntu 18.04 (LTS)
Ubuntu 20.04 (LTS)
Ubuntu 22.04 (LTS)
Fedora 34
Fedora 35
AlmaLinux 8.5
Debian GNU/Linux 10.x (Buster)
Debian GNU/Linux 11.x (Bullseye)
OpenSUSE Leap 15.3

I’m not sure whether WSL might be causing something or not. It’s very strange it’s trying to compile firefox even though we don’t have anything related to firefox in our images.

Therefore, I would recommend you test the article Build a Reference Image with Yocto Project/OpenEmbedded | Toradex Developer Center inside a virtual machine with Ubuntu 20.04 or run it inside a Docker container running Ubuntu 22.04 to check if you see the same errors.

If you want to try the Docker image, I can send you a guide on how to use Docker to build your Yocto images inside of it.

Best Regards,
Hiago.

Hey,

I didn’t realize that the log was suggesting that I use this command to resolve the issue: “cp /home/sterlinga/galaxia/galaxia-os/oe-core/.repo/repo/repo /home/sterlinga/bin/repo”. I executed it and the version issue went away.

Once I deleted the repo folder and started over then I was back to being able to run Bitbake. I’m still getting the original error, but considering that there is no need for firefox to be there it isn’t a critical error, I will ignore this error and carry on; we are designing a headless computer anyways.

Thank you for your help.