On Thu, 21 Jul 2011, L A wrote:

I am trying to cross compile a library on a linux machine. The
libstdc++.a that comes with the toolchain is not compiled with fPIC
and it is binary only. I would like to use the so file instead.
However libtool keeps linking libstdc++.a (as whole-archive) and I get
relocation errors. Any ideas about how to work around this?

Where is the static version being specified? Look at the command line to libtool and the command line libtool passes to g++. If libstdc++.a appears on the former, then you have a makefile problem. If libtool is adding it, then there are a couple places to look.

Is some "--static" flag being passed?
Is libstdc++.a coming from a .la file?

If nothing obvious appears, calling the original libtool command with an extra --debug should spew trace information. Redirect to a file and then open in a text editor to see where the static name first appears and why.

Common fixes:
- fix the makefile
- fix/hide the offending .la file
- hide the .a file

Later,
Daniel

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool

Reply via email to