-DBUILD_SHARED_LIBS=OFF -DCMAKE_EXE_LINKER_FLAGS="-static"
. It compiled with the following warning:
CMakeFiles/engine-shared.dir/src/base/system.c.o: In function `net_host_lookup':
system.c:(.text+0x3a92): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
The server crashes when trying to resolve DNS names of the masters.
This seems to be an issue with glibc, so I tried compiling against Musl, with the following result:
In file included from /src/src/base/hash.c:4:0:
/src/src/base/system.h:767:17: error: array type has incomplete element type 'struct mmsghdr'
struct mmsghdr msgs[VLEN];
^~~~
make[3]: *** [CMakeFiles/engine-shared.dir/build.make:558: CMakeFiles/engine-shared.dir/src/base/hash.c.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:929: CMakeFiles/engine-shared.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:1254: CMakeFiles/DDNet-Server.dir/rule] Error 2
make: *** [Makefile:589: DDNet-Server] Error 2
Any ideas on how to procede, or which error is the easier one to fix?gcr.io/distroless/static
which only is a few MB in size