I want to build screen static, so that I can use it as standalone binary on embed devices.
screen-4.2.1# ./configure LDFLAGS="-static" && make
I got this warning:
/screen.c:933: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
the reason for this is answered over here. So it is not possible to use "getpwnam" an some other functions out of glibc within a static linked binary, if i understand this right.
So my question is. Is there any way to build screen static (because I'm actually cant believe there isn't), and if not is there a good replacement which can be build static?
Is there any way to build screen static
Sure: just ignore the warning and voila, you have a fully-static screen
.
Now, that fully-static screen will not work when moved to a system with different version of GLIBC
, and so is useless for that purpose.
In general, contrary to popular belief, fully-static binaries are less portable than dynamic ones on UNIX systems. Your desire to build such fully-static binary is very likely misguided.
if not is there a good replacement which can be build static?
You could try using alternate libc
implementations, such uClibc
or dietlibc
, which may not place such a restriction on fully-static binaries.