ccrisan/thingos

Use official toolchain for all Raspberry Pi builds

jasaw opened this issue · 4 comments

jasaw commented

Current Raspberry Pi builds are using buildroot's toolchain, which is causing Raspberry Pi vcdbg to fail, because vcdbg is closed-source and provided as a binary. Other precompiled /opt/vc binaries including libraries in RPi firmware have the same problem.

In order to get the precompiled binaries to work, we need to use the official RPi toolchain.

It is probably worth providing all the /opt/vc binaries, similar to Raspbian.

@jasaw I had a few spare days and managed to take care of various tasks I had planned for thingOS as well as motionEyeOS.

Now regarding this particular issue, what is the root cause of the problem? I don't think that changing the toolchain would make a significant difference.

Back in the day I wanted to have an OS image as small as possible and so I removed various files and directories that did not seem to be used. The RPi-specific cleanups.sh removes /opt/vc/src and /opt/vc/include (after building everything, from the very final target filesystem). Can this be related?

So what is this problem really about, as I can't seem to find any errors in building the currently selected packages?

jasaw commented

@ccrisan I'm not 100% sure the official toolchain is the root cause of vcdbg failing to run. The previous time (more than 1 year ago) I built my own RPi Linux image from buildroot, I had to configure buildroot to use external toolchain, and point it to the official toolchain. I haven't checked whether there's a mismatch in our toolchain config vs the official toolchain.

On second thought, vcdbg failing to run may also be caused by mismatch of rpi-firmware version vs our kernel or toolchain. I noticed you have updated ThingOS's buildroot. May be worth trying vcdbg again, see if it's fixed.

Regarding the RPi cleanups.sh, vcdbg is provided by rpi-firmware as a binary only, so removing source and include files won't cause any problem. You also won't get any compile time errors because it's a binary. As you can see, running a pre-compiled binary can be problematic because we need to provide the same runtime environment in order to run it.

Can you try and see if the problem is still there with the current dev branch (either motionEyeOS or thingOS)?I'm planning on switching to an external toolchain for RPi as well, at least for the sake of reduced build time. At least RPi2 and RPi3 should behave well when compiled with linaro or similar.

jasaw commented

@ccrisan Sorry about the late reply. I have just tested vcdbg on version 20180101, and it's working now. I'm going to close this issue as vcdbg works without changing to external toolchain.