Hi there,
Im trying to statically link to musl.
nim c --gcc.exe:musl-gcc --gcc.linkexe:musl-gcc --passL:-static -d:release --threads:on -o:build/server devel/backend.nim
but then I get this warning:
warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
also when I leave the --passL:-static and run it on a system with older glibc I get:
version `GLIBC_2.33' not found
so --gcc.exe and --gcc.linkexe dont seem to work. I also tried to put some random text istead of musl-gcc and got no error so they seem to just do nothing
I tried nim version 1.6.4, 1.6.6 and 1.6.8
Any ideas?
looks like one lib your app depend on is linked with glibc dynamic and it was not built with musl statically as you wanted. (Maybe libnss ) as suggested in different occasion with same error.
Not sure which linux you are using but i will suggest using a fully musl built linux distro like alpine or void-linux to make sure all static build libs are available for linking and not to mix with gcc dynamic library
I also tried to put some random text istead of musl-gcc and got no error so they seem to just do nothing
Are you sure you're set Nim to use GCC? For example on macOS the default is clang. Try also adding --cc:gcc in addition to your flags. And yeah, if you're using httpclient for anything SSL you'll have to statically compile OpenSSL (or LibreSSL) yourself