Dervin Thunk
Dervin Thunk

Reputation: 20140

linker error: what could be going on?

I know not many people have telepathic powers here, but I will try to give as much info as I can so someone can help me debug what I think is a linker error in some program I'm trying to compile.

So, the program is cilkprof (see here, warning: tgz file). Within it is a Makefile for which I only changed the var CXX = icpc to CXX = g++. All else is equal.

/usr/bin/ld: ../../3rdparty/pintool/intel64/lib/libpin.a(util_host_ia32e.os): 
relocation R_X86_64_PC32 against symbol `DoXsave' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [linux64/cilkprof.so] Error 1

I know I should be understanding that libpin.a should be recompiled with -fPIC, but the pin version I have is already compiled. Any idea what I may be doing wrong? Please ask if something is not clear. Thanks.

Upvotes: 0

Views: 288

Answers (1)

iabdalkader
iabdalkader

Reputation: 17332

It seems to me that the Makefile is trying to build a shared library and link it to a static non-PIC library, which is AFAIK, something you can't do. So if you can not recompile the libray with -fPIC then the only solution I see is to modify the Makefile and build a static library instead.

Upvotes: 1

Related Questions