Creating Static Binary
If fdisk is just an example and your goal is really to make static executables from dynamic executables, try Elf statifier. There's even a comparison with Ermine (by the Ermine vendor, so caveat (non-)emptor). Note that
- If you have many executables, their combined size is likely to be more than the combined size of the dynamically-linked executables plus the necessary dynamic libraries.
- There are features of GNU libc that may not work in a statically-linked executables, such as NSS (databases of user names, host names, etc.) and locale-related features.
If your goal is to have a small, portable suite of system tools, you're looking for BusyBox, a suite of core tools intended for embedded systems (including fdisk
). You may also be interested in a smaller standard library than Glibc, for example dietlibc or µClibc.