Re: libxf86config.a can't be used by shared libraries
On Saturday 05 February 2005 23:03, Goswin von Brederlow wrote:
> 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.
These are exactly identical files, hence the error from linking to either one
is the same.
miro.sebas(~): md5sum /usr/X11R6/lib/libxf86config*.a
27db885b4c292588c6c55ae951c85132 /usr/X11R6/lib/libxf86config.a
27db885b4c292588c6c55ae951c85132 /usr/X11R6/lib/libxf86config_pic.a
Thanks,
sebas
--
http://vizZzion.org
======================
Natural selection won't matter soon, not anywhere as much as concious
selection. We will civilize and alter ourselves to suit our ideas of what we
can be. Within one more human lifespan, we will have changed ourselves
unrecognizably. - Greg Bear
Reply to: