app build error on rpi but not desktop 13.2

Hi all. As part of my QA for a large C++ app I always include testing on freebsd.

To test with 13.2-RELEASE I did a fresh install on an amd pc. Loaded and built with lang/gcc. All good, builds and runs fine.

For fun, did the exact same on a RPi model 4. Compiles and builds fine but trying to run fails with

Code:
ld-elf.so.1: /lib/libgcc_s.so.1: version GCC_4.5.0 required by /usr/local/lib/gcc12/libstdc++.so.6 not found

Any ideas why the pi would be any different?
 
I'd rather wonder why it works on amd64. The GCC ports come with their own runtime libs. The message you get hints that the dynamic linker found libstdc++.so.6, but trying to resolve libgcc_s.so.1 finds the one from base instead of the one offered by the GCC port used.

When building software that really requires GCC, it should be done from a port with USE_GCC= yes, which would then enforce an rpath to the respective GCC runtime directory, so this is searched first for libs, see here: https://cgit.freebsd.org/ports/tree/Mk/bsd.gcc.mk#n103

Take a step back: Why do you use GCC in the first place? If ever possible, build your software with the compiler from base instead, which is llvm/clang. If there's really a reason to require GCC, create a port for your software, or make sure to add the necessary rpath yourself when building manually.
 
Back
Top