ThoughtGang / opdis

libopcodes-based disassembler
GNU General Public License v2.0
35 stars 10 forks source link

compilation errors #18

Closed zhangzhenkai closed 8 years ago

zhangzhenkai commented 8 years ago

Hi,

I want to try opdis, but I couldn't make it compiled.

I compiled binutils-2.26 and installed it to a path, say, /home/xyz/projects/binutils I cloned opdis and ran the following commands:

./bootstrap ./configure CPPFLAGS=-I/home/xyz/projects/binutils/include LDFLAGS=-L/home/xyz/projects/binutils/lib make

but it gives me this error: /usr/bin/ld: /home/xyz/projects/binutils/lib/libopcodes.a(disassemble.o): relocation R_X86_64_32 against `print_insn_i386' can not be used when making a shared object; recompile with -fPIC /home/xyz/projects/binutils/lib/libopcodes.a: error adding symbols: Bad value collect2: error: ld returned 1 exit status Makefile:701: recipe for target 'dist/libopdis.la' failed make: *\ [dist/libopdis.la] Error 1

Looks like it couldn't finish linking, any idea to fix this?

Thanks, Zhenkai

zhangzhenkai commented 8 years ago

Never mind. I manged to make it work by compiling binutils with -fPIC flag, and also copy the compiled libiberty.a to the lib path.