[fpc-pascal] Linking Problems while cross compiling for arm

Marco van de Voort marcov at stack.nl
Mon Dec 7 11:13:52 CET 2009

In our previous episode, Hartmut Eilers said:
> I try to crosscompile one of my projects to the arm based
> USB9263 from Calao Systems
> (http://www.calao-systems.com/articles.php?lng=en&pg=5932)
> I get the following linking error:
> /usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/cprt0.o: In function `_start':
> (.text+0x4c): undefined reference to `__libc_start_main'
> /usr/local/lib/fpc/2.4.0/units/arm-linux/rtl/cprt0.o: In function

cprt0 is afaik for libc1 systems	

> I have built my own crosscompiler with fpc 2.2.2. Here are the steps I did:

(very old, use something newer)
> + download the toolchain from
> http://free-electrons.com/labs/tools/arm-unknown-linux-uclibc-gcc-4.3.2.tar.bz2

Here you are talking uclibc, that doesn't match with the cprt0

The way the Linux compiler choose libc type iirc depends on existance of
certain paths and files, which sometimes works badly in crosscompile and
bi-arch situations, afaik there is no certain override mechanism.

Best is to examine the sourcecode of t_linux to see what the exact criteria

More information about the fpc-pascal mailing list