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

Re: Error making shared lib



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.

Derrik Pates
dpates@dsdk12.net



Reply to: