On Mar 28, 2008, at 12:45 PM, Andrew Haley wrote:
Lorenzo Pesce wrote:
Thanks a lot for your kinds replied Andrew,
However, when I get to X86 (whether Intel or AMD) it does not work
anymore. I can compile the files, and build the static library
libroc.a.
It works fine and I can move it from AMD to intel (not the other
way
around, but I assume it is a problem with my installation).
However,
when I try to build a dynamically linked library, gcc complains
that
"Relocation R_X86_64_32 against 'a local symbol' can not be used
when making a share object; recompile with -fPIC"
then it tells me it can't read symbols .o because it is a bad
value.
You need to compile everything that goes into a dynamically linked
library with -fPIC.
I have to admit my ignorance on compilers building, but once i
download unpack and so on the gcc compiler package, I can't
figure out in which of the hundreds of lines of the various
makefiles
or configuration files I should put the -fPIC flag.
Don't mess with gcc's makefiles.
gcc already builds all of its files correctly.
When you use gcc to build *your* libraries, *you* must compile
everything
with -fPIC.
I already do that. The problem is with libgfortran.* not with my
libraries!
Java seems to need the object files from libgfortran for the JNI
libraries to work properly so I need
libgfortran to be compiled with -fPIC to link them into the jni
library. My libraries have always been built with -fPIC,
it is libgfortran that is breaking on the x86_64, not my libraries.
Does it make sense?
Lorenzo