On Fri, 2008-08-01 at 09:46 +0200, Markus Hoenicka wrote:
> Quoting Balazs Scheidler <[EMAIL PROTECTED]>:
> 
> >
> > Hi,
> >
> > I was trying to compile libdbi on AIX 5.2, which lacks RTLD_NEXT used by
> > libdbi to resolve something called "custom functions".
> >
> > I've grepped the libdbi-drivers code, and none of the drivers currently
> > use custom_functions.
> >
> 
> The custom_function interface has been around since the days of yore  
> (i.e. before I joined the project) without a proper documentation. I  
> assume it was originally intended to allow drivers to export  
> additional functions which extend the libdbi API for that particular  
> driver. No driver has used the interface this way yet. However we  
> received a request lately to support some PostgreSQL client library  
> functions which are not covered by the libdbi API. This led to the  
> idea to export all client library functions through the  
> custom_function interface to make them available to libdbi end-users  
> (who should know what they're doing as this leads to driver-specific  
> code in their programs). This is also why no driver accesses this  
> interface, but many drivers export functions via this interface (at  
> least in cvs).
> 
> > I was wondering what the aim with this function is, and whether I could
> > replace RTLD_NEXT with the driver's shared object handle. E.g. something
> > like this:
> >
> > [EMAIL PROTECTED]:~/src/libdbi8-0.8.3/src$ diff -u dbi_main.c 
> > dbi_main.c-bazsi
> > --- dbi_main.c      2008-06-02 14:45:33.000000000 +0200
> > +++ dbi_main.c-bazsi        2008-08-01 08:57:46.000000000 +0200
> > @@ -1277,7 +1277,7 @@
> >  /*                         snprintf(function_name, 256, DLSYM_PREFIX 
> > "dbd_%s", custom->name); */
> >  /*                         printf("loading %s<<\n", custom->name); */
> >
> > -                   custom->function_pointer = my_dlsym(RTLD_NEXT, 
> > custom->name);
> > +                   custom->function_pointer = my_dlsym(driver->dlhandle, 
> > custom->name);
> >                     if (!custom->function_pointer) {
> >  /*                           printf(my_dlerror()); */
> >                       /* this usually fails because a function was
> >
> >
> 
> Please have a look at the latest cvs revisions of dbi_main.c and the  
> related autotools files (configure.in, Makefile.am etc.). The dlsym  
> stuff is platform-dependent, and I've started to implement a mechanism  
> which autodetects the proper value of the handle. If AIX requires  
> dlhandle, it is a matter of setting DLSYM_HANDLE appropriately in  
> configure.in for this platform. I'd greatly appreciate if you could  
> test the current cvs revision of libdbi on AIX and report whether the  
> tests in place work appropriately for that platform.

If these functions are indeed exported by the driver module, I don't see
why you are using RTLD_NEXT at all. You could simply resolve the symbol
from the shared object itself. Or am I missing something?

We need to test the functionality on AIX, so we will. I drop you an
email once we did that.

-- 
Bazsi


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libdbi-drivers-devel mailing list
Libdbi-drivers-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libdbi-drivers-devel

Reply via email to