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

Re: Error making shared lib



"Daniel Jacobowitz" <dan@debian.org> writes:

> On Thu, Aug 16, 2001 at 11:14:34PM -0600, Derrik Pates wrote:
> > Jason E. Stewart wrote:
> > > I just went and ressurected some old code I wrote 3 years ago. It
> > > wants to take a couple of static libs, and make a shared lib out of
> > > the whole bunch using the --whole-archive flag to ld.
> > 
> > Yeah, but you're not passing the flag to ld, you're passing it to gcc.
> > 
> > > Here is the link/compile line:
> > > gcc -shared -Xlinker --whole-archive -L../bin-ppc-Linux -L./../kpl/bin-ppc-Linux -L/usr/lib/ -L/usr/lib/ -lpad
> > > 
> > > Here is an example of the errors:
> > > /usr/lib/gcc-lib/powerpc-linux/2.95.4/libgcc.a(__dummy.o): In function `__dummy':
> > > __dummy.o(.text+0x0): multiple definition of `__dummy'
> > > /usr/lib/gcc-lib/powerpc-linux/2.95.4/libgcc.a(__dummy.o)(.text+0x0): first defined here
> > 
> > Yeah. Try passing -Wl,-whole-archive if you want to pass that option via 
> > a gcc command line, instead of to ld itself.
> 
> Naw, -Xlinker does that too.
> 
> Try ending with -Xlinker --no-whole-archive?  Leaving --whole-archive
> on is never what you really want.

Dan, you're beautiful ;-)

That was it.

Thanks,
jas.



Reply to: