[fpc-pascal] CThreads problem when cross-compiling to ARM/RPi.
Bruce Tulloch
pascal at causal.com
Thu May 23 15:03:06 CEST 2013
Okay, but it is installed:
root at beria:~# apt-file search libdl.so
libc6: /lib/arm-linux-gnueabihf/libdl.so.2
libc6-dev: /usr/lib/arm-linux-gnueabihf/libdl.so
root at beria:~# apt-show-versions libc6-dev
libc6-dev/wheezy uptodate 2.13-38+rpi2
but I noticed that:
root at beria:/usr/lib/arm-linux-gnueabihf# ls -l libdl*
-rw-r--r-- 1 root root 9042 Feb 23 00:38 libdl.a
lrwxrwxrwx 1 root root 35 Feb 23 00:38 libdl.so ->
/lib/arm-linux-gnueabihf/libdl.so.2
which means they're the same file.
Checking my host x86_64 system we have:
bruce at fermi:/usr/lib/x86_64-linux-gnu$ ls -l libdl*
-rw-r--r-- 1 root root 13074 Dec 31 02:36 libdl.a
lrwxrwxrwx 1 root root 32 Dec 31 02:36 libdl.so ->
/lib/x86_64-linux-gnu/libdl.so.2
bruce at fermi:/usr/lib/x86_64-linux-gnu$
but building native on the host does not produce this problem.
Still confused :-) -b
On Thu, May 23, 2013 at 10:50 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>wrote:
>
> On 23 May 2013, at 14:32, Bruce Tulloch wrote:
>
> On Thu, May 23, 2013 at 10:28 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>
>> **wrote:
>>
>>
>>> On 23 May 2013, at 14:25, Bruce Tulloch wrote:
>>>
>>> Do you have a libdl.so in your library search path? And what kind of
>>> reference to libdl does link.res contain?
>>>
>>> Yes, it's in the search path as:
>>
>> root at beria:/lib/arm-linux-**gnueabihf# ls -l libdl*
>> -rw-r--r-- 1 root root 9812 Feb 23 00:37 libdl-2.13.so
>> lrwxrwxrwx 1 root root 13 Feb 23 00:37 libdl.so.2 -> libdl-2.13.so
>>
>
> You don't have libdl.so, only libdl.so.2. The latter is for use at run
> time, the former for use at link/compile time. Install the libc-dev or
> similar package in your crossroot to get it along with other missing
> symlinks. Do not start creating those manually, it will only lead to errors
> and confusion down the line.
>
>
> It's referred to in an INPUT statement in link.res as:
>>
>> INPUT(
>> -lpthread
>> -ldl
>> )
>>
>> and there are two search statements:
>>
>> SEARCH_DIR("/usr/local/opt/**chroot/raspbian/rootfs/usr/**
>> lib/arm-linux-gnueabihf/")
>> SEARCH_DIR("/usr/local/opt/**chroot/raspbian/rootfs/lib/**
>> arm-linux-gnueabihf/")
>>
>> at the top of the file which suggest it should be found okay.
>>
>
> The linker will only look for libdl.so and resolve it to its target in
> case it's a symlink, so that the symlink is no longer required at run time.
> It will not look for libdl.so.<something>, that one is used by the programs
> at run time (since the symlinks at compile/link time pointed to it and the
> linker will write the name of this symlink target into the binary's list of
> linked libraries).
>
>
> Just noticed another INPUT statement also refers to dl as:
>>
>> /usr/local/lib/fpc/2.7.1/**units/arm-linux/rtl/dl.o
>>
>> This appears ahead of the -ldl statement.
>>
>
> That is the object file of the Pascal "dl" unit. It is unrelated to your
> library issue.
>
>
>
> Jonas
> ______________________________**_________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.**org<fpc-pascal at lists.freepascal.org>
> http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20130523/b1f59927/attachment.html>
More information about the fpc-pascal
mailing list