On 06/30/2015 06:01 PM, Srihari Radhakrishnan wrote:
Hello,
I'm trying to build the dyninst library on my machine, and I'm running
into the following issue :
Linking CXX shared library libdynDwarf.so
/usr/bin/ld:
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libdwarf.a(dwarf_alloc.o):
relocation R_X86_64_32S against `.rodata' can not be used when making a
shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libdwarf.a: could not
read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [dwarf/libdynDwarf.so.8.2.1] Error 1
make[1]: *** [dwarf/CMakeFiles/dynDwarf.dir/all] Error 2
make: *** [all] Error 2
How do I fix this issue? I'm using Dyninst-8.2.1, and am configuring the
project using "cmake --with=libdwarf-static", but it's still building
the dynamic library.
Dyninst can't build against a non-PIC libdwarf.a, as we can't link a
non-PIC static library into PIC shared libraries. There are three ways
to work around this:
* Remove the libdwarf dependency from Dyninst's build system, and be
sure to build your Dyninst-based program with libdwarf linked in (and
not as a PIE).
* Build your own PIC libdwarf.a, and point Dyninst at that.
* Build your own libdwarf.so, and point Dyninst at that.
I have never understood why libdwarf's default installation is so
user-hostile, but it unfortunately is...
Any help would be greatly appreciated.
Regards,
Srihari
_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
--
--bw
Bill Williams
Paradyn Project
bill@xxxxxxxxxxx
|