Building static Python binary

mk mrkafk at gmail.com
Mon Oct 26 12:22:13 EDT 2009


P.S.

If I add -static to LDFLAGS in Makefile, I get this:

gcc -pthread -static  -Xlinker -export-dynamic -o python \
                         Modules/python.o \
                         libpython2.6.a -lpthread -ldl  -lutil 
-L/usr/local/ssl/lib -lssl -lcrypto   -lm
libpython2.6.a(dynload_shlib.o): In function `_PyImport_GetDynLoadFunc':
/var/www/html/tmp/Python-2.6.2/Python/dynload_shlib.c:130: warning: 
Using 'dlopen' in statically linked applications requires at runtime the 
shared libraries from the glibc version used for linking
libpython2.6.a(posixmodule.o): In function `posix_tmpnam':
/var/www/html/tmp/Python-2.6.2/./Modules/posixmodule.c:7129: warning: 
the use of `tmpnam_r' is dangerous, better use `mkstemp'
libpython2.6.a(posixmodule.o): In function `posix_tempnam':
/var/www/html/tmp/Python-2.6.2/./Modules/posixmodule.c:7084: warning: 
the use of `tempnam' is dangerous, better use `mkstemp'
libpython2.6.a(pwdmodule.o): In function `pwd_getpwall':
/var/www/html/tmp/Python-2.6.2/./Modules/pwdmodule.c:157: warning: Using 
'getpwent' in statically linked applications requires at runtime the 
shared libraries from the glibc version used for linking
libpython2.6.a(pwdmodule.o): In function `pwd_getpwnam':
/var/www/html/tmp/Python-2.6.2/./Modules/pwdmodule.c:131: warning: Using 
'getpwnam' in statically linked applications requires at runtime the 
shared libraries from the glibc version used for linking
libpython2.6.a(pwdmodule.o): In function `pwd_getpwuid':
/var/www/html/tmp/Python-2.6.2/./Modules/pwdmodule.c:110: warning: Using 
'getpwuid' in statically linked applications requires at runtime the 
shared libraries from the glibc version used for linking
libpython2.6.a(pwdmodule.o): In function `pwd_getpwall':
/var/www/html/tmp/Python-2.6.2/./Modules/pwdmodule.c:156: warning: Using 
'setpwent' in statically linked applications requires at runtime the 
shared libraries from the glibc version used for linking
/var/www/html/tmp/Python-2.6.2/./Modules/pwdmodule.c:167: warning: Using 
'endpwent' in statically linked applications requires at runtime the 
shared libraries from the glibc version used for linking
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `get_rc_clockskew':
(.text+0xe1): undefined reference to `krb5_rc_default'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `get_rc_clockskew':
(.text+0xfc): undefined reference to `krb5_rc_initialize'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `get_rc_clockskew':
(.text+0x122): undefined reference to `krb5_rc_get_lifespan'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `get_rc_clockskew':
(.text+0x13c): undefined reference to `krb5_rc_destroy'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_validate_times':
(.text+0x174): undefined reference to `krb5_init_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_validate_times':
(.text+0x197): undefined reference to `krb5_timeofday'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_validate_times':
(.text+0x1ba): undefined reference to `krb5_free_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_krb5_free_data_contents':
(.text+0x241): undefined reference to `krb5_free_data_contents'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_tgt_is_available':
(.text+0x2ba): undefined reference to `krb5_init_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_tgt_is_available':
(.text+0x2d6): undefined reference to `krb5_free_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_tgt_is_available':
(.text+0x2ec): undefined reference to `krb5_free_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_tgt_is_available':
(.text+0x2fb): undefined reference to `krb5_free_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_tgt_is_available':
(.text+0x33b): undefined reference to `krb5_sname_to_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_tgt_is_available':
(.text+0x355): undefined reference to `krb5_cc_default'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_tgt_is_available':
(.text+0x376): undefined reference to `krb5_cc_get_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_tgt_is_available':
(.text+0x3a8): undefined reference to `krb5_get_credentials'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x415): undefined reference to `krb5_init_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x43e): undefined reference to `krb5_kt_resolve'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x47a): undefined reference to `krb5_sname_to_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x4a7): undefined reference to `krb5_kt_get_entry'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x4ca): undefined reference to `krb5_kt_close'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x4e0): undefined reference to `krb5_free_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x4ef): undefined reference to `krb5_free_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x508): undefined reference to `krb5_kt_free_entry'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_keytab_is_available':
(.text+0x51e): undefined reference to `krb5_kt_default'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `populate_cksumlens':
(.text+0xae7): undefined reference to `valid_cksumtype'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `populate_cksumlens':
(.text+0xb11): undefined reference to `krb5_checksum_size'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `populate_cksumlens':
(.text+0xb4a): undefined reference to `krb5_checksum_size'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x1701): undefined reference to `krb5_init_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x173d): undefined reference to `krb5_sname_to_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x179e): undefined reference to `krb5_free_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x17b7): undefined reference to `krb5_free_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x17cd): undefined reference to `krb5_auth_con_free'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x17dc): undefined reference to `krb5_free_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x17fe): undefined reference to `krb5_cc_default'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x1820): undefined reference to `krb5_cc_get_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x18e1): undefined reference to `krb5_get_credentials'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_cget_tkt':
(.text+0x1965): undefined reference to `krb5_mk_req_extended'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1ce7): undefined reference to `krb5_auth_con_free'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1d13): undefined reference to `krb5_auth_con_init'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1d4c): undefined reference to `krb5_kt_close'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1d65): undefined reference to `krb5_free_ticket'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1d7e): undefined reference to `krb5_free_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1dae): undefined reference to `krb5_auth_con_getrcache'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1dee): undefined reference to `krb5_sname_to_principal'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1e22): undefined reference to `krb5_auth_con_setrcache'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1e53): undefined reference to `krb5_kt_resolve'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1f7d): undefined reference to `krb5_init_context'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x1fce): undefined reference to `krb5_get_server_rcache'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x2021): undefined reference to `krb5_principal_compare'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x20a9): undefined reference to `krb5_kt_default'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x2109): undefined reference to `krb5_kt_get_entry'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x217f): undefined reference to `krb5_decrypt_tkt_part'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libssl.a(kssl.o): In 
function `kssl_sget_tkt':
(.text+0x21a5): undefined reference to `krb5_kt_free_entry'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(c_zlib.o): In 
function `zlib_stateful_expand_block':
(.text+0x146): undefined reference to `inflate'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(c_zlib.o): In 
function `zlib_stateful_compress_block':
(.text+0x1d6): undefined reference to `deflate'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(c_zlib.o): In 
function `zlib_stateful_init':
(.text+0x2c0): undefined reference to `inflateInit_'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(c_zlib.o): In 
function `zlib_stateful_init':
(.text+0x32a): undefined reference to `deflateInit_'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(c_zlib.o): In 
function `zlib_stateful_free_ex_data':
(.text+0x42e): undefined reference to `inflateEnd'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(c_zlib.o): In 
function `zlib_stateful_free_ex_data':
(.text+0x439): undefined reference to `deflateEnd'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(fipscanister.o): 
In function `FIPS_mode_set':
(.text+0xb5c): undefined reference to `dladdr'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(fipscanister.o): 
In function `FIPS_mode_set':
(.text+0xb68): undefined reference to `dlclose'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(fipscanister.o): 
In function `FIPS_mode_set':
(.text+0xbbc): undefined reference to `dlclose'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(dso_dlfcn.o): 
In function `dlfcn_unload':
(.text+0x495): undefined reference to `dlclose'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(dso_dlfcn.o): 
In function `dlfcn_load':
(.text+0x60a): undefined reference to `dlclose'
collect2: ld returned 1 exit status
make: *** [python] Error 1





More information about the Python-list mailing list