curl-library
Re: warning when static build curl
Date: Tue, 19 Jul 2011 17:37:08 +0800
Sorry I didn't make it clear earlier.
It results to the same warning when I compile libcurl. Looks like this:
libtool: link: gcc -g0 -O2 -Wno-system-headers -static -o curl main.o
hugehelp.o urlglob.o writeout.o writeenv.o getpass.o homedir.o curlutil.o
os-specific.o xattr.o strtoofft.o strdup.o rawstr.o nonblock.o
../lib/.libs/libcurl.a -lidn -lssl -lcrypto -ldl -lrt
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libcrypto.a(dso_dlfcn.o): In
function `dlfcn_load':
dso_dlfcn.c:(.text+0x667): warning: Using 'dlopen' in statically linked
applications requires at runtime the shared libraries from the glibc version
used for linking
homedir.o: In function `homedir':
homedir.c:(.text+0x6c): warning: Using 'getpwuid' in statically linked
applications requires at runtime the shared libraries from the glibc version
used for linking
../lib/.libs/libcurl.a(curl_addrinfo.o): In function `Curl_getaddrinfo_ex':
curl_addrinfo.c:(.text+0x2de): warning: Using 'getaddrinfo' in statically
linked applications requires at runtime the shared libraries from the glibc
version used for linking
And when I programming above curl, I link libcurl.a only without link
libssl.a . It comes to error like this:
../../baselib/libcurl/release/linux-i386/libcurl.a(strerror.o): In function
`Curl_idn_strerror':
strerror.c:(.text+0x2db): undefined reference to `idna_strerror'
../../baselib/libcurl/release/linux-i386/libcurl.a(url.o): In function
`fix_hostname':
url.c:(.text+0xe6e): undefined reference to `stringprep_check_version'
url.c:(.text+0xe93): undefined reference to `idna_to_ascii_lz'
url.c:(.text+0xe9a): undefined reference to `stringprep_locale_charset'
url.c:(.text+0xed3): undefined reference to `idna_to_unicode_lzlz'
url.c:(.text+0xf34): undefined reference to `tld_check_lz'
url.c:(.text+0xf49): undefined reference to `idn_free'
url.c:(.text+0xf53): undefined reference to `tld_strerror'
../../baselib/libcurl/release/linux-i386/libcurl.a(url.o): In function
`Curl_disconnect':
url.c:(.text+0x1689): undefined reference to `idn_free'
url.c:(.text+0x169b): undefined reference to `idn_free'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`Curl_ossl_version':
ssluse.c:(.text+0xc): undefined reference to `SSLeay'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`Curl_ossl_data_pending':
ssluse.c:(.text+0x262): undefined reference to `SSL_pending'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`x509_name_oneline':
ssluse.c:(.text+0x387): undefined reference to `BIO_s_mem'
ssluse.c:(.text+0x38f): undefined reference to `BIO_new'
ssluse.c:(.text+0x3b6): undefined reference to `X509_NAME_print_ex'
ssluse.c:(.text+0x3d8): undefined reference to `BIO_ctrl'
ssluse.c:(.text+0x406): undefined reference to `BIO_free'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`cert_verify_callback':
ssluse.c:(.text+0x440): undefined reference to
`X509_STORE_CTX_get_current_cert'
ssluse.c:(.text+0x448): undefined reference to `X509_get_subject_name'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`SSL_strerror':
ssluse.c:(.text+0x755): undefined reference to `ERR_error_string_n'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`asn1_object_dump':
ssluse.c:(.text+0x7a5): undefined reference to `i2t_ASN1_OBJECT'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`verifyhost':
ssluse.c:(.text+0xb33): undefined reference to `X509_get_ext_d2i'
ssluse.c:(.text+0xb45): undefined reference to `sk_num'
ssluse.c:(.text+0xb6b): undefined reference to `sk_value'
ssluse.c:(.text+0xb92): undefined reference to `GENERAL_NAMES_free'
ssluse.c:(.text+0xbe1): undefined reference to `GENERAL_NAMES_free'
ssluse.c:(.text+0xbf3): undefined reference to `X509_get_subject_name'
ssluse.c:(.text+0xc1a): undefined reference to `X509_NAME_get_index_by_NID'
ssluse.c:(.text+0xc2e): undefined reference to `X509_NAME_get_entry'
ssluse.c:(.text+0xc36): undefined reference to `X509_NAME_ENTRY_get_data'
ssluse.c:(.text+0xc44): undefined reference to `ASN1_STRING_type'
ssluse.c:(.text+0xc5c): undefined reference to `ASN1_STRING_to_UTF8'
ssluse.c:(.text+0xd0f): undefined reference to `CRYPTO_free'
ssluse.c:(.text+0xd24): undefined reference to `ASN1_STRING_data'
ssluse.c:(.text+0xd32): undefined reference to `ASN1_STRING_length'
ssluse.c:(.text+0xd8e): undefined reference to `GENERAL_NAMES_free'
ssluse.c:(.text+0xdf6): undefined reference to `ASN1_STRING_length'
ssluse.c:(.text+0xe1d): undefined reference to `CRYPTO_malloc'
ssluse.c:(.text+0xe30): undefined reference to `ASN1_STRING_data'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`servercert':
ssluse.c:(.text+0xeec): undefined reference to `SSL_get_peer_certificate'
ssluse.c:(.text+0xf39): undefined reference to `SSL_get_peer_cert_chain'
ssluse.c:(.text+0xf4b): undefined reference to `sk_num'
ssluse.c:(.text+0xfeb): undefined reference to `sk_value'
ssluse.c:(.text+0xff9): undefined reference to `X509_get_subject_name'
ssluse.c:(.text+0x1060): undefined reference to `X509_get_issuer_name'
ssluse.c:(.text+0x10c1): undefined reference to `ASN1_INTEGER_get'
ssluse.c:(.text+0x1133): undefined reference to `X509_get_serialNumber'
ssluse.c:(.text+0x12c1): undefined reference to `X509_get_pubkey'
ssluse.c:(.text+0x12f1): undefined reference to `EVP_PKEY_free'
ssluse.c:(.text+0x1302): undefined reference to `sk_num'
ssluse.c:(.text+0x1322): undefined reference to `sk_num'
ssluse.c:(.text+0x1346): undefined reference to `sk_value'
ssluse.c:(.text+0x134d): undefined reference to `BIO_s_mem'
ssluse.c:(.text+0x1355): undefined reference to `BIO_new'
ssluse.c:(.text+0x136b): undefined reference to `X509_EXTENSION_get_object'
ssluse.c:(.text+0x1383): undefined reference to
`X509_EXTENSION_get_critical'
ssluse.c:(.text+0x13d7): undefined reference to `X509V3_EXT_print'
ssluse.c:(.text+0x1404): undefined reference to `BIO_ctrl'
ssluse.c:(.text+0x14b4): undefined reference to `BIO_free'
ssluse.c:(.text+0x152b): undefined reference to `ASN1_STRING_print'
ssluse.c:(.text+0x15c2): undefined reference to `BIO_s_mem'
ssluse.c:(.text+0x15ca): undefined reference to `BIO_new'
ssluse.c:(.text+0x15de): undefined reference to `PEM_write_bio_X509'
ssluse.c:(.text+0x15fd): undefined reference to `BIO_ctrl'
ssluse.c:(.text+0x164a): undefined reference to `BIO_free'
ssluse.c:(.text+0x16f8): undefined reference to `ASN1_INTEGER_get'
ssluse.c:(.text+0x177d): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x17ac): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x17db): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x180e): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x1843): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x188d): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x18bc): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x18eb): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x191a): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x194d): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x1982): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x19ff): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x1a27): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x1a7a): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x1aa9): undefined reference to `BN_num_bits'
ssluse.c:(.text+0x1ad8): undefined reference to `BN_num_bits'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o):ssluse.c:(.text+0x1b07):
more undefined references to `BN_num_bits' follow
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`servercert':
ssluse.c:(.text+0x1bfc): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x1c4c): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x1c9f): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x1d07): undefined reference to `X509_get_subject_name'
ssluse.c:(.text+0x1d3e): undefined reference to `X509_free'
ssluse.c:(.text+0x1d8b): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x1dde): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x1e31): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x1e84): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x1ed7): undefined reference to `BN_bn2bin'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o):ssluse.c:(.text+0x1f2a):
more undefined references to `BN_bn2bin' follow
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`servercert':
ssluse.c:(.text+0x2046): undefined reference to `X509_get_issuer_name'
ssluse.c:(.text+0x208b): undefined reference to `X509_free'
ssluse.c:(.text+0x2127): undefined reference to `X509_free'
ssluse.c:(.text+0x2159): undefined reference to `PEM_read_X509'
ssluse.c:(.text+0x219e): undefined reference to `X509_free'
ssluse.c:(.text+0x21aa): undefined reference to `X509_free'
ssluse.c:(.text+0x21d4): undefined reference to `X509_check_issued'
ssluse.c:(.text+0x2212): undefined reference to `X509_free'
ssluse.c:(.text+0x221f): undefined reference to `X509_free'
ssluse.c:(.text+0x2259): undefined reference to `X509_free'
ssluse.c:(.text+0x226a): undefined reference to `SSL_get_verify_result'
ssluse.c:(.text+0x22a4): undefined reference to
`X509_verify_cert_error_string'
ssluse.c:(.text+0x22d8): undefined reference to `X509_free'
ssluse.c:(.text+0x22f4): undefined reference to
`X509_verify_cert_error_string'
ssluse.c:(.text+0x234c): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x239f): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x23f2): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x2445): undefined reference to `BN_bn2bin'
ssluse.c:(.text+0x2498): undefined reference to `BN_bn2bin'
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o):ssluse.c:(.text+0x24eb):
more undefined references to `BN_bn2bin' follow
../../baselib/libcurl/release/linux-i386/libcurl.a(ssluse.o): In function
`ossl_send':
ssluse.c:(.text+0x254c): undefined reference to `ERR_clear_error'
ssluse.c:(.text+0x2572): undefined reference to `SSL_write'
ssluse.c:(.text+0x259e): undefined reference to `SSL_get_error'
ssluse.c:(.text+0x25fc): undefined reference to `ERR_get_error'
I check libcurl.a, and find this:
[root_at_localhost curl-7.21.3]# nm -A ./lib/.libs/libcurl.a | grep SSL_write
./lib/.libs/libcurl.a:ssluse.o: U SSL_write
So, if libcurl.a is completely static, it shouldn't depend on openssl, and
SSL_write won't be undefined symbol in libcurl. Am I right?
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-07-19