[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libxf86config.a can't be used by shared libraries



Sebastian Kügler <lists@vizZzion.org> writes:

> On Wednesday 02 February 2005 21:22, Simon Edwards wrote:
>> It appears that libxf86config.a can't be used by shared libraries. It
>> doesn't appear to have been compiled correctly using the -fPIC compile
>> option.
>>
>> I'm currently developing a util in Python that uses has a C extension which
>> uses libxf86config.a. In terms of libraries and linking, we are building a
>> small *.so shared library that links with libxf86config.a. Linking is
>> failing:
>>
>> -------------------------------------
>> building 'ixf86config' extension
>> gcc -pthread -shared build/temp.linux-x86_64-2.3/modules/xf86config_ext.o
>> -L/usr/X11R6/lib -lX11 -lXxf86vm -lXext -lglib -lxf86config -o
>> build/lib.linux-x86_64-2.3/ixf86config.so
>> /usr/bin/ld: /usr/X11R6/lib/libxf86config.a(scan.o): relocation R_X86_64_32
>> can not be used when making a shared object; recompile with -fPIC
>> /usr/X11R6/lib/libxf86config.a: could not read symbols: Bad value
>> collect2: ld returned 1 exit status
>> error: command 'gcc' failed with exit status 1
>> -------------------------------------
>>
>> We've also tried linking against libxf86config_pic.a. The result was the
>> same. In fact libxf86config_pic.a and libxf86config.a were identical files.

The correct file is libxf86config_pic.a. The _pic says that this is
compiled with -fPIC and for inclusion into shared libraries. If you
get the same error there then a -fPIC is missing when it was
compiled. For libxf86config.a the error is normal.

MfG
        Goswin



Reply to: