<div dir="ltr"><div>Okay, so I'm not trying to link statically, not intentionally anyway.<br><br></div><div>Here's the command line from ppas.sh that produces this error:<br><br>/usr/local/opt/binutils/bin/arm-linux-ld \<br>
--sysroot=/usr/local/opt/chroot/raspbian/rootfs \<br>--dynamic-linker=/lib/ld-linux-armhf.so.3 \<br>-s -L. -o arm-test-threads link.res<br><br></div><div>and the dynamic linker referred to is:<br><br></div><div>root@beria:/lib# file ld-linux-armhf.so.3<br>
ld-linux-armhf.so.3: symbolic link to `arm-linux-gnueabihf/<a href="http://ld-2.13.so">ld-2.13.so</a>'<br>root@beria:/lib# file arm-linux-gnueabihf/<a href="http://ld-2.13.so">ld-2.13.so</a><br>arm-linux-gnueabihf/<a href="http://ld-2.13.so">ld-2.13.so</a>: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x40caad061df15685e213cec1e4dfe1ba5f67701c, stripped<br>
<br></div><div>Any clues? -b<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 23, 2013 at 10:18 PM, Jonas Maebe <span dir="ltr"><<a href="mailto:jonas.maebe@elis.ugent.be" target="_blank">jonas.maebe@elis.ugent.be</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
On 23 May 2013, at 14:10, Bruce Tulloch wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
However, if I simply add this uses clause:<br>
<br>
uses<br>
 cthreads;<br>
<br>
the program compiles fine but fails when linking:<br>
<br>
Linking arm-test-threads<br>
/usr/local/lib/fpc/2.7.1/<br>
units/arm-linux/rtl/cthreads.<u></u>o: In function<br>
`CTHREADS_$$_LOADPTHREADS$$<u></u>BOOLEAN':<br>
cthreads.pp:(.text.n_cthreads_<u></u>$$_loadpthreads$$boolean+0xc): warning: Using<br>
'dlopen' in statically linked applications requires at runtime the shared<br>
libraries from the glibc version used for linking<br>
</blockquote>
<br></div>
Why/how are you trying to create a statically linked binary? As the message above explains, statically linking libdl relies on a bunch of library magic. At the very least you'll probably also have to link libc explicitly, but I would really recommend to link dynamically instead. Support for binaries statically linked against C libraries is generally very much untested, and known not to work on certain platforms (e.g. Linux/x86-64).<br>

<br>
<br>
Jonas<br>
______________________________<u></u>_________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.<u></u>org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/<u></u>mailman/listinfo/fpc-pascal</a><br>
</blockquote></div><br></div>