Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

89 views
Skip to first unread message

bennet...@con-way.com

unread,
Nov 5, 2008, 1:16:50 PM11/5/08
to
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

Gary R. Hook

unread,
Nov 6, 2008, 3:01:26 PM11/6/08
to
bennet...@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

bennet...@con-way.com

unread,
Nov 6, 2008, 6:33:02 PM11/6/08
to
On Nov 6, 12:01 pm, "Gary R. Hook" <gh...@no.spammers.net> wrote:
> 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

bennet...@con-way.com

unread,
Nov 26, 2008, 10:31:58 AM11/26/08
to
> -tony- Hide quoted text -

>
> - Show quoted text -

Gary,

When using the 2nd methodology that you recommended
(i.e.: ld -r -o foo.o -bnso /opt/freeware/lib/libssl.a)
which "version" is extracted from libssl.a and put into
foo.o... 32bit or 64bit, and how do I tell...???

Thanks,
-tony

Gary R. Hook

unread,
Nov 26, 2008, 7:18:59 PM11/26/08
to
bennet...@con-way.com wrote:
>
> When using the 2nd methodology that you recommended
> (i.e.: ld -r -o foo.o -bnso /opt/freeware/lib/libssl.a)
> which "version" is extracted from libssl.a and put into
> foo.o... 32bit or 64bit, and how do I tell...???

The version that matches the mode you're working in. Unless
you set OBJECT_MODE in your environment or use -b64 it's going to be 32-bit.

0 new messages