4

I'm trying to link some 3rd party static libraries into a dynamic library. However I get the error -

relocation R_X86_64_32 against `TMC_END' can not be used when making a shared object; recompile with -fPIC

On Solaris, you can tell GCC/ G++ to allow linking with code that wasn't compiled with -fPIC, through the option -mimpure-text. (Found via great answer here) However this option isn't recognized on Ubuntu (16.04, g++ version 5.4.0):

g++: error: unrecognized command line option ‘-mimpure-text’

Is there any equivalent option, or any other solution except for compiling the 3rd parties static libraries with -fPIC enabled?

Thanks!
P.S Excellent explanation on relocations here

Community
  • 1
  • 1
rkellerm
  • 5,362
  • 8
  • 58
  • 95

0 Answers0