[Top][All Lists]

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

Re: Problem with libtool under HPUX: BIND_FIRST flag is required

From: Jan Giesen
Subject: Re: Problem with libtool under HPUX: BIND_FIRST flag is required
Date: Sun, 27 Nov 2005 22:56:26 +0100

Dear Ralf

You wrote:
> Hi Jan,
> * Jan Giesen wrote on Fri, Nov 25, 2005 at 11:16:26PM CET:
> > I have encountered a libtool problem, when I tried to build
> > cvsnt (cf. under HPUX 11.11.
> > This problem could be reproduced with libtool version 1.5.6
> > as well as with 1.5.20:
> Hrmpf, I need to fill out some stupid form in order to be able to
> download this?

The cvsnt source code can be downloaded directly from
Corresponding email discussion list are

The problem was first discussed on the cvsnt-dev list :

Note that the last cvs verion does not build without
some small tweaks on HPUX 11.11; c.f. the comments on the cvsnt-dev list.

> > Subroutines in shared libraries, which are loaded at runtime
> > using libtldl are not correctly linked. The problem could be
> > solved by adding the BIND_FIRST parameter to the LT_BIND_FLAGS
> > Define in ltdl.c:
> >
> Browsing some documentation it may be we'd also need BIND_TOGETHER if we
> add BIND_FIRST[1].  But..
> > Background:
> > ===========
> > cvsnt loads at runtime a set of "trigger" libraries. These trigger
> > libraries are shared libraries, which are implemented in C++ and
> > are loaded using the libtool routines in ltdl.c.
> > All trigger libraries export the same set of symbols, which are
> > used to invoke specific functions (e.g. init(), etc.).
> > If the trigger libraries are loaded in the sequence A, B, C,..
> > then it happens that a call to the init() function of library B or C
> > does not invoke this init() function, but the init() function of
> > library A.
> > This behaviour in in line with the HPUX docu, but different to the
> > behaviour under Linux RedHat and it breaks cvsnt. By specifing
> > BIND_FIRST the problem could be avoided.
> >
> > Therefore I propose that in ltdl.c the flag BIND_FIRST is by default
> > part of LT_BIND_FLAGS.
> This description is pretty good, but not good enough for me to totally
> understand what you are (or cvsnt is) trying to do.  Like this?
>   handle_A = lt_dlopen ("");
>   handle_B = lt_dlopen ("");
>   handle_C = lt_dlopen ("");
>   void (*) pf (void);
>   pf = lt_dlsym (handleA, "init");
>   pf (...);
> all from the main program?  Or maybe you open B from within A?
> Or is init() the initializer function of the modules, and you don't ever
> call it explicitly?

The trigger libraries export a GetCvSInfo function:
   extern "C" trigger_interface *GetCvsInfo(int version)
which returns the pointer to a function call table:
static trigger_interface callbacks =

init, close, pretag etc. are defined in the source code of the trigger
library, e.g. :
int close(const struct trigger_interface_t* cb)
 return 0;
The trigger libraries are itself loaded explicitly with lt_dlopen(), but not
in the main programm, but in a another shared library, which is implicit
loaded from the main program.
To access a trigger library a pointer to the GetCvsInfo function is
requested via lt_dlsym(). The invocation of the GetCvsInfo function returns
the pointer to the "callbacks" function call table. The programm expects
the function pointers in the call table are properly initialized by the
share library loader; which is not the case, if "BIND_FIRST" is missing
and it's not the first trigger library which is loaded.

Note: I can also provoke the problem under Linux using the default settings
of Libtool 1.5.20 in ltdl.c. Since ltdl.c use by default the loader flag

> Note also that I can't test this, but there is hope that this situation
> changes soon.   Meanwhile, it would be good if someone else could look
> at this as well.
> > > After extending this Define, the trigger libraries are loaded and
> > > initialized.  This is in-line with the HPUX documentation.
> > >
> > > Unfortunately I have still a crash dump after unloading the last
> > > library...  Not everything is solved with this patch.
> Hmm.  Does this have to do with libltdl, too, or is it cvsnt specific?

I suspect a problem with the HPUX link environment; since our HPUX 11.11.
use relatively old versions (11.33 or 11.37) of ld,, crt0.0 etc., but
the newest version is 11.47. I have seen some emails on the net, which
a crash dump under similiar conditions; which was solved by applying a
"ld(1) and linker tools cumulative patch" e.g. PHSS_30970.

> Cheers,
> Ralf
> [1]

Best regards
               Jan Giesen

reply via email to

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