Not exactly. ld on AIX 4.2+ has the -bexpall flag to export everything, but
this flag does bad things on shared libraries, and should only be used on
executables.

I sent you patches for AIX before. These are the rules I use in our
Makefile. They work on all platforms:

$(SHRCRYPTO): lib/$(LIBCRYPTO).a
        ld -r -o $(LIBCRYPTO).o $(ALLSYMSFLAG) lib/$(LIBCRYPTO).a
        -nm -Pg $(LIBCRYPTO).o | grep ' [BD] ' | cut -f1 -d' ' >
$(LIBCRYPTO).exp
        $(CC) $(SHAREDFLAG) -o $@ $(LIBCRYPTO).o

$(SHRSSL): lib/$(LIBSSL).a $(SHRCRYPTO)
        ld -r -o $(LIBSSL).o $(ALLSYMSFLAG) lib/$(LIBSSL).a
        -nm -Pg $(LIBSSL).o | grep ' [BD] ' | cut -f1 -d' ' > $(LIBSSL).exp
        $(CC) $(SHAREDFLAG) -o $@ $(LIBSSL).o $(SHRCRYPTO)

The ALLSYMSFLAG is "-bnogc" for AIX, which turns off garbage collection
and bypasses the step where the linker removes unreferenced objects. For
Linux the flag is "-whole-archive", for Solaris "-z allextract". Obviously
the contents of "lib/$(LIBXX).a" is assumed to be PIC code. I haven't
configured this on any other platforms recently, so I don't have the
corresponding flags, but it shouldn't be hard to find them.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Richard Levitte - VMS
> Whacker
> Sent: Friday, April 27, 2001 8:11 AM
> To: [EMAIL PROTECTED]
> Subject: Shared libraries on AIX...
>
>
> I'm looking a bit at building shared libraries on AIX, and would like
> to know if there is a way at all to just tell ld to extract everything
> from a static library (libcrypto.a), put it in a shared library
> (libcrypto.a) and export all available global symbols?
>
> I know it's possible to create an exported symbols file (libcrypto.exp?)
> and use that, but I'd like to avoid that if possible, it feels like a
> very unneeded step, and full of possibilities to make a fool out of
> yourself (by forgetting).
>
> On all other Unixen I've played with, there's the possibility to do
> what I want to do (hence the diverse do_*-shared targets in
> Makefile.org), and I just can't believe such a thing wouldn't be
> possible on AIX...
>
> Then perhaps, I'm just too optimistic...
>
> --
> Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
> Chairman@Stacken   \ S-168 35  BROMMA  \ T: +46-8-26 52 47
> Redakteur@Stacken   \      SWEDEN       \ or +46-709-50 36 10
> Procurator Odiosus Ex Infernis                -- [EMAIL PROTECTED]
> Member of the OpenSSL development team: http://www.openssl.org/
> Software Engineer, Celo Communications: http://www.celocom.com/
>
> Unsolicited commercial email is subject to an archival fee of $400.
> See <http://www.stacken.kth.se/~levitte/mail/> for more info.
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [EMAIL PROTECTED]
> Automated List Manager                           [EMAIL PROTECTED]
>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to