[Top][All Lists]

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

Re: MLB merge is done! Hurray! -- Fooey ;-)

From: Boris S Kolpackov
Subject: Re: MLB merge is done! Hurray! -- Fooey ;-)
Date: Tue, 26 Jun 2001 18:15:20 +0400

Hi folks,

I'm quite new to libtool so excuse my ignorance if any.

I saw all these messages about MLB and decided to give it a try from the c++
point of view. I've downloaded HEAD brunch from CVS and wrote small project
which implements small class in library with static initialization and main
program which uses this instance from the library (typical singleton pattern
implementation). I checked that it works fine when I build manually with gcc
(my host is Solaris2.8 x86). But when I build using libtool strange things
started to happen. First of all I can see that ctor in the library doesn't
get called. I tried to find difference between manual building and when I
build with libtool. Here is what I found:

1. When I link with gcc -v -shared it uses collect2 linker. But libtool uses
/usr/ccs/bin/ld. Furthermore gcc links with different runtime code (like
crtbegin.o, crtend.o, etc) while libtool doesn't.

2. I tried to extract all this info and set LD accordingly before running
configure. Everything went fine except constructor still doesn't get called.
After a while I understood (and checked) that order in which all this
runtime code links is important.

I can't do anything with libtool to make it working. I could have been able
to solve this if there were something like PRELDFLAGS and POSTLDFLAGS. But
it would be ugly. Furthermore I would have to tweak each compiler manually
which is bad thing.
So any thoughts?



reply via email to

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