TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG-DEVEL:124] C++/C linking problems



On Fri, Mar 03, 2000 at 06:54:10PM -0600, Scott J. Pekarek wrote:
> 
> I thought it odd as well - and I may be doing it wrong but when I use
> the -frepo option they show up for every object file which
> instantiates a template - like foo.o and foo.rpo.  I can't seem to
> find it now but I thought I read some where that "collect2" gathered
> these things up as part of the link phase and made sure that the
> templates where properly instantiated in the executable- which does
> not seem to be happening either.

	Oh, that's a template instantiation option.  My response
would've been the same.  gcc's default behavior seems just fine.  :-)
Especially on ELF systems where you have weak symbols.  Even if it
instantiates the same template in every file, all the instantiations
will be squished into one at link time.

> At any rate I found a couple cygnus threads on -frepo and it turns out
> a number of people have reported various problems with -frepo.  There
> is a guy from cygnus (Martin) who recommends not using -frepo.  He
> says to use no template specific options, that gcc will figure it out
> and -frepo has bugs AND the documentation maybe should be updated to
> reflect this.  I tried and ended up with a whole new set of problems.
> So then I downloaded and upgraded my compiler to 2.95.2 and am working
> on that no - with no -frepo option.  So far it looks better.
> 
> I don't believe the -fpic is necessary for building shared libraries
> but it shouldn't hurt.  I am a minimalist if I can get away with it.

	I'm nearly positive -fPIC is needed.  Every program I've seen
that builds a shared library uses it.  I could only imagine it not being
used on an architecture in which there weren't any position dependent
instructions.  The x86 architecture is most certainly not one of these.

Have fun (if at all possible),
-- 
Its name is Public Opinion.  It is held in reverence. It settles everything.
Some think it is the voice of God.  Loyalty to petrified opinion never yet
broke a chain or freed a human soul.     ---Mark Twain
-- Eric Hopper (hopper@omnifarious.mn.org  http://omnifarious.mn.org/~hopper) --

PGP signature