[Top][All Lists]

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

problem with libtool 1.5.6

From: Пухальский Юрий Андреевич
Subject: problem with libtool 1.5.6
Date: Wed, 21 Apr 2004 15:37:21 +0400



There is a problem with libtool 1.5.6 while building shared libraries.

If we configure and find standard ld (/usr/ccs/bin/ld), then libtool uses it while building shared library. But the initialization and finalization routines are not being mentioned (these are options –z initarray and –z finiarray). However, if we set LD=/opt/SUNWspro/bin/cc, then it works ok.

For example, if we have small program to compile with “cc: Sun C 5.5 2003/03/12” from Sun ONE Studio 8:



void mod_init()



void mod_fini()


#pragma init(mod_init)

#pragma fini(mod_fini)


and make a shared library:

  1. cc –KPIC –DPIC –G –o libaaa.so aaa.c


  1. cc –KPIC –DPIC –c aaa.c; ld –G –o libaaa.so aaa.o

in first case we have routines called, in second one – this is what libtool –-mode=link does - we haven’t.


I use the workaround – setting LD to cc, but the other solution may be the unified way of specifying initialization and finalization routines with some options to libtool –mode=link. We have pragmas in Sun cc, another way in gcc, and whatever in other compilers.

reply via email to

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