We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
E.g., using
TOOL = /opt/rpi/arm-gcc/bin $(TOOL)/arm-none-linux-gnueabihf-ld.gold
where /opt/rpi/arm-gcc is the contents of gcc-arm-10.2-2020.11-x86_64-arm-none-linux-gnueabihf.tar.xz, I get this output:
Attempt to open /opt/rpi/sysroot/opt/vc/lib/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/lib/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/arm-linux-gnueabihf/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/lib/libbcm_host.a failed Attempt to open /opt/rpi/sysroot/usr/lib/libbcm_host.a failed error: cannot find -lbcm_host
So it's only looking for .a libs instead of finding /opt/rpi/sysroot/opt/vc/lib/libbcm_host.so, which exists. I'm passing -Bdynamic to the linker, what am I missing?
...which means there wasn't an issue with the linker directly, but rather the makefile. After reviewing some wrong paths I added -fpie -fPIE to the compiler options and -pie to the linker options and the linker went for dynamic libraries,