You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C lib and other dependencies will require you to build those libs as static and modify the make file to use those static libs. This would be more common in an embedded library context. You are building the defaults in linux, so the shared libs are being pulled in.
$make LDFLAGS="-static -all-static -Lwolfssl/install/lib" examples/echoserver/echoserver
CC examples/echoserver/echoserver.o
CC src/libwolfssh_la-ssh.lo
CC src/libwolfssh_la-internal.lo
CC src/libwolfssh_la-log.lo
CC src/libwolfssh_la-io.lo
CC src/libwolfssh_la-port.lo
CC src/libwolfssh_la-wolfscp.lo
CC src/libwolfssh_la-wolfsftp.lo
CC src/libwolfssh_la-wolfterm.lo
CCLD src/libwolfssh.la
CCLD examples/echoserver/echoserver
/usr/bin/ld: examples/echoserver/echoserver.o: in function `echoserver_test':
echoserver.c:(.text+0x2910): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
$ ldd examples/echoserver/echoserver
not a dynamic executable
However, glibc have an issue with using getpwnam statically, which can be solved by using musl instead of glibc, e.g
However echoserver does not compile cleanly on musl, you have to replace #include <sys/errno.h> with #include <errno.h> to compile on musl. And that is actually an issue in the wolfssh code: historically many systems used sys/errno.h , but the C standard always, since C89, said it was errno.h, so unless you need to support pre-C89 compilers, yeah.. imma open a PR for that
Activity
embhorn commentedon Nov 13, 2025
Hello @divinity76
Thanks for contacting wolfSSL Support. Could you tell us a bit about your project?
The example does use external libs. The math lib dependency can be removed by configuring wolfSSL:
The C lib and other dependencies will require you to build those libs as static and modify the make file to use those static libs. This would be more common in an embedded library context. You are building the defaults in linux, so the shared libs are being pulled in.
Let us know if you have further questions.
Thanks,
@embhorn
divinity76 commentedon Nov 18, 2025
got it static by bypassing the makefile with
✅
divinity76 commentedon Nov 22, 2025
Found a better way that does not bypass makefile:
getpwnamstatically, which can be solved by using musl instead of glibc, e.gHowever echoserver does not compile cleanly on musl, you have to replace
#include <sys/errno.h>with#include <errno.h>to compile on musl. And that is actually an issue in the wolfssh code: historically many systems used sys/errno.h , but the C standard always, since C89, said it waserrno.h, so unless you need to support pre-C89 compilers, yeah.. imma open a PR for that