I can well hack this on the CI, but this will be a general problem for anybody that want to install a self-compiled version with GCC.
To be honest, I only roughly understand all this ATM. I lack some knowledge to get the details. But I think it's not really the reason.The root cause is the fact what the linker does when building a shared library and when installing it. When you run make to build the binaries then the linker adds the RUNPATH entry that contains a list of the paths to the shared libraries the binary depends on. This explains why you can directly run an application without having to set LD_LIBRARY_PATH fiirst.
When installing the binaries then the linker does some re-linking and cleans up the RUNPATH section again of the target file.
Notice both versions (Clang and GCC) use the same linker (namely 'ld').
Anyway, there is a very weird thing. I tried to swap the installed 'PathApp.so' between my GCC and Clang VMs, and failure "follows" the GCC compiled lib :
- Clang compile+install / original Clang 'PathApp.so' => Works
- Clang compile+install / replaced GCC 'PathApp.so' => Fails
- Clang compile+install / replaced GCC 'PathApp.so' / Add 'LD_LIBRARY_PATH' at runtime => Works
- GCC compile+install / original GCC 'PathApp.so' => Fails
- GCC compile+install / original GCC 'PathApp.so' / Add 'LD_LIBRARY_PATH' at runtime => Works
- GCC compile+install / replaced Clang 'PathApp.so' => Works
EDIT : BTW, the RUNPATH is correct in installed 'FreeCAD' binary and 'Import.so' for both versions, pointing to '/usr/local/lib/'