How to compile a static binary?
I am trying to compile a static binary of cryptsetup-1.0.6 from source for use within the initial ram disk (initrd). The commands "configure && make && make install" will compile a dynamically linked executable, but what are the correct commands to compile a static binary "cryptsetup.static"?
I assume it is "configure --enable-static" before invoking make && make install. The only problem is that in this case the make script spits out some error that the gcc tried to link a dynamic object libgcrypt.so. |
-static-libgcc
go through the above option in "man gcc" |
Here's the actual error that make spits out when using "configure --enable-static":
Quote:
|
try
make install |
Anyone?
I have noticed that my system lacked the two problematic static libraries - libgcrypt.a and libgpg-error.a - which the GCC tried to link their dynamic versions. I think I fixed the absence by downloading both libs from GnuPG website and compiling them from source using the standard "configure && make && make install" routine. Trying to compile cryptsetup-1.0.6 with "configure --enable-static", make spits out this new error: Quote:
|
Quote:
to create from dynamically linked file self-contained executable with all needed shared libraries. |
All times are GMT -5. The time now is 08:50 PM. |