3 ms·
Currently, dotnet is able to build binaries for Linux that only depend on the following libraries (hello world app, according to readelf -d): - libcstdc++.so.6
by jeroenhd 5y ago
Currently, dotnet is able to build binaries for Linux that only depend on the following libraries (hello world app, according to readelf -d):
- libcstdc++.so.6
- libm.so.6
- libgcc_s.so.1
- libc.so.6
You can also exchange some dependencies by compiling with profile linux-musl-x64 instead of linuxe-x64 (no libc, no libm, but with libc.musl-x86_64.so.1) to shrink everything down to the bare minimum.
While this isn't a completely statically linked executable, I think it's all you need for most distributions. The important part is that you don't need to install any runtimes on the remote machine to run the executable.
I'd love for dotnet to also get static compilation options to get rid of the last few dependencies but when your goal is to just distribute the binary so others can run it, I think dotnet is already there.
- pjc50 5y agoIt's remarkably hard to ditch dynamic loading completely when using GNU libc, even when writing directly in C. A surprising range of POSIX functions require it - anything touching usernames, for example, requires it in case it's running on a complex PAM setup.