missing symbols when building openssl1.0.0g as static library..

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

missing symbols when building openssl1.0.0g as static library..

junkJon
Hi all,

I am building openssl as a static library, and when I link to it, I am
getting a bunch of missing symbols that *should* be defined by
openssl.

Here is the command I used to build openssl:

./Configure --prefix=/home/user/openssl_release
--openssldir=/home/user/openssl_release no-asm threads zlib shared
linux-x86_64

After the binaries have been built, it produces libcrypto.a and
libssl.a.  When I try to link against it, I get a bunch of missing
symbols -- *some* are listed below.  There are a lot more.


      [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1462:
undefined reference to `SSLv23_client_method'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1466:
undefined reference to `TLSv1_client_method'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1478:
undefined reference to `SSLv2_client_method'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1487:
undefined reference to `SSLv3_client_method'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1493:
undefined reference to `SSL_CTX_free'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1494:
undefined reference to `SSL_CTX_new'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1497:
undefined reference to `ERR_peek_error'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1497:
undefined reference to `ERR_error_string'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1503:
undefined reference to `SSL_CTX_ctrl'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1510:
undefined reference to `SSL_CTX_callback_ctrl'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1514:
undefined reference to `SSL_CTX_ctrl'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1576:
undefined reference to `SSL_CTX_ctrl'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1601:
undefined reference to `SSL_CTX_set_cipher_list'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1633:
undefined reference to `SSL_CTX_load_verify_locations'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1669:
undefined reference to `X509_LOOKUP_file'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1669:
undefined reference to `SSL_CTX_get_cert_store'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1669:
undefined reference to `X509_STORE_add_lookup'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1672:
undefined reference to `X509_load_crl_file'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1681:
undefined reference to `SSL_CTX_get_cert_store'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1681:
undefined reference to `X509_STORE_set_flags'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1693:
undefined reference to `SSL_CTX_set_verify'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1709:
undefined reference to `SSL_free'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1710:
undefined reference to `SSL_new'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1715:
undefined reference to `SSL_set_connect_state'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1725:
undefined reference to `SSL_ctrl'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1733:
undefined reference to `SSL_set_session'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1734:
undefined reference to `ERR_get_error'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1734:
undefined reference to `ERR_error_string'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1743:
undefined reference to `SSL_set_fd'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1744:
undefined reference to `ERR_get_error'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1744:
undefined reference to `ERR_error_string'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1226:
undefined reference to `X509_NAME_get_index_by_NID'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1234:
undefined reference to `X509_NAME_get_entry'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1234:
undefined reference to `X509_NAME_ENTRY_get_data'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1242:
undefined reference to `ASN1_STRING_type'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1243:
undefined reference to `ASN1_STRING_length'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1245:
undefined reference to `CRYPTO_malloc'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1247:
undefined reference to `ASN1_STRING_data'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1253:
undefined reference to `ASN1_STRING_to_UTF8'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1271:
undefined reference to `CRYPTO_free'
       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1298:
undefined reference to `CRYPTO_free'
...
...

These all look like they belong to openssl.  How would I produce a
fully functional static library that has all the symbols defined?

Thanks,
J
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: missing symbols when building openssl1.0.0g as static library..

Michael S. Zick-4
On Tue February 28 2012, JonathonS wrote:

> Hi all,
>
> I am building openssl as a static library, and when I link to it, I am
> getting a bunch of missing symbols that *should* be defined by
> openssl.
>
> Here is the command I used to build openssl:
>
> ./Configure --prefix=/home/user/openssl_release
> --openssldir=/home/user/openssl_release no-asm threads zlib shared
> linux-x86_64
>
> After the binaries have been built, it produces libcrypto.a and
> libssl.a.  When I try to link against it, I get a bunch of missing
> symbols -- *some* are listed below.  There are a lot more.
>

What does the curl build command line look like?

Without that, no one (including yourself) can tell if you really
are accessing the static libraries you just built.

Next time you try to do this build, include "-v" in your CFLAGS
(if using gcc) and see if the search paths reported are those
where you just installed the OpenSSl build.

Mike

>
>       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1462:
> undefined reference to `SSLv23_client_method'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1466:
> undefined reference to `TLSv1_client_method'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1478:
> undefined reference to `SSLv2_client_method'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1487:
> undefined reference to `SSLv3_client_method'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1493:
> undefined reference to `SSL_CTX_free'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1494:
> undefined reference to `SSL_CTX_new'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1497:
> undefined reference to `ERR_peek_error'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1497:
> undefined reference to `ERR_error_string'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1503:
> undefined reference to `SSL_CTX_ctrl'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1510:
> undefined reference to `SSL_CTX_callback_ctrl'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1514:
> undefined reference to `SSL_CTX_ctrl'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1576:
> undefined reference to `SSL_CTX_ctrl'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1601:
> undefined reference to `SSL_CTX_set_cipher_list'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1633:
> undefined reference to `SSL_CTX_load_verify_locations'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1669:
> undefined reference to `X509_LOOKUP_file'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1669:
> undefined reference to `SSL_CTX_get_cert_store'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1669:
> undefined reference to `X509_STORE_add_lookup'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1672:
> undefined reference to `X509_load_crl_file'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1681:
> undefined reference to `SSL_CTX_get_cert_store'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1681:
> undefined reference to `X509_STORE_set_flags'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1693:
> undefined reference to `SSL_CTX_set_verify'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1709:
> undefined reference to `SSL_free'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1710:
> undefined reference to `SSL_new'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1715:
> undefined reference to `SSL_set_connect_state'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1725:
> undefined reference to `SSL_ctrl'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1733:
> undefined reference to `SSL_set_session'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1734:
> undefined reference to `ERR_get_error'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1734:
> undefined reference to `ERR_error_string'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1743:
> undefined reference to `SSL_set_fd'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1744:
> undefined reference to `ERR_get_error'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1744:
> undefined reference to `ERR_error_string'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1226:
> undefined reference to `X509_NAME_get_index_by_NID'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1234:
> undefined reference to `X509_NAME_get_entry'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1234:
> undefined reference to `X509_NAME_ENTRY_get_data'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1242:
> undefined reference to `ASN1_STRING_type'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1243:
> undefined reference to `ASN1_STRING_length'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1245:
> undefined reference to `CRYPTO_malloc'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1247:
> undefined reference to `ASN1_STRING_data'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1253:
> undefined reference to `ASN1_STRING_to_UTF8'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1271:
> undefined reference to `CRYPTO_free'
>        [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1298:
> undefined reference to `CRYPTO_free'
> ...
> ...
>
> These all look like they belong to openssl.  How would I produce a
> fully functional static library that has all the symbols defined?
>
> Thanks,
> J
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [hidden email]
> Automated List Manager                           [hidden email]
>
>
>


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: missing symbols when building openssl1.0.0g as static library..

J. J. Farrell-2
In reply to this post by junkJon
> From: JonathonS [mailto:[hidden email]]
>
> I am building openssl as a static library, and when I link to it, I am
> getting a bunch of missing symbols that *should* be defined by
> openssl.
>
> Here is the command I used to build openssl:
>
> ./Configure --prefix=/home/user/openssl_release
> --openssldir=/home/user/openssl_release no-asm threads zlib shared
> linux-x86_64
>
> After the binaries have been built, it produces libcrypto.a and
> libssl.a.  When I try to link against it, I get a bunch of missing
> symbols -- *some* are listed below.  There are a lot more.
>
>
>       [cc] /home/user/downloads/curl-7.24.0/lib/ssluse.c:1462:
> undefined reference to `SSLv23_client_method'
> ...
>
> These all look like they belong to openssl.  How would I produce a
> fully functional static library that has all the symbols defined?

The way you did. Are you sure you're linking against the libraries? What OS, what linker, what command line?
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: missing symbols when building openssl1.0.0g as static library..

Wim Lewis-3
In reply to this post by junkJon

On 28 Feb 2012, at 9:57 AM, JonathonS wrote:
> Here is the command I used to build openssl:
>
> ./Configure --prefix=/home/user/openssl_release
> --openssldir=/home/user/openssl_release no-asm threads zlib shared
> linux-x86_64
>
> After the binaries have been built, it produces libcrypto.a and
> libssl.a.  When I try to link against it, I get a bunch of missing
> symbols -- *some* are listed below.  There are a lot more.


What is the command line you are using when you link against openssl? Are the static libraries listed after all of the objects that reference things in them?

Check whether the symbols are actually defined in the static libraries--- eg., "nm libcrypto.a | fgrep SSLv23_client_method" (there should be several 'U'ndefined references and one defined reference to that symbol).


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: missing symbols when building openssl1.0.0g as static library..

junkJon
Thanks guys for all your help.

I am using 64-bit linux Centos.  The binaries were built with GCC 4.4.4.

I am not currently linking against libcurl.  I am just linking against
my own project.  I am pretty sure the cause of the problem is that the
symbols are not defined in the binaries produced.

see below.

[user@localhost lib]$ nm libcrypto.a | fgrep X509_STORE
                 U X509_STORE_add_lookup
00000000000000ac T X509_STORE_load_locations
0000000000000000 T X509_STORE_set_default_paths
0000000000003f26 T X509_STORE_CTX_cleanup
0000000000003a12 T X509_STORE_CTX_free
000000000000376a T X509_STORE_CTX_get0_current_crl
0000000000003755 T X509_STORE_CTX_get0_current_issuer
0000000000004140 T X509_STORE_CTX_get0_param
000000000000377f T X509_STORE_CTX_get0_parent_ctx
00000000000040d0 T X509_STORE_CTX_get0_policy_tree
00000000000036b4 T X509_STORE_CTX_get1_chain
                 U X509_STORE_CTX_get1_issuer
000000000000369f T X509_STORE_CTX_get_chain
000000000000368a T X509_STORE_CTX_get_current_cert
0000000000003648 T X509_STORE_CTX_get_error
0000000000003676 T X509_STORE_CTX_get_error_depth
000000000000361f T X509_STORE_CTX_get_ex_data
00000000000035a3 T X509_STORE_CTX_get_ex_new_index
00000000000040e5 T X509_STORE_CTX_get_explicit_policy
0000000000003a38 T X509_STORE_CTX_init
00000000000039a5 T X509_STORE_CTX_new
0000000000003838 T X509_STORE_CTX_purpose_inherit
00000000000037c8 T X509_STORE_CTX_set0_crls
0000000000004152 T X509_STORE_CTX_set0_param
0000000000003794 T X509_STORE_CTX_set_cert
00000000000037ae T X509_STORE_CTX_set_chain
00000000000040f9 T X509_STORE_CTX_set_default
000000000000403a T X509_STORE_CTX_set_depth
000000000000365c T X509_STORE_CTX_set_error
00000000000035ee T X509_STORE_CTX_set_ex_data
0000000000004060 T X509_STORE_CTX_set_flags
00000000000037e2 T X509_STORE_CTX_set_purpose
0000000000004089 T X509_STORE_CTX_set_time
000000000000380c T X509_STORE_CTX_set_trust
00000000000040b6 T X509_STORE_CTX_set_verify_cb
0000000000003efd T X509_STORE_CTX_trusted_stack
                 U X509_STORE_get1_certs
                 U X509_STORE_get1_crls
00000000000013ab T X509_STORE_CTX_get1_issuer
0000000000000928 T X509_STORE_add_cert
0000000000000a6e T X509_STORE_add_crl
0000000000000714 T X509_STORE_add_lookup
0000000000000639 T X509_STORE_free
0000000000000e4c T X509_STORE_get1_certs
000000000000106a T X509_STORE_get1_crls
00000000000007d5 T X509_STORE_get_by_subject
0000000000000484 T X509_STORE_new
0000000000001670 T X509_STORE_set1_param
00000000000015f9 T X509_STORE_set_depth
00000000000015d0 T X509_STORE_set_flags
0000000000001624 T X509_STORE_set_purpose
000000000000164a T X509_STORE_set_trust
0000000000001699 T X509_STORE_set_verify_cb
                 U X509_STORE_add_cert
                 U X509_STORE_add_crl
                 U X509_STORE_CTX_cleanup
                 U X509_STORE_CTX_init
                 U X509_STORE_CTX_set_purpose
                 U X509_STORE_CTX_cleanup
                 U X509_STORE_CTX_get_error
                 U X509_STORE_CTX_init
                 U X509_STORE_CTX_set0_crls
                 U X509_STORE_CTX_set_default
                 U X509_STORE_CTX_cleanup
                 U X509_STORE_CTX_get1_chain
                 U X509_STORE_CTX_get_error
                 U X509_STORE_CTX_init
                 U X509_STORE_CTX_set_purpose
                 U X509_STORE_CTX_set_trust
                 U X509_STORE_CTX_cleanup
                 U X509_STORE_CTX_get_error
                 U X509_STORE_CTX_init
                 U X509_STORE_CTX_set0_crls
                 U X509_STORE_CTX_set_default
                 U X509_STORE_CTX_cleanup
                 U X509_STORE_CTX_get1_chain
                 U X509_STORE_CTX_get_error
                 U X509_STORE_CTX_init
                 U X509_STORE_CTX_set_purpose
                 U X509_STORE_free

see all the "U" in libcrypto.a?  These are the undefined symbols I believe.

Thanks again for all the help.

J

On Tue, Feb 28, 2012 at 10:39 AM, Wim Lewis <[hidden email]> wrote:

>
> On 28 Feb 2012, at 9:57 AM, JonathonS wrote:
>> Here is the command I used to build openssl:
>>
>> ./Configure --prefix=/home/user/openssl_release
>> --openssldir=/home/user/openssl_release no-asm threads zlib shared
>> linux-x86_64
>>
>> After the binaries have been built, it produces libcrypto.a and
>> libssl.a.  When I try to link against it, I get a bunch of missing
>> symbols -- *some* are listed below.  There are a lot more.
>
>
> What is the command line you are using when you link against openssl? Are the static libraries listed after all of the objects that reference things in them?
>
> Check whether the symbols are actually defined in the static libraries--- eg., "nm libcrypto.a | fgrep SSLv23_client_method" (there should be several 'U'ndefined references and one defined reference to that symbol).
>
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [hidden email]
> Automated List Manager                           [hidden email]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: missing symbols when building openssl1.0.0g as static library..

J. J. Farrell-2
> From: JonathonS [mailto:[hidden email]]
>
> Thanks guys for all your help.
>
> I am using 64-bit linux Centos.  The binaries were built with GCC
> 4.4.4.
>
> I am not currently linking against libcurl.  I am just linking against
> my own project.  I am pretty sure the cause of the problem is that the
> symbols are not defined in the binaries produced.
>
> see below.
>
> [user@localhost lib]$ nm libcrypto.a | fgrep X509_STORE
>                  U X509_STORE_add_lookup
> 00000000000000ac T X509_STORE_load_locations
> 0000000000000000 T X509_STORE_set_default_paths
> 0000000000003f26 T X509_STORE_CTX_cleanup
> 0000000000003a12 T X509_STORE_CTX_free
> 000000000000376a T X509_STORE_CTX_get0_current_crl
> 0000000000003755 T X509_STORE_CTX_get0_current_issuer
> 0000000000004140 T X509_STORE_CTX_get0_param
> 000000000000377f T X509_STORE_CTX_get0_parent_ctx
> 00000000000040d0 T X509_STORE_CTX_get0_policy_tree
> 00000000000036b4 T X509_STORE_CTX_get1_chain
>                  U X509_STORE_CTX_get1_issuer
> 000000000000369f T X509_STORE_CTX_get_chain
> 000000000000368a T X509_STORE_CTX_get_current_cert
> 0000000000003648 T X509_STORE_CTX_get_error
> 0000000000003676 T X509_STORE_CTX_get_error_depth
> 000000000000361f T X509_STORE_CTX_get_ex_data
> 00000000000035a3 T X509_STORE_CTX_get_ex_new_index
> 00000000000040e5 T X509_STORE_CTX_get_explicit_policy
> 0000000000003a38 T X509_STORE_CTX_init
> 00000000000039a5 T X509_STORE_CTX_new
> 0000000000003838 T X509_STORE_CTX_purpose_inherit
> 00000000000037c8 T X509_STORE_CTX_set0_crls
> 0000000000004152 T X509_STORE_CTX_set0_param
> 0000000000003794 T X509_STORE_CTX_set_cert
> 00000000000037ae T X509_STORE_CTX_set_chain
> 00000000000040f9 T X509_STORE_CTX_set_default
> 000000000000403a T X509_STORE_CTX_set_depth
> 000000000000365c T X509_STORE_CTX_set_error
> 00000000000035ee T X509_STORE_CTX_set_ex_data
> 0000000000004060 T X509_STORE_CTX_set_flags
> 00000000000037e2 T X509_STORE_CTX_set_purpose
> 0000000000004089 T X509_STORE_CTX_set_time
> 000000000000380c T X509_STORE_CTX_set_trust
> 00000000000040b6 T X509_STORE_CTX_set_verify_cb
> 0000000000003efd T X509_STORE_CTX_trusted_stack
>                  U X509_STORE_get1_certs
>                  U X509_STORE_get1_crls
> 00000000000013ab T X509_STORE_CTX_get1_issuer
> 0000000000000928 T X509_STORE_add_cert
> 0000000000000a6e T X509_STORE_add_crl
> 0000000000000714 T X509_STORE_add_lookup
> 0000000000000639 T X509_STORE_free
> 0000000000000e4c T X509_STORE_get1_certs
> 000000000000106a T X509_STORE_get1_crls
> 00000000000007d5 T X509_STORE_get_by_subject
> 0000000000000484 T X509_STORE_new
> 0000000000001670 T X509_STORE_set1_param
> 00000000000015f9 T X509_STORE_set_depth
> 00000000000015d0 T X509_STORE_set_flags
> 0000000000001624 T X509_STORE_set_purpose
> 000000000000164a T X509_STORE_set_trust
> 0000000000001699 T X509_STORE_set_verify_cb
>                  U X509_STORE_add_cert
>                  U X509_STORE_add_crl
>                  U X509_STORE_CTX_cleanup
>                  U X509_STORE_CTX_init
>                  U X509_STORE_CTX_set_purpose
>                  U X509_STORE_CTX_cleanup
>                  U X509_STORE_CTX_get_error
>                  U X509_STORE_CTX_init
>                  U X509_STORE_CTX_set0_crls
>                  U X509_STORE_CTX_set_default
>                  U X509_STORE_CTX_cleanup
>                  U X509_STORE_CTX_get1_chain
>                  U X509_STORE_CTX_get_error
>                  U X509_STORE_CTX_init
>                  U X509_STORE_CTX_set_purpose
>                  U X509_STORE_CTX_set_trust
>                  U X509_STORE_CTX_cleanup
>                  U X509_STORE_CTX_get_error
>                  U X509_STORE_CTX_init
>                  U X509_STORE_CTX_set0_crls
>                  U X509_STORE_CTX_set_default
>                  U X509_STORE_CTX_cleanup
>                  U X509_STORE_CTX_get1_chain
>                  U X509_STORE_CTX_get_error
>                  U X509_STORE_CTX_init
>                  U X509_STORE_CTX_set_purpose
>                  U X509_STORE_free
>
> see all the "U" in libcrypto.a?

Yep.

> These are the undefined symbols I believe.

Why do you believe that? You quote below the following comment from Wim:

! (there should be several 'U'ndefined references and one defined
! reference to [each] symbol).

I don't see any undefined symbols in the output you provide.

As several people have already implied, the most likely cause of the problem by far is that you're not linking against the libraries. As several people have asked, what is your linker command line when linking your program?


> Thanks again for all the help.
>
> J
>
> On Tue, Feb 28, 2012 at 10:39 AM, Wim Lewis <[hidden email]> wrote:
> >
> > On 28 Feb 2012, at 9:57 AM, JonathonS wrote:
> >> Here is the command I used to build openssl:
> >>
> >> ./Configure --prefix=/home/user/openssl_release
> >> --openssldir=/home/user/openssl_release no-asm threads zlib shared
> >> linux-x86_64
> >>
> >> After the binaries have been built, it produces libcrypto.a and
> >> libssl.a.  When I try to link against it, I get a bunch of missing
> >> symbols -- *some* are listed below.  There are a lot more.
> >
> >
> > What is the command line you are using when you link against openssl?
> Are the static libraries listed after all of the objects that reference
> things in them?
> >
> > Check whether the symbols are actually defined in the static
> libraries--- eg., "nm libcrypto.a | fgrep SSLv23_client_method" (there
> should be several 'U'ndefined references and one defined reference to
> that symbol).
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: missing symbols when building openssl1.0.0g as static library..

junkJon
Thanks guys. Sorry for the confusion.  I thought "U" meant undefined
and "T" meant it *belongs* in the text section, NOT that it actually
*exists* in the text section :)

Here is my linker command.

g++ -g -o unit_tests unit_tests.o -L/home/user/build/openssl/debug/lib
-lcrypto -lssl --L/home/user/build/libcurl/debug/lib -lcurl -ldl
-lstdc++ -lpthread -lrt -lz -lstdc++

When I built libcurl, I specified the --with-ssl=/.../ flag to point
to my openssl build.

Thanks,
J

On Tue, Feb 28, 2012 at 12:48 PM, Jeremy Farrell
<[hidden email]> wrote:

>> From: JonathonS [mailto:[hidden email]]
>>
>> Thanks guys for all your help.
>>
>> I am using 64-bit linux Centos.  The binaries were built with GCC
>> 4.4.4.
>>
>> I am not currently linking against libcurl.  I am just linking against
>> my own project.  I am pretty sure the cause of the problem is that the
>> symbols are not defined in the binaries produced.
>>
>> see below.
>>
>> [user@localhost lib]$ nm libcrypto.a | fgrep X509_STORE
>>                  U X509_STORE_add_lookup
>> 00000000000000ac T X509_STORE_load_locations
>> 0000000000000000 T X509_STORE_set_default_paths
>> 0000000000003f26 T X509_STORE_CTX_cleanup
>> 0000000000003a12 T X509_STORE_CTX_free
>> 000000000000376a T X509_STORE_CTX_get0_current_crl
>> 0000000000003755 T X509_STORE_CTX_get0_current_issuer
>> 0000000000004140 T X509_STORE_CTX_get0_param
>> 000000000000377f T X509_STORE_CTX_get0_parent_ctx
>> 00000000000040d0 T X509_STORE_CTX_get0_policy_tree
>> 00000000000036b4 T X509_STORE_CTX_get1_chain
>>                  U X509_STORE_CTX_get1_issuer
>> 000000000000369f T X509_STORE_CTX_get_chain
>> 000000000000368a T X509_STORE_CTX_get_current_cert
>> 0000000000003648 T X509_STORE_CTX_get_error
>> 0000000000003676 T X509_STORE_CTX_get_error_depth
>> 000000000000361f T X509_STORE_CTX_get_ex_data
>> 00000000000035a3 T X509_STORE_CTX_get_ex_new_index
>> 00000000000040e5 T X509_STORE_CTX_get_explicit_policy
>> 0000000000003a38 T X509_STORE_CTX_init
>> 00000000000039a5 T X509_STORE_CTX_new
>> 0000000000003838 T X509_STORE_CTX_purpose_inherit
>> 00000000000037c8 T X509_STORE_CTX_set0_crls
>> 0000000000004152 T X509_STORE_CTX_set0_param
>> 0000000000003794 T X509_STORE_CTX_set_cert
>> 00000000000037ae T X509_STORE_CTX_set_chain
>> 00000000000040f9 T X509_STORE_CTX_set_default
>> 000000000000403a T X509_STORE_CTX_set_depth
>> 000000000000365c T X509_STORE_CTX_set_error
>> 00000000000035ee T X509_STORE_CTX_set_ex_data
>> 0000000000004060 T X509_STORE_CTX_set_flags
>> 00000000000037e2 T X509_STORE_CTX_set_purpose
>> 0000000000004089 T X509_STORE_CTX_set_time
>> 000000000000380c T X509_STORE_CTX_set_trust
>> 00000000000040b6 T X509_STORE_CTX_set_verify_cb
>> 0000000000003efd T X509_STORE_CTX_trusted_stack
>>                  U X509_STORE_get1_certs
>>                  U X509_STORE_get1_crls
>> 00000000000013ab T X509_STORE_CTX_get1_issuer
>> 0000000000000928 T X509_STORE_add_cert
>> 0000000000000a6e T X509_STORE_add_crl
>> 0000000000000714 T X509_STORE_add_lookup
>> 0000000000000639 T X509_STORE_free
>> 0000000000000e4c T X509_STORE_get1_certs
>> 000000000000106a T X509_STORE_get1_crls
>> 00000000000007d5 T X509_STORE_get_by_subject
>> 0000000000000484 T X509_STORE_new
>> 0000000000001670 T X509_STORE_set1_param
>> 00000000000015f9 T X509_STORE_set_depth
>> 00000000000015d0 T X509_STORE_set_flags
>> 0000000000001624 T X509_STORE_set_purpose
>> 000000000000164a T X509_STORE_set_trust
>> 0000000000001699 T X509_STORE_set_verify_cb
>>                  U X509_STORE_add_cert
>>                  U X509_STORE_add_crl
>>                  U X509_STORE_CTX_cleanup
>>                  U X509_STORE_CTX_init
>>                  U X509_STORE_CTX_set_purpose
>>                  U X509_STORE_CTX_cleanup
>>                  U X509_STORE_CTX_get_error
>>                  U X509_STORE_CTX_init
>>                  U X509_STORE_CTX_set0_crls
>>                  U X509_STORE_CTX_set_default
>>                  U X509_STORE_CTX_cleanup
>>                  U X509_STORE_CTX_get1_chain
>>                  U X509_STORE_CTX_get_error
>>                  U X509_STORE_CTX_init
>>                  U X509_STORE_CTX_set_purpose
>>                  U X509_STORE_CTX_set_trust
>>                  U X509_STORE_CTX_cleanup
>>                  U X509_STORE_CTX_get_error
>>                  U X509_STORE_CTX_init
>>                  U X509_STORE_CTX_set0_crls
>>                  U X509_STORE_CTX_set_default
>>                  U X509_STORE_CTX_cleanup
>>                  U X509_STORE_CTX_get1_chain
>>                  U X509_STORE_CTX_get_error
>>                  U X509_STORE_CTX_init
>>                  U X509_STORE_CTX_set_purpose
>>                  U X509_STORE_free
>>
>> see all the "U" in libcrypto.a?
>
> Yep.
>
>> These are the undefined symbols I believe.
>
> Why do you believe that? You quote below the following comment from Wim:
>
> ! (there should be several 'U'ndefined references and one defined
> ! reference to [each] symbol).
>
> I don't see any undefined symbols in the output you provide.
>
> As several people have already implied, the most likely cause of the problem by far is that you're not linking against the libraries. As several people have asked, what is your linker command line when linking your program?
>
>
>> Thanks again for all the help.
>>
>> J
>>
>> On Tue, Feb 28, 2012 at 10:39 AM, Wim Lewis <[hidden email]> wrote:
>> >
>> > On 28 Feb 2012, at 9:57 AM, JonathonS wrote:
>> >> Here is the command I used to build openssl:
>> >>
>> >> ./Configure --prefix=/home/user/openssl_release
>> >> --openssldir=/home/user/openssl_release no-asm threads zlib shared
>> >> linux-x86_64
>> >>
>> >> After the binaries have been built, it produces libcrypto.a and
>> >> libssl.a.  When I try to link against it, I get a bunch of missing
>> >> symbols -- *some* are listed below.  There are a lot more.
>> >
>> >
>> > What is the command line you are using when you link against openssl?
>> Are the static libraries listed after all of the objects that reference
>> things in them?
>> >
>> > Check whether the symbols are actually defined in the static
>> libraries--- eg., "nm libcrypto.a | fgrep SSLv23_client_method" (there
>> should be several 'U'ndefined references and one defined reference to
>> that symbol).
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [hidden email]
> Automated List Manager                           [hidden email]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: missing symbols when building openssl1.0.0g as static library..

Wim Lewis-3

On 28 Feb 2012, at 5:15 PM, JonathonS wrote:

> Thanks guys. Sorry for the confusion.  I thought "U" meant undefined
> and "T" meant it *belongs* in the text section, NOT that it actually
> *exists* in the text section :)
>
> Here is my linker command.
>
> g++ -g -o unit_tests unit_tests.o -L/home/user/build/openssl/debug/lib
> -lcrypto -lssl --L/home/user/build/libcurl/debug/lib -lcurl -ldl
> -lstdc++ -lpthread -lrt -lz -lstdc++
>
> When I built libcurl, I specified the --with-ssl=/.../ flag to point
> to my openssl build.

Try putting -lssl after -lcurl, and -lcrypto after -lssl, on the linker command line. Unlike dynamic libraries, the linker only uses the objects from a static library that it needs in order to satisfy all the undefined symbols; and the normal behavior of 'ld' is to make one pass through its arguments, in order, pulling in whatever's needed from each one at the time. At the time it's linking things from libcrypto.a in your example it hasn't yet looked at libssl or libcurl.


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: missing symbols when building openssl1.0.0g as static library..

junkJon
Thanks :) That was the problem!  Very interesting.  I didn't think
order mattered :)

I reordered it and it worked.

J

On Tue, Feb 28, 2012 at 5:30 PM, Wim Lewis <[hidden email]> wrote:

>
> On 28 Feb 2012, at 5:15 PM, JonathonS wrote:
>> Thanks guys. Sorry for the confusion.  I thought "U" meant undefined
>> and "T" meant it *belongs* in the text section, NOT that it actually
>> *exists* in the text section :)
>>
>> Here is my linker command.
>>
>> g++ -g -o unit_tests unit_tests.o -L/home/user/build/openssl/debug/lib
>> -lcrypto -lssl --L/home/user/build/libcurl/debug/lib -lcurl -ldl
>> -lstdc++ -lpthread -lrt -lz -lstdc++
>>
>> When I built libcurl, I specified the --with-ssl=/.../ flag to point
>> to my openssl build.
>
> Try putting -lssl after -lcurl, and -lcrypto after -lssl, on the linker command line. Unlike dynamic libraries, the linker only uses the objects from a static library that it needs in order to satisfy all the undefined symbols; and the normal behavior of 'ld' is to make one pass through its arguments, in order, pulling in whatever's needed from each one at the time. At the time it's linking things from libcrypto.a in your example it hasn't yet looked at libssl or libcurl.
>
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [hidden email]
> Automated List Manager                           [hidden email]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: missing symbols when building openssl1.0.0g as static library..

Michael S. Zick-4
On Tue February 28 2012, JonathonS wrote:
> Thanks :) That was the problem!  Very interesting.  I didn't think
> order mattered :)
>

It doesn't if you use "group notation" in your ld command line.
Then ld makes multiple passes over the files mentioned in the group.

Mike

> I reordered it and it worked.
>
> J
>
> On Tue, Feb 28, 2012 at 5:30 PM, Wim Lewis <[hidden email]> wrote:
> >
> > On 28 Feb 2012, at 5:15 PM, JonathonS wrote:
> >> Thanks guys. Sorry for the confusion.  I thought "U" meant undefined
> >> and "T" meant it *belongs* in the text section, NOT that it actually
> >> *exists* in the text section :)
> >>
> >> Here is my linker command.
> >>
> >> g++ -g -o unit_tests unit_tests.o -L/home/user/build/openssl/debug/lib
> >> -lcrypto -lssl --L/home/user/build/libcurl/debug/lib -lcurl -ldl
> >> -lstdc++ -lpthread -lrt -lz -lstdc++
> >>
> >> When I built libcurl, I specified the --with-ssl=/.../ flag to point
> >> to my openssl build.
> >
> > Try putting -lssl after -lcurl, and -lcrypto after -lssl, on the linker command line. Unlike dynamic libraries, the linker only uses the objects from a static library that it needs in order to satisfy all the undefined symbols; and the normal behavior of 'ld' is to make one pass through its arguments, in order, pulling in whatever's needed from each one at the time. At the time it's linking things from libcrypto.a in your example it hasn't yet looked at libssl or libcurl.
> >
> >
> > ______________________________________________________________________
> > OpenSSL Project                                 http://www.openssl.org
> > User Support Mailing List                    [hidden email]
> > Automated List Manager                           [hidden email]
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [hidden email]
> Automated List Manager                           [hidden email]
>
>
>


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]