|
From: Paul F. <pa...@fr...> - 2007-12-12 10:23:15
|
Hi I just downloaded valgrind 3.3.0. No problems building on 32bit Linux. But on a 64bit Linux machine, I get ld: /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a(laminit.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a: could not read symbols: Bad value collect2: ld returned 1 exit status make: *** [libmpiwrap-AMD64_LINUX.so] Error 1 The machine is running Red Hat Enterprise Linux WS release 3 (Taroon Update 4) with a home-rolled GCC 3.2.3 + GNU binutils 2.17. It looks to me like the problem is with libmpi.a Can anyone confirm? A+ Paul |
|
From: Tom H. <to...@co...> - 2007-12-12 10:29:25
|
In message <119...@im...>
Paul Floyd <pa...@fr...> wrote:
> I just downloaded valgrind 3.3.0. No problems building on 32bit Linux. But on a
> 64bit Linux machine, I get
>
> ld:
> /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a(laminit.o):
> relocation R_X86_64_32 against `a local symbol' can not be used when making a
> shared object; recompile with -fPIC
> /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a: could not
> read symbols: Bad value
> collect2: ld returned 1 exit status
> make: *** [libmpiwrap-AMD64_LINUX.so] Error 1
You can't link a static library (a .a) into a shared object on x86_64 (you
can do it on x86 but it is inefficient).
You need a shared version of libmpi I think.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Julian S. <js...@ac...> - 2007-12-12 11:09:58
|
> > ld: > > /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a(lam > >init.o): relocation R_X86_64_32 against `a local symbol' can not be used > > when making a shared object; recompile with -fPIC > > /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a: > > could not read symbols: Bad value > > collect2: ld returned 1 exit status > > make: *** [libmpiwrap-AMD64_LINUX.so] Error 1 > > You can't link a static library (a .a) into a shared object on x86_64 (you > can do it on x86 but it is inefficient). Or just disable building of the MPI wrapper library, which is optional. The configure script has picked up whatever mpicc was lying around. You can stop it doing that by configuring with --with-mpicc=bogus-name-i-dont-exist. J |
|
From: Paul F. <pa...@fr...> - 2007-12-12 11:23:47
|
Quoting Julian Seward <js...@ac...>: Hi > Or just disable building of the MPI wrapper library, which is optional. > The configure script has picked up whatever mpicc was lying around. > You can stop it doing that by configuring > with --with-mpicc=bogus-name-i-dont-exist. This is what I did (using --without-mpicc). A+ Paul |
|
From: <da...@ly...> - 2007-12-12 11:55:06
|
Tom Hughes <to...@co...> writes: > In message <119...@im...> > Paul Floyd <pa...@fr...> wrote: > >> I just downloaded valgrind 3.3.0. No problems building on 32bit Linux. But on a >> 64bit Linux machine, I get >> >> ld: >> /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a(laminit.o): >> relocation R_X86_64_32 against `a local symbol' can not be used when making a >> shared object; recompile with -fPIC >> /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a: could not >> read symbols: Bad value >> collect2: ld returned 1 exit status >> make: *** [libmpiwrap-AMD64_LINUX.so] Error 1 > > You can't link a static library (a .a) into a shared object on x86_64 (you > can do it on x86 but it is inefficient). Sure you can, you just have the same restrictions as if you had linked it with the .o files directly. You need to compile the object files in the .a archive with -fPIC, just as the error message says. So you can compile your own libmpi.a with -fPIC and link against that instead. Or you can use a shared libmpi.so library. -- David Kågedal |
|
From: Tom H. <to...@co...> - 2007-12-12 17:40:04
|
In message <87w...@ly...>
David K=C3=A5gedal <da...@ly...> wrote:
> Tom Hughes <to...@co...> writes:
>
>> In message <119...@im...>
>> Paul Floyd <pa...@fr...> wrote:
>>
>>> I just downloaded valgrind 3.3.0. No problems building on 32bit Linux. =
But on a
>>> 64bit Linux machine, I get
>>>
>>> ld:
>>> /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a(l=
aminit.o):
>>> relocation R_X86_64_32 against `a local symbol' can not be used when ma=
king a
>>> shared object; recompile with -fPIC
>>> /usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/../../../../lib64/libmpi.a: =
could not
>>> read symbols: Bad value
>>> collect2: ld returned 1 exit status
>>> make: *** [libmpiwrap-AMD64_LINUX.so] Error 1
>>
>> You can't link a static library (a .a) into a shared object on x86_64 (y=
ou
>> can do it on x86 but it is inefficient).
>
> Sure you can, you just have the same restrictions as if you had linked
> it with the .o files directly. You need to compile the object files
> in the .a archive with -fPIC, just as the error message says.
You are of course quite right. It would not be normal to compile code
for a static library as PIC code though ;-)
Tom
--=20
Tom Hughes (to...@co...)
http://www.compton.nu/
|