Fully-statically compiled binaries are those that have no shared object dependencies at all. They include a full working copy of libc inside their own ELF container and do not need to load any other shared objects. You can try ldd to see if this is the case:
$ ldd name-of-binary
statically linked
or
$ ldd name-of-binary
not a dynamic executable
I have added tests/integration/amd64_musl_fullstatic and tests/integration/arm64_musl_fullstatic which includes fully-statically-compiled versions of "hello world", linked against musl-libc and compiled as position-independent-executables.
This issue exists to track progress for fixing this case in retrowrite, which currently fails.
Things you might want to know if replicating:
Static compilation with glibc is almost not supported any more. Some distributions (Fedora) do not provide static libc objects at all. Others (Ubuntu) do. The libc will need to be compiled as -pie; I am not aware of the status of ubuntu's libc-static-dev.
musl-cross-make with --enable-default-pie is the easiest method I have found for this kind of thing.
You will need to be sure to pass -static -Bstatic -pie -fPIC when linking and -fpic when compiling.
Fully-statically compiled binaries are those that have no shared object dependencies at all. They include a full working copy of libc inside their own ELF container and do not need to load any other shared objects. You can try
ldd
to see if this is the case:or
I have added
tests/integration/amd64_musl_fullstatic
andtests/integration/arm64_musl_fullstatic
which includes fully-statically-compiled versions of "hello world", linked against musl-libc and compiled as position-independent-executables.This issue exists to track progress for fixing this case in retrowrite, which currently fails.
Things you might want to know if replicating:
--enable-default-pie
is the easiest method I have found for this kind of thing.-static -Bstatic -pie -fPIC
when linking and-fpic
when compiling.