Closed chris-hld closed 10 months ago
Hi there.
Thanks for the fix regarding the signals. I'll make that change.
I'm able to successfully build on 32 bit Bookworm with clang. Does your system have the libraspberrypi-dev
package installed? I'll have to stand up a 64-bit system to test your setup.
GCC has the same undefined references for me on 32-bit. Not sure what that's about, I checked to see that /usr/lib/arm-linux-gnueabihf/libbcm_host.so
is in it's library path, but either way GCC won't link even if it found that lib since it doesn't have the __rbit intrinsic.
Alright, it seems it was a bug in clang-14, which is the current default with apt install clang
.
Updating to clang-15 resolved the crashes, luckily available with apt install clang-15
.
What remains is the linker warning
clang-15 -L /opt/vc/lib -lbcm_host -lm -lvcos -lpthread -lstdc++ build/source/memory.c.o build/source/bcm283x/bcm283x_pcm.c.o build/source/bcm283x/bcm283x_dma.c.o build/source/bcm283x/bcm283x.c.o build/source/bcm283x/bcm283x_gpio.c.o build/source/bcm283x/bcm283x_clock.c.o build/source/log.c.o build/source/mailbox.c.o build/source/main.c.o build/source/spdif.c.o -o build/raspdif
/usr/bin/ld: skipping incompatible /opt/vc/lib/libbcm_host.so when searching for -lbcm_host
/usr/bin/ld: skipping incompatible /opt/vc/lib/libvcos.so when searching for -lvcos
But it seems to be fine.
There must be a compatible libbcm_host on the system somewhere otherwise linking would fail.
What is the output of find / -name "libbcm_host*" 2> /dev/null
/usr/lib/aarch64-linux-gnu/libbcm_host.so
/usr/lib/aarch64-linux-gnu/libbcm_host.so.0
/opt/vc/lib/libbcm_host.so
where libbcm_host.so
is just a symlink to libbcm_host.so.0
.
Seems like the two in /opt/
and /ust/lib/
are different?
I'm not sure which package delivered each, it might have been libraspberrypi-dev
and I think /opt/
came from an rpi-update
.
It mentions that https://github.com/raspberrypi/userland no longer ship with Pi OS Bookworm.
Either way, for the moment, everything seems to be working!
Well at least it's working. Looks like I might have to reconsider how the project interfaces with the hardware sooner than later.
You can use dpkg -S <file>
to see which package provided the library.
e.g.
$ dpkg -S /usr/lib/arm-linux-gnueabihf/libbcm_host.so.0
libraspberrypi0:armhf: /usr/lib/arm-linux-gnueabihf/libbcm_host.so.0
Ah, nice:
libraspberrypi0:arm64: /usr/lib/aarch64-linux-gnu/libbcm_host.so.0
dpkg-query: no path found matching pattern /opt/vc/lib/libbcm_host.so
So this also seems to indicate that /opt/vc/lib/libbcm_host.so
comes not from a package repository.
So this also seems to indicate that
/opt/vc/lib/libbcm_host.so
comes not from a package repository.
Possibly, or maybe the tool isn't perfect.
Anyway glad you're up and running.
Closing the issue, might be worth to add a small comment in the readme about compilation on recent Pi OS.
Thank you for this amazing project!
I had some trouble getting it compiled on the latest raspberry pi OS (Debian bookworm) - on a pi model 3B, 64 bit.
First, clang seems crashing with
Then I also noticed that at least my os didn't come with
/opt/vc/lib
. After installing, I tried switching to gcc and got aI replaced the deprecated latter with
GCC compiles, but wouldn't link
Also installed a system libbcm_host, which doesn't complain about beein incompatible, but would still result in the same undefined references. Not sure what's going on there. However, running then clang again wouldn't crash and even link successfully. So far the binaries seem to work flawlessly, but I was wondering if it's worth having a look into this?