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

Bug#687642: gnat-4.6: libgnarl-4.6.a should be rebuilt with -fPIC, libaws FBTFS



Konstantinos Margaritis wrote:
libgnarl-4.6.a is the *static* library, it should definitely not be
compiled with -fPIC.

The *shared* library, libgnarl-4.6.so, is already built with -fPIC.

If you have time before I do, please investigate why gnatmake,
invoked thus:

gnatmake -j1 -fPIC -p -Pdebian/build_aws.gpr -Xkind=dynamic \
 -Xsoname=libaws.so.2.10.2

tries to link the new shared library against the static version of
libgnarl-4.6.  If we're lucky, the problem is in build_aws.gpr; if
we're unlucky, it is in gnatmake itself and only strikes on armhf
because all other architectures are OK.  I have a hunch that the
latter is closer to the truth :/


This is what I get:

# gnatmake -j1 -fPIC -p -Pdebian/build_aws.gpr -Xkind=dynamic
-Xsoname=libaws.so.2.10.2

building dynamic library for project build_aws
gcc-4.6 -shared -o
/root/libaws-2.10.2/debian/tmp/dynamic//libaws.so.2.10.2 ...
/root/libaws-2.10.2/debian/tmp/obj-dynamic/aws-services-directory.o
...
/usr//bin/ld:

/usr/lib/gcc/arm-linux-gnueabihf/4.6/adalib//libgnarl-4.6.a(s-taprop.o):
relocation R_ARM_THM_MOVW_ABS_NC against `a local symbol' can not be
used when making a shared object; recompile with -fPIC
/usr/lib/gcc/arm-linux-gnueabihf/4.6/adalib//4.6.a: could
not read symbols: Bad value
collect2: ld returned 1 exit status
gnatmake: gcc-4.6 execution error

This confirms what I said: gnatmake (or gnatlink) is trying to link
the *shared* libaws.so.2.10.2 against the *static* libgnarl-4.6.a,
which is *wrong*.  I don't know in which program this bug is in:
either build_aws.gpr or gnatmake or gnatlink.

It still looks like a problem in libgnarl-4.6.a to me. armhf is
built with Thumb2 which according to some more knowledgeable people
than myself, has only 25 bits for largest relocation vs 27 bits in
arm mode.  Usually, this is not a problem but some packages do fail
to build because of this. What works without -fPIC on most
architectures, can potentially need -fPIC on armhf (and I've filed
quite a few bugs about this myself.

No. As I said previously, it is necessary to link the *shared*
libaws.so.2.10.2 against the *shared* libgnarl-4.6.so.1.

--
Ludovic Brenta.


Reply to: