Search code examples
static-librarieslinker-errorslibtoolrelocationfpic

Avoiding linking against static libraries when using libtool


I am trying to cross compile ImageMagick on a linux machine. The libstdc++.a that comes with the toolchain is not compiled with fPIC. I would like to use the so file instead. However libtool keeps linking libstdc++.a (as whole-archive) and I get relocation errors. I have seen the same issue with other libraries as well. Any ideas?


Solution

  • Deleting all the la files from the toolchain folder helped. My guess is without the la files, libtool does a search and finds the dynamic libraries.