archive (big format) ??? Is static linking possible?? - Aix

This is a discussion on archive (big format) ??? Is static linking possible?? - Aix ; I just downloaded the newest version of openssl from IBM, to my AIX 5.3 system. It contained libssl.a and libcrypto.a. For whatever reason, I did a "file" on them and got this response: file libssl.a libcrypto.a libcrypto.a: archive (big format) ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: archive (big format) ??? Is static linking possible??

  1. archive (big format) ??? Is static linking possible??

    I just downloaded the newest version of openssl from IBM, to my AIX
    5.3 system.

    It contained libssl.a and libcrypto.a.

    For whatever reason, I did a "file" on them and got this response:

    file libssl.a libcrypto.a
    libcrypto.a: archive (big format)
    libssl.a: archive (big format)

    What I'd like to know is "what is big format" ???

    Here's an example (snippet of the output) of its contents:

    ar -w libssl.a
    .BIO_ssl_shutdown libssl.so.0.9.8
    .BIO_ssl_copy_session_id libssl.so.0.9.8
    .BIO_new_buffer_ssl_connect libssl.so.0.9.8
    .BIO_new_ssl_connect libssl.so.0.9.8
    .BIO_new_ssl libssl.so.0.9.8
    .BIO_f_ssl libssl.so.0.9.8
    BIO_ssl_shutdown libssl.so.0.9.8
    BIO_ssl_copy_session_id libssl.so.0.9.8
    BIO_new_buffer_ssl_connect libssl.so.0.9.8
    BIO_new_ssl_connect libssl.so.0.9.8
    BIO_new_ssl libssl.so.0.9.8
    BIO_f_ssl libssl.so.0.9.8

    I want to make sure I can use these to "statically" link ssl into my
    application.

    Thanks,
    -tony

  2. Re: archive (big format) ??? Is static linking possible??

    bennett.tony@con-way.com wrote:
    > For whatever reason, I did a "file" on them and got this response:
    >
    > file libssl.a libcrypto.a
    > libcrypto.a: archive (big format)
    > libssl.a: archive (big format)
    >
    > What I'd like to know is "what is big format" ???


    An AIX-specific enhancement that provides support for both 32-bit
    and 64-bit object files within an archive. We ship .a files that
    can be used to build apps of either bitness.

    >
    > Here's an example (snippet of the output) of its contents:
    >
    > ar -w libssl.a
    > .BIO_ssl_shutdown libssl.so.0.9.8
    > .BIO_ssl_copy_session_id libssl.so.0.9.8
    > .BIO_new_buffer_ssl_connect libssl.so.0.9.8
    > .BIO_new_ssl_connect libssl.so.0.9.8
    > .BIO_new_ssl libssl.so.0.9.8
    > .BIO_f_ssl libssl.so.0.9.8
    > BIO_ssl_shutdown libssl.so.0.9.8
    > BIO_ssl_copy_session_id libssl.so.0.9.8
    > BIO_new_buffer_ssl_connect libssl.so.0.9.8
    > BIO_new_ssl_connect libssl.so.0.9.8
    > BIO_new_ssl libssl.so.0.9.8
    > BIO_f_ssl libssl.so.0.9.8


    Yeah, that's not good enough. If you want to see everything
    in the archive, use ar -X32_64 -tv libssl.a, or -X32_64 -w. Note
    that this -X option is documented.

    > I want to make sure I can use these to "statically" link ssl into my
    > application.


    AIX allows you to put dynamically loadable modules into an archive, then
    link against the aggregation plus run with the aggregation. Aside from
    me discouraging static linking, the linker's -bstatic/-bdynamic options
    should work as you expect. Otherwise, you can create yourself a
    non-shared copy of the archive via
    ld -r -o foo.o -bnso /opt/freeware/lib/libssl.a

  3. Re: archive (big format) ??? Is static linking possible??

    On Nov 6, 12:01*pm, "Gary R. Hook" wrote:
    > bennett.t...@con-way.com wrote:
    > > For whatever reason, I did a "file" on them and got this response:

    >
    > > * * file *libssl.a *libcrypto.a
    > > * * libcrypto.a: archive (big format)
    > > * * libssl.a: archive (big format)

    >
    > > What I'd like to know is "what is big format" ???

    >
    > An AIX-specific enhancement that provides support for both 32-bit
    > and 64-bit object files within an archive. *We ship .a files that
    > can be used to build apps of either bitness.
    >
    >
    >
    >
    >
    >
    >
    > > Here's an example (snippet of the output) of its contents:

    >
    > > * * ar -w libssl.a
    > > * * .BIO_ssl_shutdown * * * libssl.so.0.9.8
    > > * * .BIO_ssl_copy_session_id * * * *libssl.so.0.9.8
    > > * * .BIO_new_buffer_ssl_connect * * libssl.so.0.9.8
    > > * * .BIO_new_ssl_connect * *libssl.so.0.9.8
    > > * * .BIO_new_ssl * *libssl.so.0.9.8
    > > * * .BIO_f_ssl * * *libssl.so.0.9.8
    > > * * BIO_ssl_shutdown * * * *libssl.so.0.9.8
    > > * * BIO_ssl_copy_session_id libssl.so.0.9.8
    > > * * BIO_new_buffer_ssl_connect * * *libssl.so.0.9.8
    > > * * BIO_new_ssl_connect * * libssl.so.0.9.8
    > > * * BIO_new_ssl * * libssl.so.0.9.8
    > > * * BIO_f_ssl * * * libssl.so.0.9.8

    >
    > Yeah, that's not good enough. *If you want to see everything
    > in the archive, use ar -X32_64 -tv libssl.a, or -X32_64 -w. *Note
    > that this -X option is documented.
    >
    > > I want to make sure I can use these to "statically" link ssl into my
    > > application.

    >
    > AIX allows you to put dynamically loadable modules into an archive, then
    > link against the aggregation plus run with the aggregation. *Aside from
    > me discouraging static linking, the linker's -bstatic/-bdynamic options
    > should work as you expect. *Otherwise, you can create yourself a
    > non-shared copy of the archive via
    > ld -r -o foo.o -bnso /opt/freeware/lib/libssl.a- Hide quoted text -
    >
    > - Show quoted text -


    Thanks, Gary....great advise, as usual.

    The following worked for me:

    xlc_r -I./my_incdir -ocheck_env check_env.c \
    -L./my_lib -lcnf \
    -bstatic -L./openssl/usr/lib -lssl -lcrypto -bshared

    It created an executable without the "ssl" shared object referenced in
    the header...
    ....i.e. here's without the "-bstatic" and "-bshared" specified:
    INDEX PATH BASE
    MEMBER
    0 /home/dms/source:/home/trbennet/openssl/usr/lib:/usr/vac/lib:/
    usr/lib/threads:/usr/lib:/lib

    1 libc.a
    shr.o
    2 libpthreads.a
    shr_xpg5.o
    3 libcrypto.a libcrypto.so.
    0.9.8

    Here's "with" the "-bstatic" and "-bshared" specified:

    INDEX PATH BASE
    MEMBER
    0 /home/dms/source:/home/trbennet/openssl/usr/lib:/usr/vac/lib:/
    usr/lib/threads:/usr/lib:/lib

    1 libc.a
    shr.o
    2 libpthreads.a
    shr_xpg5.o


    -tony

+ Reply to Thread