Thanks - I found the hint in INSTALL on howto create the shared files. What
I have not figured out is how to make openssl want them to be
libssl.a(member) and libcrypto.a(member).

Here is where I am atm:

I was able to create libssl.so.0.9.8 and libcrypto.so.0.9.8

The traditional packaging on AIX is to have both .so images in the .a
archive

However, it seems the Make here will only accept libcrypto.so in /usr/lib
(see details below)

So my new question is: what can I do to convince libssl.a to accept/find
libcrypto.so.0.9.8
in libcrypto.a

Starting point:
root@x093:[/data/prj/openssl/openssl-0.9.8za]wget
-l

exec(): 0509-036 Cannot load program wget because of the following errors:
        0509-022 Cannot load module /usr/lib/libssl.a(libssl.so.0.9.8).
        0509-150   Dependent module libcrypto.so could not be loaded.
        0509-022 Cannot load module libcrypto.so.
        0509-026 System error: A file or directory in the path name does
not exist.
        0509-022 Cannot load module wget.
        0509-150   Dependent module /usr/lib/libssl.a(libssl.so.0.9.8)
could not be loaded.
        0509-022 Cannot load module .
root@x093:[/data/prj/openssl/openssl-0.9.8za]

## what I found is if I used the original libssl.a I could use either old
or new libcrypto.a
## so I started examining different ways to create libssl.a

root@x093:[/data/prj/openssl/openssl-0.9.8za]ar tv shared/*
rwxr-xr-x     0/0     678688 Aug 04 12:18 2014 libssl.so
root@x093:[/data/prj/openssl/openssl-0.9.8za]
root@x093:[/data/prj/openssl/openssl-0.9.8za]slibclean
root@x093:[/data/prj/openssl/openssl-0.9.8za]cp shared/* /usr/lib

# execute wget with member libssl.so.0.9.8 missing
root@x093:[/data/prj/openssl/openssl-0.9.8za]wget -l
exec(): 0509-036 Cannot load program wget because of the following errors:
        0509-150   Dependent module /usr/lib/libssl.a(libssl.so.0.9.8)
could not be loaded.
        0509-152   Member libssl.so.0.9.8 is not found in archive

And member is not found.

Make a new libssl.a with the correct name for the member:

root@x093:[/data/prj/openssl/openssl-0.9.8za]rm shared/*
root@x093:[/data/prj/openssl/openssl-0.9.8za]ar -q -v -o shared/libssl.a
libssl*so*8
ar: Creating an archive file shared/libssl.a.
q - libssl.so.0.9.8
ar: Sequentially ordering and compressing shared/libssl.a.
o - libssl.so.0.9.8
root@x093:[/data/prj/openssl/openssl-0.9.8za]slibclean
root@x093:[/data/prj/openssl/openssl-0.9.8za]ar tv
shared/*
rwxr-xr-x     0/0     678688 Aug 04 12:18 2014 libssl.so.0.9.8
root@x093:[/data/prj/openssl/openssl-0.9.8za]cp shared/*
/usr/lib
root@x093:[/data/prj/openssl/openssl-0.9.8za]wget
-l

Now we are back to the original "complaint" and verify the following
1) libcrypto.so cannot be loaded - and I get this error message with old
and new libcrypto.a
2) using old libssl.a I can use either old or new libcrypto.a # not
included in the email
exec(): 0509-036 Cannot load program wget because of the following errors:
        0509-022 Cannot load module /usr/lib/libssl.a(libssl.so.0.9.8).
        0509-150   Dependent module libcrypto.so could not be loaded.
        0509-022 Cannot load module libcrypto.so.
        0509-026 System error: A file or directory in the path name does
not exist.
        0509-022 Cannot load module wget.
        0509-150   Dependent module /usr/lib/libssl.a(libssl.so.0.9.8)
could not be loaded.
        0509-022 Cannot load module .
root@x093:[/data/prj/openssl/openssl-0.9.8za]

And finally - read exactly what is there: -- Dependent module libcrypt.so
could not be loaded, not as above
        0509-150   Dependent module /usr/lib/libssl.a(libssl.so.0.9.8)
could not be loaded. (libssl.a(member))

root@x093:[/data/prj/openssl/openssl-0.9.8za]cp libcrypto.so /usr/lib
root@x093:[/data/prj/openssl/openssl-0.9.8za]wget -l
wget: option requires an argument -- 'l'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

##
So, thanks for reading - but the question is:
what needs to be done so that libssl.a also looks for
libcrypto.a(membername)?


Thank you!



On Mon, Aug 4, 2014 at 7:06 PM, Sands, Daniel <dnsa...@sandia.gov> wrote:

>  To generate a .a of shared objects instead of static objects, really all
> you do is build the shared object(s) and create an archive out of them.
> There is no special magic about it beyond creating the shared object in the
> first place.  When linking a new program to an archive of shared objects,
> and if you didn't specify an import file, AIX will just use the standard
> static object rules when it searches an archive for likely candidates to
> link in:  First logical member of the archive that has the desired symbol
> will be chosen for inclusion.  The difference is that the static linker
> will see the "shared" flag and just add that member of the archive to the
> file's dynamic loader table instead of statically linking it in.
>
>
>
> On Mon, 2014-08-04 at 08:45 +0200, Michael wrote:
>
> Dear all,
>
> I wish I knew better - howto use ld to craft an archive member, but I do
> not. (Below was sent to openssl-dev, if it arrived, please ignore for
> now - however, once I understand this AND if I figure out a "simple"
> change, I shall submit a patch for future AIX builds.)
>
> ===
>
> To be compatible with the standard AIX libraries I would like to learn
> howto generate a single
> ".so" file that goes into the .a file.
>
> FYI: AIX supports multiple versions of the ssl libraries using this
> convention:
>
> root@x093:[/data/prj/openssl/openssl-0.9.8.27]ar tv /usr/lib/libcrypto.a
> | head
> rwxr-xr-x 370769/647632 2192276 Nov 09 07:44 2009 libcrypto.so.0.9.8
>
> michael@x054:[/data/prj/apache/httpd/test]ar tv /usr/lib/libcrypto.a
> rwxrwxr-x 435159/781431 2965832 May 01 06:57 2014 libcrypto.so.1.0.0
> rwxrwxr-x 435159/781431 2253655 May 01 06:58 2014 libcrypto.so.0.9.8
>
> Members are, as expected, object modules
> michael@x054:[/data/prj/apache/httpd/test]ar xv /usr/lib/libcrypto.a
> x - libcrypto.so.1.0.0
> x - libcrypto.so.0.9.8
> michael@x054:[/data/prj/apache/httpd/test]file libcrypto*
> libcrypto.so.0.9.8: executable (RISC System/6000) or object module not
> stripped
> libcrypto.so.1.0.0: executable (RISC System/6000) or object module not
> stripped
>
> Unfortunately, the archive created by the tarball ./config and make are
> individual .o named object modules.
>
> Again, for compatibility I would like to have them contained in a .so
>
> root@x093:[/data/prj/openssl/openssl-0.9.8.27]ar tv libcrypto.a | head
> rw-r--r--     0/0       6346 Aug 03 15:13 2014 cryptlib.o
> rw-r--r--     0/0       8585 Aug 03 15:13 2014 dyn_lck.o
> rw-r--r--     0/0      11602 Aug 03 15:13 2014 mem.o
> rw-r--r--     0/0       1303 Aug 03 15:13 2014 mem_clr.o
> rw-r--r--     0/0      13806 Aug 03 15:13 2014 mem_dbg.o
> rw-r--r--     0/0       2048 Aug 03 15:13 2014 cversion.o
> rw-r--r--     0/0      13170 Aug 03 15:13 2014 ex_data.o
> rw-r--r--     0/0       2443 Aug 03 15:13 2014 tmdiff.o
> rw-r--r--     0/0       1782 Aug 03 15:13 2014 cpt_err.o
> rw-r--r--     0/0        630 Aug 03 15:13 2014 ebcdic.o
>
> And applications expect the .so.$version as member name
>
> michael@x054:[/data/prj/apache/httpd/test]dump -H /usr/sbin/sshd
>
> /usr/sbin/sshd:
>
>                          ***Loader Section***
>                        Loader Header Information
> VERSION#         #SYMtableENT     #RELOCent        LENidSTR
> 0x00000001       0x00000196       0x000008cc       0x0000006f
>
> #IMPfilID        OFFidSTR         LENstrTBL        OFFstrTBL
> 0x00000006       0x00008fc0       0x00000dde       0x0000902f
>
>
>                          ***Import File Strings***
> INDEX  PATH                          BASE                MEMBER
> 0      /usr/lib:/lib
> 1                                    libc.a              shr.o
> 2                                    libcrypto.a         libcrypto.so.1.0.0
> 3                                    libz.a              libz.so.1
> 4                                    libpam.a            shr.o
> 5                                    libdl.a             shr.o
>
> ===
>
> I am going to look in the ./config for a "shared" versus "not-shared"
> flag that I missed on my first attempt. All suggestions welcome!
>
> Thanks for your assistance!
>
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           majord...@openssl.org
>
>
>

Reply via email to