[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Supporting -export-dynamic on AIX

From: Peter O'Gorman
Subject: Re: Supporting -export-dynamic on AIX
Date: Sun, 02 Jul 2006 22:58:23 +0900

On Tue, 2006-06-20 at 12:12 -0500, Albert Chin wrote:
> On Sun, Jun 11, 2006 at 01:14:23AM -0500, Albert Chin wrote:
> > On Sat, Jun 10, 2006 at 07:12:34PM -0500, Albert Chin wrote:
> > > On Sun, Jun 11, 2006 at 01:04:17AM +0200, Ralf Wildenhues wrote:
> > > > * Albert Chin wrote on Sat, Jun 10, 2006 at 08:49:29PM CEST:
> > > > > On Sat, Jun 10, 2006 at 08:29:44PM +0200, Ralf Wildenhues wrote:
> > > > > > * Albert Chin wrote on Sat, Jun 10, 2006 at 08:08:15PM CEST:
> > > > > > > Any reason we don't use -bexpall to support -export-dynamic on 
> > > > > > > AIX?
> > > > > > 
> > 
> > I'm thinking of a patch along the lines of the one below. What do you
> > think?
> Well, this has some problems. First, if only export_dynamic_flag_spec
> is set, the new export list code is wrong. Fixed in the patch below.

Albert and I have talked about this a little off-list. There are a
couple of issues with Albert's patch. We really need to export all
symbols from the executable, so we need to add static libraries and
convenience archives too. Since the $convenience variable is not set
at the time export_dynamic is checked, I moved this much closer to the
program link stage. Then I could build and run irssi on aix with perl

> The second problem is when libtool is passed multiple source files,
> rather than object files to create the executable. This method totally
> fails then. What to do in this case?

I don't think this is supported, it works "by accident" because unknown
things are simply added to $compile_command, the source files get added
to the compile command and the compiler does the right thing. If you try
this when building a library, it will fail:
$ libtool --mode=link gcc -o libfoo.c
ar cru .libs/libfoo.a

...empty archive created.

Albert also questioned the documentation:

>   On some operating systems, a program symbol must be specially
> declared
>   in order to be dynamically resolved with the `dlsym' (or equivalent)
>   function.
>      Libtool provides the `-export-dynamic' and `-module' link flags
>   (*note Link mode::), which do this declaration.  You need to use
> these
>   flags if you are linking an application program that dlopens other
>   modules or a libtool library that will also be dlopened.
> Should the last sentence above end with ", respectively"?

I think this is a documentation bug. -export-dynamic does not imply
-module, there is a line of code in ltmain that adds dlname to the .la
file if either -module or -export-dynamic was specified, but this only
"works" if modules and libraries are otherwise equivalent, so it should
probably be removed and the documentation adjusted for HEAD, thoughts?
Either way this patch does not affect that behavior at all.

Here are patches against branch-1-5 and HEAD, okay (with apropriate
ChangeLog, of course)?


Attachment: export_dynamic-1.5.diff
Description: Text Data

Attachment: export_dynamic.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]