Hello.

I have a tricky problem - I was wondering if libtool could solve it (or
could be made to solve it) or at least if someone here knows about these
problems and could help me.

When linking a unix tool program with GNUstep, it must be linked against
two libraries: -lobjc (Objective-C runtime) and -lgnustep-base (GNUstep
base).

Till now, libobjc was static, and gnustep-base was shared.
What happens is that GNUstep base is overriding a couple of symbols
of the Objective-C runtime.  To perform this, the two libraries need
to be linked in the following order:
-lgnustep-base -lobjc
This makes sure that the symbols we are talking about are looked up first
in GNUstep base, found there, and looked nowhere else - no problem occurs.

Now a switch to a shared libobjc is planned.
What happens in this case is that - not clear why - to get the same
effect, we need to reverse the order at compile time:
-lobjc -lgnustep-base   works (experimentally), while
-lgnustep-base -lobjc   does not work any longer (don't know why).

At this point, I think I would need to write some code to test if libobjc
is shared or not, and change the order as a consequence.

I was wondering if libtool does not already do that for me...
Anybody here is aware of this problem ?  Is it a bug in the dynamic
linker ?  Does libtool provide any facilities in these situations to
hide the difference between shared and static libraries ?

Reply via email to