Hi,
configure.ac under "Checks for library functions" has
AC_FUNC_FORK
AC_FUNC_MALLOC
Using a cross toolchain under linux AC_FUNC_MALLOC is tested on the build architecture,
fails, and adds a replacement rpl_malloc which is not in the library, producing a broken libmodbus.so.
AC_FUNC_FORK tests for fork() and vfork(), never used in libmodbus.
Please delete these tests from
configure.ac, they are wrong and actively harmful.
Also the AC_CHECH_FUNCS([ ... memset ...]) is not really used, the library never uses HAS_MEMSET,
and memset must be available for gcc even in freestanding environments.
If accepted I can submit a github pull request to libmodbus.
Best regards.
Fabio