Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-11

linker error when cross compile for arm

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Fung

Dear all,

I followed the wiki at:
http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM

After that, I can compile a hello world program for arm without problem, great!

But when I try to compile a program with the synapse units it gives the following error:

/usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x88): undefined reference to `_fini'
/usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi':
(.text+0x90): undefined reference to `_init'
tcpclient1.lpr(42,21) Error: Error while linking
tcpclient1.lpr(42,21) Fatal: There were 1 errors compiling module, stopping

Any ideas please?

Rgds,
Michael

Michael Fung
to Michael Fung

After much googling, still can't find any clue.

Synapse claims it supports cross platform.

I check the difference between hello world and tcpclient1 program.

hello world:
00008000:Searching file /usr/lib/fpc/2.5.1/units/arm-linux/rtl/prt0.o... found

tcpclient1:
00008000:Searching file
/usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o... found

Does that mean tcpclient1 relies on Libc? And this dependency is not good for cross compile?

Rgds,
Michael

Michael Fung wrote 27 lines
Dear all, I followed the wiki at: http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM After that, I can compile a hello world program for arm without problem, great! But when I try to compile a program with the synapse units it gives the following error: /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' tcpclient1.lpr(42,21) Error: Error while linking tcpclient1.lpr(42,21) Fatal: There were 1 errors compiling module, stopping Any ideas please? Rgds, Michael
Jonas Maebe
to Michael Fung: I followed the wiki at: http://wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM…
Michael Fung wrote 11 lines
But when I try to compile a program with the synapse units it gives the following error: /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x88): undefined reference to `_fini' /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function `_haltproc_eabi': (.text+0x90): undefined reference to `_init' tcpclient1.lpr(42,21) Error: Error while linking tcpclient1.lpr(42,21) Fatal: There were 1 errors compiling module, stopping

That symbol should be defined in your ARM /usr/lib/crti.o, which is automatically linked by the compiler when cprt0.o is required.

Jonas

Michael Fung
to Jonas Maebe

Many Thanks Jonas! Now I know my SDK may be broken.

Rgds,
Michael

Jonas Maebe wrote 19 lines
On 06 Nov 2010, at 04:18, Michael Fung wrote: > But when I try to compile a program with the synapse units it gives the > following error: > > /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function > `_haltproc_eabi': > (.text+0x88): undefined reference to `_fini' > /usr/lib/fpc/2.5.1/units/arm-linux/rtl/cprt0.o: In function > `_haltproc_eabi': > (.text+0x90): undefined reference to `_init' > tcpclient1.lpr(42,21) Error: Error while linking > tcpclient1.lpr(42,21) Fatal: There were 1 errors compiling module, stopping That symbol should be defined in your ARM /usr/lib/crti.o, which is automatically linked by the compiler when cprt0.o is required. Jonas