Clang cannot find -lgcc when building PJSIP on TwinCAT/BSD (FreeBSD 14.3-RELEASE-p4)

Hello everyone,
I am trying to build PJSIP 2.15.1 on a Beckhoff TwinCAT/BSD system.
My device is running:

FreeBSD 14.3-RELEASE-p4
I always get the same error when running ./configure:

checking for gcc... /usr/local/llvm19/bin/clang
checking whether the C compiler works... no
configure: error: C compiler cannot create executables
In config.log I see:

ld: error: unable to find library -lgcc
clang: error: linker command failed with exit code 1
However, GCC 13 is installed and the files do exist:

/usr/local/lib/gcc13/libgcc_s.so
/usr/local/lib/gcc13/libgcc_s.so.1
But clang does not find them automatically during linking.
Additional details:
cc --version → clang 19.1.7
/usr/local/lib/gcc13/ contains libgcc files
./configure always fails with "C compiler cannot create executables"

My question:
Is it possible to build PJSIP natively on TwinCAT/BSD ?
Or is this FreeBSD variant missing the required GNU toolchain components (libgcc, ld, build tools)?
Should I manually update ldconfig_paths, or is the recommended method to rebuild or reinstall the base system using tcbsd-update / tcbsd-install?
If TwinCAT/BSD cannot support PJSIP compilation, what is the recommended workflow?
Any official guidance or recommended solution would be very helpful.

Thank you:)
 
Back
Top