bug-libtool
[Top][All Lists]
Advanced

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

Re: libtool cannot handle _init()and _fini()


From: Gary V. Vaughan
Subject: Re: libtool cannot handle _init()and _fini()
Date: Mon, 05 Jul 2004 15:09:55 +0100
User-agent: Mozilla Thunderbird 0.7 (X11/20040615)

Hi Martin!

Martin Kammerhofer wrote:
> Libtool 1.5.6 fails to produce a shared library with _init() and/or
> _fini() functions. This is because
> (in the case of a GNU toolchain) option -nostdlib is missing. (Libtool
> 1.5.6 has -nostdlib only
> for C++, 1.4.x and older versions do not have it at all.)

That's a feature!  If you build a module loader that relies on _init and
_fini, then the portability of such modules is compromised.

If you need initialisation and finalisation, then you should put in your
own functions and call them at module load/unload time by hand with the
help of lt_dlsym.

If, on the other hand, you are trying to write a module for a program that
needs _init and _fini, then *it* is unportable and tied to (presumably)
dlopen.  You don't need libltdl at all, just use the system dlopen apis.

Hmmm... wait.  Are you asking about link time shared libraries in C++?
Are you saying that you think libtool *should* add -nostdlib to LDFLAGS?
You can pass it through yourself with -Xlinker options to libtool.  Or do
you think that the -nostdlib is bogus?  Please explain why if that is the
case.

HTH,
        Gary.
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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