libtool
[Top][All Lists]
Advanced

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

Re: libtool "module" behavior and darwin


From: Guido Draheim
Subject: Re: libtool "module" behavior and darwin
Date: Sun, 24 Nov 2002 23:13:49 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

Guido Draheim wrote:
Benjamin Reed wrote:

[...]
---(snip!)---
kbackgammon_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version

kbackgammon_LDADD = kbackgammon.la $(LIB_KDEGAMES) $(LIB_KSYCOCA)
kbackgammon_SOURCES = dummy.cpp
---(snip!)---

...this is a no-no, kbackgammon is trying to link against a bundle, and bombs with:

---(snip!)---
ld: ./.libs/kbackgammon.so is input for the dynamic link editor, is not relocatable by the static link editor again
---(snip!)---
[...]

 > is to make it so that if libtool is trying to link against a bundle,
 > it will link against the .a if it's available instead.

 > While I and some of the other finkers have hacked on libtool some, I am
 > not sure any of us even know where to start to implement this behavior
 > in libtool.


Do you guys have any pointers or suggestions as to where to make these changes, or a better way of handling this issue?


doh, so some kde programmers have tricked libtool. To make sharedlibrary
creation being platform independent is tricky in itself, and module
support has made for a lot of dark corners on the way to it.

The only hint that I can give has the form of a question: Did you try
 kbackgammon_LDADD = -static kbackgammon.la $(LIB_KDEGAMES) $(LIB_KSYCOCA)
 kbackgammon_SOURCES = dummy.cpp

$ ./libtool --help --mode=link | grep static
  -all-static       do not do any dynamic linking at all
  -static           do not do any dynamic linking of libtool libraries
                                                   ^^^^^^^^^^^^^^^^^^^^


To the libtool'ers:

Wouldn't it be correct to assume -static on each .la being a -module ?

From my point of view, a module isn't usually to be installed in an
ld.so reachable directory (or dylib path equivalent on darwin). The
dlopener' has to know where to find it, how to open it, to init it,
and clean it out again. However, here the kde guy did not want to
dlopen it anyway, he did want to pre-bind it to the binary, and only
this binary. In this case, even main() is in that "library" - well,
actually it isn't a shared library, it's inherently taken the form of
an object archive - otherwise known as ".a".

So the question goes: are there real places where a -module has a
valid used to be linked non' -static into a binary? Personally,
I do doubt that, and even that there is an esoteric case, it might
be worthwhile to try to add a warning - if a kde guy links a -module
into a binary without -static then he should see a message flashing
by that reads (in nice friendly letters):

warning: please use -static to link -module archives into binaries.

I mean, that should also be seen on other platforms than darwin, right?
Or am I mistaken here? (I wouldn't count myself to know large parts of
libtool indepth, well, then again, who still does ;-) ...)

cheers, guido





reply via email to

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