Sign in Join

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

Mailing lists / lazarus / 2009-12

Do FPC generates old EABI code?

17 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Kjow

Hi all again,

I think that I'm almost at the end of my path to make Lazarus able to build for arm-linux "graphical projects".

It compiles and it seems to link right, I found all target libs I need (I grabbed most of these from sdk), but almost at the end I have this error:

...
/home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/fpc/libcross/libX11.so has EABI version 5, but target /home/kjow/dev/TestARM/LazARM/LAzARM has EABI version 0

Here complete log from "Messages" of Lazarus IDE:

Hint: Start of reading config file /home/kjow/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Hint: End of reading config file /home/kjow/.fpc.cfg Free Pascal Compiler version 2.5.1 [2009/12/12] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling LAzARM.lpr
Assembling lazarm
Linking /home/kjow/dev/TestARM/LazARM/LAzARM
/home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/fpc/libcross/libX11.so has EABI version 5, but target /home/kjow/dev/TestARM/LazARM/LAzARM has EABI version 0 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/fpc/libcross/libX11.so /home/kjow/lazarus/fpc/libcross/libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_new_from_stream'
/home/kjow/lazarus/fpc/libcross/libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_simple_anim_iter_get_type'
/home/kjow/lazarus/fpc/libcross/libexpat.so.1: undefined reference to '
/home/kjow/lazarus/fpc/libcross/libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_new_from_stream_at_scale'
/home/kjow/lazarus/fpc/libcross/libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_simple_anim_get_type'
/home/kjow/lazarus/fpc/libcross/libglib-2.0.so: undefined reference to '
LAzARM.lpr(22) Error: Error while linking
LAzARM.lpr(22) Fatal: There were 1 errors compiling module, stopping

There is a way to solve this problem?

I tried to "play" with fpc parameters (instead of -CaEABI ), but no luck; everytime it returns this error.

Thank you!

Reply by email

Dariusz Mazur
to Kjow

Kjow pisze:

Show quoted text 14 lines
Hi all again, I think that I'm almost at the end of my path to make Lazarus able to build for arm-linux "graphical projects". It compiles and it seems to link right, I found all target libs I need (I grabbed most of these from sdk), but almost at the end I have this error: ... /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/fpc/libcross/libX11.so has EABI version 5, but target /home/kjow/dev/TestARM/LazARM/LAzARM has EABI version 0

did you compile FPC and libcross with the same binutils? how you made crossppcarm ?
to read EABI version you may use
readelf -a ./linX11.so

Darek

Reply by email

Kjow
to Dariusz Mazur

2009/12/14 Dariusz Mazur :

did you compile FPC and libcross with the same binutils? how you made crossppcarm ? to read EABI version you may use readelf -a ./linX11.so.

I started from latest sources and compiled binutils, fpc and lazarus myselft in a fresh ubuntu installation, but target libraries aren't my work. I grabbed its by other system (I can't find other ways to use them).

Maybe I understood a thing, I need to recompile everything (lazarus/fpc) with assembler options: -meabi=5

I'm going to try!

Reply by email

Kjow
to Kjow

2009/12/14 Kjow :

I'm going to try!

I don't understand... Now I forced to use as -meabi=5 , but there are still errors. I compiled Lazarus lcl, from the IDE. FPC uses the same binutils that Lazarus.

Hint: Start of reading config file /home/kjow/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Hint: End of reading config file /home/kjow/.fpc.cfg Free Pascal Compiler version 2.5.1 [2009/12/14] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling project1.lpr
Compiling unit1.pas
unit1.pas(18,28) Hint: Parameter "Sender" not used Assembling unit1
Assembling project1
Linking /home/kjow/dev/LazARM/project1
/home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/gtk2/interfaces.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/gtk2/interfaces.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/forms.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/forms.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/lresources.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/lresources.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/interfacebase.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/interfacebase.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/lclstrconsts.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/lclstrconsts.o ...
...
...
/home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/lclclasses.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/lclclasses.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/wslclclasses.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/wslclclasses.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/wsimglist.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/wsimglist.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/wsproc.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/wsproc.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/wsfactory.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/wsfactory.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/controls.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/controls.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/menus.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/menus.o ...
...
...
/home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/grids.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/grids.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/wsgrids.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/wsgrids.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/dynamicarray.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/dynamicarray.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/maskedit.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/maskedit.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/wspairsplitter.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/wspairsplitter.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/wsspin.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/wsspin.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/shellctrls.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/shellctrls.o ...
...
...
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2wsspin.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2cellrenderer.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2cellrenderer.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2listviewtreemodel.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2listviewtreemodel.o /home/kjow/lazarus/fpc/libcross//libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_new_from_stream'
/home/kjow/lazarus/fpc/libcross//libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_simple_anim_iter_get_type' /home/kjow/lazarus/fpc/libcross/libexpat.so.1: undefined reference to '
/home/kjow/lazarus/fpc/libcross//libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_new_from_stream_at_scale' /home/kjow/lazarus/fpc/libcross//libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_simple_anim_get_type'
/home/kjow/lazarus/fpc/libcross//libglib-2.0.so: undefined reference to '
project1.lpr(22) Error: Error while linking
/home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/gtk2/interfaces.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/gtk2/interfaces.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/forms.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/forms.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/lresources.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5 /home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/lresources.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/interfacebase.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/interfacebase.o ...
...
...
...
...
...
/home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2cellrenderer.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2cellrenderer.o /home/kjow/lazarus/fpc/binutils/ld: error: Source object /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2listviewtreemodel.o has EABI version 0, but target /home/kjow/dev/LazARM/project1 has EABI version 5
/home/kjow/lazarus/fpc/binutils/ld: failed to merge target specific data of file /home/kjow/lazarus/lcl/units/arm-linux/gtk2/gtk2listviewtreemodel.o /home/kjow/lazarus/fpc/libcross//libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_new_from_stream'
/home/kjow/lazarus/fpc/libcross//libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_simple_anim_iter_get_type' /home/kjow/lazarus/fpc/libcross/libexpat.so.1: undefined reference to '
/home/kjow/lazarus/fpc/libcross//libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_new_from_stream_at_scale' /home/kjow/lazarus/fpc/libcross//libgtk-x11-2.0.so: undefined reference to `gdk_pixbuf_simple_anim_get_type'
/home/kjow/lazarus/fpc/libcross//libglib-2.0.so: undefined reference to '
project1.lpr(22) Error: Error while linking
project1.lpr(22) Fatal: There were 1 errors compiling module, stopping

Thanks!

Reply by email

Kjow
to Kjow

2009/12/14 Kjow :

I don't understand... Now I forced to use as -meabi=5 , but there are still errors. I compiled Lazarus lcl, from the IDE. FPC uses the same binutils that Lazarus.

Ok... it seems that lazarus doesn't use my own binutils path. So I "tricked" original arm-linux-as to force -meabi=5 and it seems to work.

But it is not the end... there will be an end?

Hint: Start of reading config file /home/kjow/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Hint: End of reading config file /home/kjow/.fpc.cfg Free Pascal Compiler version 2.5.1 [2009/12/14] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling project1.lpr
Assembling project1
Linking /home/kjow/dev/LazARM/project1
/home/kjow/lazarus/fpc/libcross/libexpat.so.1: undefined reference to '
/home/kjow/lazarus/fpc/libcross//libglib-2.0.so: undefined reference to '
project1.lpr(22) Error: Error while linking
/home/kjow/lazarus/fpc/libcross/libexpat.so.1: undefined reference to '
/home/kjow/lazarus/fpc/libcross//libglib-2.0.so: undefined reference to '
project1.lpr(22) Error: Error while linking
project1.lpr(22) Fatal: There were 1 errors compiling module, stopping

Why... WHy... WHY?! I'm mortified... I don't know how to solve, where to find... almost to the end, is this a game over?

Reply by email

Kjow
to Unknown author: Should be Target OS: Linux for ARMEL You have to recompile crosscompiller Its not EABI…

2009/12/15 :

Show quoted text 7 lines
Should be ? Target OS: Linux for ARMEL You have to recompile crosscompiller Its not EABI (see my descuss with Jonas on fpc-devel) make crosssinstal OPT="-dFPC_ARMEL" .......

This is the command that I used to make crosscompiler:

sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ CROSSOPT="-CaEABI -dFPC_ARMEL -CfSOFT -gl -O-" INSTALL_PREFIX=/usr/
COMPILER_OPTIONS="cpufpemu"

However, when I compile from terminal "Hello world" programs (a simple writeln) it works well and it runs on my phisical arm device:

~/dev/TestARM$ fpc -Tlinux -Parm TestARM.pas
Free Pascal Compiler version 2.5.1 [2009/12/14] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARM
Compiling TestARM.pas
Assembling hello
Linking TestARM
4 lines compiled, 0.1 sec

The problems are in Lazarus IDE with the linking of target libs.

Kjow

Reply by email

Unknown author
to Kjow: 2009/12/14 Kjow : Ok... it seems that lazarus doesn't use my own binutils path. So I…
Show quoted text 18 lines
2009/12/14 Kjow : > I don't understand... Now I forced to use as -meabi=5 , but there are > still errors. I compiled Lazarus lcl, from the IDE. FPC uses the same > binutils that Lazarus. Ok... it seems that lazarus doesn't use my own binutils path. So I "tricked" original arm-linux-as to force -meabi=5 and it seems to work. But it is not the end... there will be an end? Hint: Start of reading config file /home/kjow/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg Hint: End of reading config file /etc/fpc.cfg Hint: End of reading config file /home/kjow/.fpc.cfg Free Pascal Compiler version 2.5.1 [2009/12/14] for arm Copyright (c) 1993-2009 by Florian Klaempfl Target OS: Linux for ARM

Should be
Target OS: Linux for ARMEL

You have to recompile crosscompiller
Its not EABI (see my descuss with Jonas on fpc-devel)

make crosssinstal OPT="-dFPC_ARMEL" .......

Darek

Reply by email

Dariusz Mazur
to Kjow: 2009/12/15 : This is the command that I used to make crosscompiler: sudo make…

Kjow pisze:

Show quoted text 20 lines
2009/12/15 : > Should be > Target OS: Linux for ARMEL > > You have to recompile crosscompiller > Its not EABI (see my descuss with Jonas on fpc-devel) > > make crosssinstal OPT="-dFPC_ARMEL" ....... > This is the command that I used to make crosscompiler: sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ CROSSOPT="-CaEABI -dFPC_ARMEL -CfSOFT -gl -O-" INSTALL_PREFIX=/usr/ COMPILER_OPTIONS="cpufpemu"

sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ OPT="-dFPC_ARMEL" CROSSOPT="-CaEABI -dFPC_ARMEL -CfSOFT -gl -O2" INSTALL_PREFIX=/usr/

add OPT, remove COMPILER_OPTIONS

Show quoted text 24 lines
However, when I compile from terminal "Hello world" programs (a simple writeln) it works well and it runs on my phisical arm device: ~/dev/TestARM$ fpc -Tlinux -Parm TestARM.pas Free Pascal Compiler version 2.5.1 [2009/12/14] for arm Copyright (c) 1993-2009 by Florian Klaempfl Target OS: Linux for ARM Compiling TestARM.pas Assembling hello Linking TestARM 4 lines compiled, 0.1 sec The problems are in Lazarus IDE with the linking of target libs. Kjow -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Darek

Reply by email

Florian Klaempfl
to Dariusz Mazur
Show quoted text 29 lines
Kjow pisze: > 2009/12/15 : > >> Should be >> Target OS: Linux for ARMEL >> >> You have to recompile crosscompiller >> Its not EABI (see my descuss with Jonas on fpc-devel) >> >> make crosssinstal OPT="-dFPC_ARMEL" ....... >> > > This is the command that I used to make crosscompiler: > > sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux > CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ CROSSOPT="-CaEABI > > -dFPC_ARMEL -CfSOFT -gl -O-" INSTALL_PREFIX=/usr/ > COMPILER_OPTIONS="cpufpemu" > sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ OPT="-dFPC_ARMEL" CROSSOPT="-CaEABI -dFPC_ARMEL -CfSOFT -gl -O2" INSTALL_PREFIX=/usr/ add OPT, remove COMPILER_OPTIONS

Please, don't spread the nonsense of -CfSOFT -CaEABI, it's neither needed nor desired. -dFPC_ARMEL is enough. Neither is -dFPC_ARMEL needed in CROSSOPT. It is only needed when the first arm compiler is built and in this case OPT=-dFPC_ARMEL is enough.

Reply by email

Kjow
to Florian Klaempfl

2009/12/15 Florian Klaempfl :

Please, don't spread the nonsense of -CfSOFT -CaEABI, it's neither needed nor desired. -dFPC_ARMEL is enough. Neither is -dFPC_ARMEL needed ?in CROSSOPT. It is only needed when the first arm compiler is built and in this case OPT=-dFPC_ARMEL is enough.

Hi!

So first time that I build FPC for arm, I need to do this:

sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ OPT=-dFPC_ARMEL INSTALL_PREFIX=/usr

instead of

sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ CROSSOPT="-CaEABI -dFPC_ARMEL -CfSOFT -gl -O-" INSTALL_PREFIX=/usr/
COMPILER_OPTIONS="cpufpemu"

is it right?

Thanks!

Reply by email

Kjow
to Kjow

2009/12/15 Kjow :

sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ OPT=-dFPC_ARMEL INSTALL_PREFIX=/usr

I rewrote "my guide" how to cross compile starting from sources, this is the result:

http://forum.lazarus.freepascal.org/index.php/topic,8084.0.html

Now I'm using this:

sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ OPT=-dFPC_ARMEL INSTALL_PREFIX=/usr

to make cross compiler, but I still have problems in linking; These are the messages returned by Lazarus IDE:

Hint: Start of reading config file /home/kjow/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Hint: End of reading config file /home/kjow/.fpc.cfg Free Pascal Compiler version 2.5.1 [2009/12/15] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARMEL
Compiling LAzARM.lpr
Compiling main.pas
Assembling main
Assembling lazarm
Linking /home/kjow/dev/TestARM/LazARM/LAzARM
/home/kjow/lazarus/fpc/libcross/libexpat.so.1: undefined reference to '
/home/kjow/lazarus/fpc/libcross/libglib-2.0.so: undefined reference to '
LAzARM.lpr(22) Error: Error while linking
/home/kjow/lazarus/fpc/libcross/libexpat.so.1: undefined reference to '
/home/kjow/lazarus/fpc/libcross/libglib-2.0.so: undefined reference to '
LAzARM.lpr(22) Error: Error while linking
LAzARM.lpr(22) Fatal: There were 1 errors compiling module, stopping

Why I get these errors?

Thank you!

Reply by email

Dariusz Mazur
to Florian Klaempfl: Please, don't spread the nonsense of -CfSOFT -CaEABI, it's neither needed nor desired.…

Florian Klaempfl pisze:

Show quoted text 37 lines
Dariusz Mazur schrieb: > Kjow pisze: > >> 2009/12/15 : >> >> >>> Should be >>> Target OS: Linux for ARMEL >>> >>> You have to recompile crosscompiller >>> Its not EABI (see my descuss with Jonas on fpc-devel) >>> >>> make crosssinstal OPT="-dFPC_ARMEL" ....... >>> >>> >> This is the command that I used to make crosscompiler: >> >> sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux >> CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ CROSSOPT="-CaEABI >> >> >> -dFPC_ARMEL -CfSOFT -gl -O-" INSTALL_PREFIX=/usr/ >> COMPILER_OPTIONS="cpufpemu" >> >> > sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux > CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ OPT="-dFPC_ARMEL" > CROSSOPT="-CaEABI -dFPC_ARMEL -CfSOFT -gl -O2" INSTALL_PREFIX=/usr/ > > > > add OPT, remove COMPILER_OPTIONS > Please, don't spread the nonsense of -CfSOFT -CaEABI, it's neither

This is no I, as You see upper:
<cite>
make crosssinstal OPT="-dFPC_ARMEL" .......
add OPT, remove COMPILER_OPTIONS
</cite>

I test about -CaEABI its not needed, then same with CROSSOPT="-dFPC_ARMEL

I know too few to say to omit some options
Jonas say about: CROSSOPT="-dFPC_ARMEL
last time when I ask about reduction options everyone blame me

but how compiler know, that FPU is present or absent (-CfSOFT)?

needed nor desired. -dFPC_ARMEL is enough. Neither is -dFPC_ARMEL needed in CROSSOPT. It is only needed when the first arm compiler is built and in this case OPT=-dFPC_ARMEL is enough.

for me better: CPU_TARGET=armel (similar as ARMEB)

Darek

Reply by email

Florian Klaempfl
to Dariusz Mazur
I know too few to say to omit some options Jonas say about: CROSSOPT="-dFPC_ARMEL

This is not needed.

last time when I ask about reduction options everyone blame me but how compiler know, that FPU is present or absent (-CfSOFT)?

armel has by default no fpu or whatever.

Show quoted text 7 lines
> needed nor desired. -dFPC_ARMEL is enough. Neither is -dFPC_ARMEL needed > in CROSSOPT. It is only needed when the first arm compiler is built and > in this case OPT=-dFPC_ARMEL is enough. > for me better: CPU_TARGET=armel (similar as ARMEB)

Neither armel nor armeb are supported yet by fpc. So the extra OPT=-dFPC_ARMEL is needed when building fpc.

Reply by email

Florian Klaempfl
to Unknown author: Thx OK. Can I ask: What is difference between CPU_TARGET=arm (with -CaEABI) and armel…
Show quoted text 5 lines
Can I ask: What is difference between CPU_TARGET=arm (with -CaEABI) and armel seems, that first not produce proper EABI code though it say it is (readelf status) its normal or bug or unexpected behaviour ?

Undefined behaviour. readelf just checks the header of the object file. The header of the object file is written by the used binutils and not by fpc.

Reply by email

Kjow
to Florian Klaempfl: Please, don't spread the nonsense of -CfSOFT -CaEABI, it's neither needed nor desired.…

2009/12/15 Florian Klaempfl :

Please, don't spread the nonsense of -CfSOFT -CaEABI, it's neither needed nor desired. -dFPC_ARMEL is enough. Neither is -dFPC_ARMEL needed ?in CROSSOPT. It is only needed when the first arm compiler is built and in this case OPT=-dFPC_ARMEL is enough.

Thank you very much!
Now Lazarus builds right for my arm-linux device!
(it was a target libs problem)

Reply by email

Kjow
to Unknown author: Should be Target OS: Linux for ARMEL You have to recompile crosscompiller Its not EABI…

2009/12/15 :

Show quoted text 7 lines
Should be ? Target OS: Linux for ARMEL You have to recompile crosscompiller Its not EABI (see my descuss with Jonas on fpc-devel) make crosssinstal OPT="-dFPC_ARMEL" .......

Yes, now with the suggestions about OPT:

sudo make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=/home/kjow/lazarus/fpc/binutils/ OPT=-dFPC_ARMEL INSTALL_PREFIX=/usr

Lazarus builds right, and "Target OS: Linux for ARMEL":

Free Pascal Compiler version 2.5.1 [2009/12/15] for arm Copyright (c) 1993-2009 by Florian Klaempfl
Target OS: Linux for ARMEL
Compiling LAzARM.lpr
Compiling main.pas
Assembling main
Assembling lazarm
Linking /home/kjow/dev/TestARM/LazARM/LAzARM
5324 lines compiled, 1.7 sec
Project "LAzARM" successfully built

Reply by email

Unknown author
to Florian Klaempfl: This is not needed. armel has by default no fpu or whatever. Neither armel nor armeb are…
> but how compiler know, that FPU is present or absent (-CfSOFT)? armel has by default no fpu or whatever.

Thx

Show quoted text 13 lines
> > >> needed nor desired. -dFPC_ARMEL is enough. Neither is -dFPC_ARMEL >> needed >> in CROSSOPT. It is only needed when the first arm compiler is built >> and >> in this case OPT=-dFPC_ARMEL is enough. >> > for me better: CPU_TARGET=armel (similar as ARMEB) Neither armel nor armeb are supported yet by fpc. So the extra OPT=-dFPC_ARMEL is needed when building fpc.

OK.

Can I ask:
What is difference between CPU_TARGET=arm (with -CaEABI) and armel seems, that first not produce proper EABI code though it say it is (readelf status)
its normal or bug or unexpected behaviour ?

Darek

Reply by email