Ted Pedersen
2009-Oct-19 18:02 UTC
[Xapian-discuss] relocation against 'a local symbol' on make
Greetings all, I'm trying to install Xapian on the following sort of system: Linux marimba 2.6.24-23-server #1 SMP Wed Apr 1 22:14:30 UTC 2009 x86_64 GNU/Linux Before installing (or trying to) xapian-core I downloaded and installed zlib from http://zlib.net, using the usual ./configure, make, make test, make install sequence, which all worked fine. Then, I ran ./configure for xapian-core and then ran make, which ended with the following: /usr/bin/ld: /usr/local/lib/libz.a(deflate.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[2]: *** [libxapian.la] Error 1 make[2]: Leaving directory `/home/ted/xapian-core-1.0.16' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ted/xapian-core-1.0.16' make: *** [all] Error 2 I tried to set the compiler option for xapian to -fPIC as follows... ./configure CFLAGS=-fPIC ...and while that seems to work just fine, I get the same error when I run make. Any ideas on this? Thanks, Ted -- Ted Pedersen http://www.d.umn.edu/~tpederse
Peter Karman
2009-Oct-19 18:10 UTC
[Xapian-discuss] relocation against 'a local symbol' on make
Ted Pedersen wrote on 10/19/2009 01:02 PM:> Greetings all, >Hi Ted,> /usr/bin/ld: /usr/local/lib/libz.a(deflate.o): relocation R_X86_64_32S > against `a local symbol' can not be used when making a shared object; > recompile with -fPIC > /usr/local/lib/libz.a: could not read symbols: Bad value > collect2: ld returned 1 exit status > make[2]: *** [libxapian.la] Error 1 > make[2]: Leaving directory `/home/ted/xapian-core-1.0.16' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/ted/xapian-core-1.0.16' > make: *** [all] Error 2 > > I tried to set the compiler option for xapian to -fPIC as follows... > > ./configure CFLAGS=-fPICI read that error message as indicating you need to compile *zlib* with the fPIC option. -- Peter Karman . http://peknet.com/ . peter at peknet.com
James Aylett
2009-Oct-19 19:10 UTC
[Xapian-discuss] relocation against 'a local symbol' on make
On Mon, Oct 19, 2009 at 01:02:53PM -0500, Ted Pedersen wrote:> I'm trying to install Xapian on the following sort of system: > > Linux marimba 2.6.24-23-server #1 SMP Wed Apr 1 22:14:30 UTC 2009 > x86_64 GNU/LinuxWhat distribution?> Before installing (or trying to) xapian-core I downloaded and > installed zlib from http://zlib.net, using the usual ./configure, > make, make test, make install sequence, which all worked fine.As suggested, you may have built zlib as a static library, when (by default) you'll actually need it dynamically linkable. However I'm wondering why you're building zlib yourself. Most linux distros provide it out of the box for you, or easily installable. J -- James Aylett talktorex.co.uk - xapian.org - uncertaintydivision.org
Ted Pedersen
2009-Oct-19 19:14 UTC
[Xapian-discuss] relocation against 'a local symbol' on make
Greetings all, again... I think I may have worked this out. /usr/local/lib/zlib.a was the result of me installing zlib from source (from zlib.net) in resposne to a message from the Xapian install the first time I ran it (saying zlib was missing). However, what I probably should have done was this (I'm running on Ubuntu): sudo apt-get install zlib1g-dev After I did this, I actually just deleted my manually installed zlib from /usr/local/lib, and then did the ./configure, make, make install sequence just fine on Xapian. So, I think all is well! Thanks to Peter K for some advice that helped point me in this direction. Cordially, Ted On Mon, Oct 19, 2009 at 1:02 PM, Ted Pedersen <duluthted at gmail.com> wrote:> Greetings all, > > I'm trying to install Xapian on the following sort of system: > > Linux marimba 2.6.24-23-server #1 SMP Wed Apr 1 22:14:30 UTC 2009 > x86_64 GNU/Linux > > Before installing (or trying to) xapian-core I downloaded and > installed zlib from http://zlib.net, using the usual ./configure, > make, make test, make install sequence, which all worked fine. > > Then, I ran ./configure for xapian-core and then ran make, which ended > with the following: > > /usr/bin/ld: /usr/local/lib/libz.a(deflate.o): relocation R_X86_64_32S > against `a local symbol' can not be used when making a shared object; > recompile with -fPIC > /usr/local/lib/libz.a: could not read symbols: Bad value > collect2: ld returned 1 exit status > make[2]: *** [libxapian.la] Error 1 > make[2]: Leaving directory `/home/ted/xapian-core-1.0.16' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/ted/xapian-core-1.0.16' > make: *** [all] Error 2 > > I tried to set the compiler option for xapian to -fPIC as follows... > > ./configure CFLAGS=-fPIC > > ...and while that seems to work just fine, I get the same error when I > run make. > > Any ideas on this? > > Thanks, > Ted > > -- > Ted Pedersen > http://www.d.umn.edu/~tpederse >-- Ted Pedersen http://www.d.umn.edu/~tpederse