Orange Forum • View topic - Make problem (recompile with -fPIC)

Make problem (recompile with -fPIC)

Report bugs (or imagined bugs).
(Archived/read-only, please use our ticketing system for reporting bugs and their discussion.)
Forum rules
Archived/read-only, please use our ticketing system for reporting bugs and their discussion.

Make problem (recompile with -fPIC)

Postby jgilbert » Tue May 24, 2005 20:43

I'm using Fedora Linux on an x86_64 machine.
Code: Select all
[snip lots of good compiling]
g++ -fPIC -fpermissive -w -DLINUX -O3 -DNO_NUMERIC -c heatmap.cpp -o obj/heatmap.o
g++ -fPIC -fpermissive -w -DLINUX -O3 -DNO_NUMERIC -c orangene.cpp -o obj/orangene.o
gcc obj/heatmap.o obj/orangene.o -shared -lstdc++ -L../.. -lorange_include -lorange -o ../../orangene.so
make[1]: Leaving directory `/home/jgilbert/playing/orange/source/orangene'
make[1]: Entering directory `/home/jgilbert/playing/orange/source/corn'
g++    -c -o corn.o corn.cpp
gcc corn.o -shared -lstdc++ -L../.. -lorange_include -lorange -o ../../corn.so
/usr/bin/ld: corn.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
corn.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [../../corn.so] Error 1
make[1]: Leaving directory `/home/jgilbert/playing/orange/source/corn'
make[1]: Entering directory `/home/jgilbert/playing/orange/source/statc'
g++    -c -o statc.o statc.cpp
gcc statc.o -shared -lstdc++ -L../.. -lorange_include -lorange -o ../../statc.so
/usr/bin/ld: statc.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
statc.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [../../statc.so] Error 1
make[1]: Leaving directory `/home/jgilbert/playing/orange/source/statc'
make: *** [all] Error 2


I do not understand this error. Please help.

I can try a Debian x86 machine if it would help.

Postby jurem » Wed May 25, 2005 4:48

Hi,
bug is fixed and commited to CVS. If you are using CVS, you can update only source/statc/Makefile and
source/corn/Makefile.

On debian x86 you would not have such error, because x86 allowed to build dynamic libraries without PIC (Position Independent Code), but x86_64 architecture does not allow that.

Just for my record, which processor are you compiling on?

Regards, Jure

Postby jgilbert » Wed May 25, 2005 23:04

Wow, very nice, thank you. That fixed that problem. But I have a new one. This one occurs on both Fedora X86_64 and Debian x86.
Code: Select all
[snip good compilation]
g++ -fPIC -fpermissive -w -DLINUX -O3 -DNO_NUMERIC -c heatmap.cpp -o obj/heatmap.o
g++ -fPIC -fpermissive -w -DLINUX -O3 -DNO_NUMERIC -c orangene.cpp -o obj/orangene.o
gcc obj/heatmap.o obj/orangene.o -shared -lstdc++ -L../.. -lorange_include -lorange -o ../../orangene.so
make[1]: Leaving directory `/home/jgilbert/playing/orange/source/orangene'
make[1]: Entering directory `/home/jgilbert/playing/orange/source/corn'
g++ -fPIC -fpermissive -w -DLINUX -O3 -DNO_NUMERIC -c corn.cpp -o obj/corn.o
gcc obj/corn.o -shared -lstdc++ -L../.. -lorange_include -lorange -o ../../corn.so
make[1]: Leaving directory `/home/jgilbert/playing/orange/source/corn'
make[1]: Entering directory `/home/jgilbert/playing/orange/source/statc'
gcc obj/statc.o -shared -lstdc++ -L../.. -lorange_include -lorange -o ../../statc.so
gcc: obj/statc.o: No such file or directory
make[1]: *** [../../statc.so] Error 1
make[1]: Leaving directory `/home/jgilbert/playing/orange/source/statc'
make: *** [all] Error 2

I don't have a statc.so anywhere on my system.

KDE Info Center says that my x86_64 box has a 3.0 GHz Xeon processor. I compile separately on each, I'm not cross-compiling.

Postby jurem » Thu May 26, 2005 9:42

Urgh... my bad, took me quite a while before I've noticed one tab char in Makefile that broke creation of obj/statc.o, so statc.so could not be created.

It's fixed now.

Regards, Jure


Return to Bugs



cron