LibXML Compile Error: relocation R_X86_64_32 against `a local symbol' can not be used when making a

来源:互联网 发布:淘宝客服转化率怎么算 编辑:程序博客网 时间:2024/05/16 10:32
LibXML Compile Error: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object;recompile with -fPIC
If you get the following error during a libxml compile with a 64-bit system:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/libm.a(s_floor.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/x86_64-linux-gnu/4.3.2/../../../../lib/libm.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

It means the configure needs to be changed. Usually, for an -fPIC error like this, the best way is to recompile the source library to resolve the issue, then recompile libxml the same way. However, in this case, the cause is libml.a, which is part of the OS distribution, so it's better to avoid that, and make everything with the inverse instead.

In this case, the solution is to set libxml to not use fPIC or shared libraries.
Edit the build script. In the doLibxml2  section, find the line:

./configure --prefix=/usr/local --without-python

and change it to:(这样配置可以解决)

./configure --prefix=/usr/local --without-python --disable-shared --without-pic

阅读全文
0 0
原创粉丝点击