Hello Ralf,
Ohh thanks for your reply and i start to understand what is going on. You
tell everything very well. It is amazing. After i read your mail, I export a
variable
export LDFLAGS="-Wl,-brtl" and now i find shared object files (.so) in
their proper places after compilation. At first glance everything seems ok
but when i tried to start dovecot
Edlopen(/usr/local/lib/dovecot/imap/lib10_quota_plugin.so) failed: rtld:
0712-001 Symbol i_malloc was referenced
     from module /usr/local/lib/dovecot/imap/lib10_quota_plugin.so(), but a
runtime definition
           of the symbol was not found.
rtld: 0712-001 Symbol i_strdup was referenced
     from module /usr/local/lib/dovecot/imap/lib10_quota_plugin.so(), but a
runtime definition
           of the symbol was not found.
rtld: 0712-001 Symbol default_pool was referenced
     from module /usr/local/lib/dovecot/imap/lib10_quota_plugin.so(), but a
runtime definition
           of the symbol was not found.
rtld: 0712-001 Symbol mail_storage_get_mailbox_path was referenced
     from module /usr/local/lib/dovecot/imap/lib10_quota_plugin.so(), but a
runtime definition
           of the symbol was not found.
rtld: 0712-001 Symbol i_info was referenced
     from module /usr/local/lib/dovecot/imap/lib10_quota_plugin.so(), but a
runtime definition
           of the symbol was not found.
rtld: 0712-001 Symbol mountpoint_get was referenced
     from module /usr/local/lib/dovecot/imap/lib10_quota_plugin.so(), but a
runtime definition
           of the symbol was not found.
rtld: 0712-001 Symbol i_error was referenced
     from module /usr/local/lib/dovecot/imap/lib10_quota_plugin.so(), but a
runtime definition
           of the symbol was not found.
Additional errors occurred but are not reported.
Error: imap dump-capability process returned 89

This symbols are not found. Now i get happy that i see the same error
message as you but the thing that i cannot understand these .exp files. I
have these exp files in their places, and they are created by aix linker. (I
am using aix linker. IBM doesnt advice using gnu linker
http://www-128.ibm.com/developerworks/aix/library/au-gnu.html)
./dovecot-1.0.rc28/src/plugins/acl/.libs/lib01_acl_plugin.exp
./dovecot-1.0.rc28/src/plugins/convert/.libs/lib20_convert_plugin.exp
./dovecot-1.0.rc28/src/plugins/quota/.libs/lib10_quota_plugin.exp
./dovecot-1.0.rc28/src/plugins/imap-quota/.libs/lib11_imap_quota_plugin.exp
./dovecot-1.0.rc28
/src/plugins/lazy-expunge/.libs/lib02_lazy_expunge_plugin.exp
./dovecot-1.0.rc28/src/plugins/mail-log/.libs/lib20_mail_log_plugin.exp
./dovecot-1.0.rc28/src/plugins/trash/.libs/lib11_trash_plugin.exp
Do u mean that i have to point these exp files with linker flag -bexpall .
From your script i can not understand. Maybe you can give an example with
export LDFLAGS="bexpall bla bla"
Thanx and best regards.

2007/3/28, Ralf Becker <[EMAIL PROTECTED]>:

Hello funkypunky drunky,

on AIX dovecot plugins (which are shared objects = .so) are a little bit
problematic. It is not enough to activate run time linking by using
-brtl and make the main program (dovecot) to be able to use shared
objects. When a share object does function calls back into the main
program, all these functions (=symbols) in dovecot have to be explicitly
exported. Otherwise you see "signal 11" or so.

Because this is very fiddly, there is a linker flag -bexpall to export
all symbols of the main program (dovecot)... but this does seemingly not
work with symbols defined in static libraries (.a).

While dovecot build creates static libraries to keep the linker command
line small, but does *not* generate export files (.exp) containing the
libraries globals symbols, the compile time linker does not known
anything about them.
I think, if dovecot build would use libtool to create the libraries,
libtool would export the libraries symbols to fix this.

And this is, what my script does. It looks on the compiler command line
for library file (.a) and exports all global symbols to an .exp file.
The paths of these .exp files are appended to the original compiler
command line and so -bexpall knows about the globale symbols defined in
the libraries and is able to export them.

I don't know if this information is useful for you, because you're using
gcc. But if you are using AIX ld (instead of gnu ld) you have to deal
with this problem, I think.

Regards, Ralf

funkypunky drunky schrieb:
> Hi Ralf
> I check your script. But i cannot udnerstand what you  do. R u trying to
> export the library of the dovecot? I cannot go deeper.  Anyway would you
> like to tell what did you do with XLC compiler. Maybe i can setup the
> analogy of it when using gcc instead of XLC.
> Best regards.
>
>
> 2007/3/27, Ralf Becker <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]
>>:
>
>     Hello!
>
>     Have you tried to export all symbols defined in lib archives
generated
>     while dovecot is build? I've had this problem on aix with xlC and
>     solved
>     it by writing an compiler script for doing that.
>
>     See
>        http://www.dovecot.org/list/dovecot/2007-February/019226.html
>     and
>        http://wiki.dovecot.org/AixPluginsSupport
>
>     Regards, Ralf
>
>     Timo Sirainen schrieb am 26.03.2007 21:08:
>     > On Mon, 2007-03-26 at 09:24 +0300, funkypunky drunky wrote:
>     >> I pasted the output of gdb. I hope it is usefull. Thanx
>     >>
>     >> This GDB was configured as "powerpc-ibm-aix5.1.0.0"...
>     >> Core was generated by `imap'.
>     >> Program terminated with signal 11, Segmentation fault.
>     >> #0  0xd1a468cc in i_malloc ()
>     >>    from /usr/local/lib/dovecot/imap/lib10_quota_plugin.so
>     >> (gdb) bt full
>     >> #0  0xd1a468cc in i_malloc ()
>     >>    from /usr/local/lib/dovecot/imap/lib10_quota_plugin.so
>     >> No symbol table info available.
>     >> #1  0xd1a47cc8 in quota_init () at quota.c:32
>     >
>     > So it crashes at the first Dovecot function it tries to call.
Perhaps
>     > the imap binary isn't exporting the symbols, or something like
that.
>     > I've no idea. Anyway it is most likely related to some linking or
>     > compiling flags (or the linker/compiler itself).
>     >
>
>     --
>
______________________________________________________________________
>
>     Dipl.-Inform. (FH) Ralf Becker     Rechenzentrum (r/ft) der FH Trier
>     (Network|Mail|Web|Firewall)           University of applied sciences
>     Administrator                           Schneidershof, D-54293 Trier
>
>     Mail: [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>                      Fon: +49 651 8103
499
>     WWW:  http://www.fh-trier.de/~beckerr          Fax: +49 651 8103 214
>     PGP:  http://www.fh-trier.de/~beckerr/pgp      ICQ: <available>
>
______________________________________________________________________
>
>     Wenn Gott gewollt haette, dass E-Mail in HTML geschrieben wuerden,
>     endeten Gebete traditionell mit </amen>. (Tom Listen)
>
>

--
______________________________________________________________________

Dipl.-Inform. (FH) Ralf Becker     Rechenzentrum (r/ft) der FH Trier
(Network|Mail|Web|Firewall)           University of applied sciences
Administrator                           Schneidershof, D-54293 Trier

Mail: [EMAIL PROTECTED]                      Fon: +49 651 8103 499
WWW:  http://www.fh-trier.de/~beckerr          Fax: +49 651 8103 214
PGP:  http://www.fh-trier.de/~beckerr/pgp      ICQ: <available>
______________________________________________________________________

Wenn Gott gewollt haette, dass E-Mail in HTML geschrieben wuerden,
endeten Gebete traditionell mit </amen>. (Tom Listen)



Reply via email to