libtool
[Top][All Lists]
Advanced

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

Explicit init/finalization in a libtool .so/.dll


From: Kaelin Colclasure
Subject: Explicit init/finalization in a libtool .so/.dll
Date: Tue, 6 Feb 2001 11:35:09 -0800

Greetings,

I'm a relative newcomer to libtool and have just subscribed to this list,
so please forgive me if I'm re-raising an old issue here.

I have noticed an issue with including explicit _init and _fini
definitions in a Linux .so with the following version of libtool:

address@hidden downloads]$ libtool --version
ltmain.sh (GNU libtool) 1.3.4 (1.385.2.196 1999/12/07 21:47:57)

I understand the problem and know how to resolve it when not using
libtool. And I also found via google an article which describes a
`fix' using something like `-Wc,-nostartfiles' to pass the required
option through libtool directly to gcc. However I have a few
questions about this approach.

 1) First, is this indeed implemented in the current, latest CVS
    version of libtool? If so, is it anticipated that this is going
    to be released this way?

 2) If I grab a snapshot of libtool from CVS and install it on my
    development machine, will an `autoreconf' be sufficient to
    integrate the new version into my package? And will people I
    distribute this to need to do anything special? (I believe
    not in the latter case, but I would like an authoritative
    answer.)

 3) Is this approach considered a completely satisfactory solution?

My third question something of a troll, in that I see this as a bit
of a side-step around the issue of how to deal with an admittedly
thorney problem. Ideally I would like to see libtool explicitly
support the concept that some .so/.dll libraries on some platforms
have load-time initializers and unload-time finalizers. However,
in practical terms I have no idea how many libtool platforms
actually support this or how homogeneous a solution could appear.

I do know Solaris and Linux both use _init and _fini. And I have
build Win32 .dll's that had explicit load/unload behavior -- though
I forget now some of the details. [ISTR it was primarily a matter
of telling the linker what function to call on attach/detach, and
there were some arguments, etc. Not easily reconciled with the
comparitively simple approach on Unix.]

My motivation for bringing this up is that I do need to incorporate
*some* fix for this in my package, and if there's interest in some
collaboration on an alternative approach I'd view it as a good
excuse to learn more about the implementation of libtool.

-- Kaelin



reply via email to

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