MVoz / libmpsse

Automatically exported from code.google.com/p/libmpsse
0 stars 0 forks source link

relocation R_X86_64_32 against `mpsse' can not be used when making a shared object #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. configure
2. make

What is the expected output? What do you see instead?
[molli123@c64 src]$ make
gcc -Wall -g -O2 -lftdi  -c support.c
gcc -Wall -g -O2 -lftdi  -c mpsse.c
gcc -shared -Wl,-soname,libmpsse.so mpsse.o support.o -o libmpsse.so -lftdi 
/usr/bin/ld: mpsse.o: relocation R_X86_64_32 against `mpsse' can not be used 
when making a shared object; recompile with -fPIC
mpsse.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [mpsse] Error 1

What version of the product are you using? On what operating system?
Version 0.2 on Fedora16

Please provide any additional information below.
simply adding -fPIC to CFLAGS in Makefile is not sufficient since not all CC 
lines in Makefiles are using it ($(CC) -c  $(TARGET)_wrap.c  $(INC))

Original issue reported on code.google.com by molli12...@gmail.com on 20 Nov 2011 at 10:37

GoogleCodeExporter commented 9 years ago
forgot ky patch ;-)

[molli123@c64 src]$ diff Makefile.bak Makefile
6c6
< CFLAGS=-Wall -g -O2
---
> CFLAGS=-Wall -g -O2 -fPIC
39c39
<   $(CC) -c  $(TARGET)_wrap.c  $(INC)
---
>   $(CC) $(CFLAGS) -c  $(TARGET)_wrap.c  $(INC)

Original comment by molli12...@gmail.com on 20 Nov 2011 at 10:40

GoogleCodeExporter commented 9 years ago
Unfortunately, the -fPIC flag breaks the 32-bit build, so it can't be 
hard-coded in. 

I've updated the Makefile so that all CC lines now use CFLAGS, so for the time 
being you should be able to fix this issue by running:

./configure CFLAGS="-fPIC"
make

Will add auto-detection of 64-bit architectures into the configure script so 
that CFLAGS is automatically set appropriately.

Original comment by heffne...@gmail.com on 21 Nov 2011 at 2:04

GoogleCodeExporter commented 9 years ago
The configure script now identifies 64 bit architectures and adds -fPIC to 
CFLAGS automatically.

Original comment by heffne...@gmail.com on 21 Nov 2011 at 2:22