Sign in Join

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

Mailing lists / fpc-devel / 2009-12

ARM: problem with uses VFP instructions

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Dariusz Mazur

HI
I try to crosscompile for arm (uclibc and eabi). Source and listing error below.
But when I remove dynlibs form uses section, all goes OK When I check link.res only few things are changed in section input prt0->cprt0.o
->crti.o

What I should looking for.

program hello;
uses
  dynlibs,
  sysconst,
  rtlconsts,
  sysutils,
  classes;
var
  i : double;
begin
 i:=int(1.1);
 writeln('hello world ',i);
end.

and receive error:

./ppcrossarm
hello.pas >rr
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: /home/darek2008/fpcarm/praca/arm-linux/hello.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file /home/darek2008/fpcarm/praca/arm-linux/hello.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/system.o uses VFP instructions, whereas hello does not /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/system.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/objpas.o uses VFP instructions, whereas hello does not /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/objpas.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/dynlibs.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/dynlibs.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/sysutils.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/sysutils.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/rtlconsts.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/rtlconsts.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/sysconst.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/sysconst.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/unix.o uses VFP instructions, whereas hello does not /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/unix.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/errors.o uses VFP instructions, whereas hello does not /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/errors.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/unixtype.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/unixtype.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/baseunix.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/baseunix.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/unixutil.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/unixutil.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/syscall.o uses VFP instructions, whereas hello does not
/home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/syscall.o /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: ERROR: ./units/arm-linux/rtl/dl.o uses VFP instructions, whereas hello does not /home/darek2008/fpcarm/arm-linux-uclibc/bin/ld: failed to merge target specific data of file ./units/arm-linux/rtl/dl.o
./units/arm-linux/rtl/cprt0.o: In function `_start': (.text+0x4c): undefined reference to `__libc_start_main'

Darek

Reply by email

Jonas Maebe
to Dariusz Mazur
Dariusz Mazur wrote 9 lines
HI I try to crosscompile for arm (uclibc and eabi). Source and listing error below. But when I remove dynlibs form uses section, all goes OK When I check link.res only few things are changed in section input prt0->cprt0.o ->crti.o What I should looking for.

I don't understand the errors, because FPC does not yet support VFP at all. So those FPC-generated object files cannot contain any VFP code. On ARM systems, the kind of instructions used by an object file is stored in its header by the assembler. Maybe you are using a toolchain that has not been configured for softfloat to cross-compile.

Jonas

Reply by email

Dariusz Mazur
to Jonas Maebe

Jonas Maebe pisze:

Show quoted text 18 lines
On 02 Dec 2009, at 00:23, Dariusz Mazur wrote: > HI > I try to crosscompile for arm (uclibc and eabi). Source and listing > error below. > But when I remove dynlibs form uses section, all goes OK > When I check link.res only few things are changed in section input > prt0->cprt0.o > ->crti.o > > What I should looking for. I don't understand the errors, because FPC does not yet support VFP at all. So those FPC-generated object files cannot contain any VFP code. On ARM systems, the kind of instructions used by an object file is stored in its header by the assembler. Maybe you are using a toolchain that has not been configured for softfloat to cross-compile.

i've make some investigation
problem start from crti.o linking from achieved toolchain (I use AT91SAM9260)
I found something like makro __FPV_FP in source for this library on uclibc.org
and explanation on http://wiki.debian.org/ArmEabiPort

When porting code to ARM EABI, the following preprocessor macros are interesting:

*

__VFP_FP__ means that the floating point format in use is that of the ARM VFP unit, which is native-endian IEEE-754.

*

__MAVERICK__ means that the floating point format is that of the irrus Logic MaverickCrunch
<http://wiki.debian.org/MaverickCrunch>, which is also IEEE-754 and is always little-endian.

*

__SOFTFP__ means that instead of floating point instructions, library calls are being generated for floating point math operations so that the code will run on a processor without an FPU.

__VFP_FP__ and __MAVERICK__ are mutually exclusive. If neither is set, that means the floating point format in use is the old mixed-endian 45670123 format of the FPA unit.

Note that __VFP_FP__ does /not/ mean that VFP code generation has been selected. It only speaks of the floating point data format in use and is normally set when softfloat has been selected. The correct test for VFP code generation, for example around asm fragments containing VFP instructions, is

My question is: which variant use FPC

Darek

Reply by email

Jonas Maebe
to Dariusz Mazur
Dariusz Mazur wrote 31 lines
* __VFP_FP__ means that the floating point format in use is that of the ARM VFP unit, which is native-endian IEEE-754. * __MAVERICK__ means that the floating point format is that of the irrus Logic MaverickCrunch <http://wiki.debian.org/MaverickCrunch>, which is also IEEE-754 and is always little-endian. * __SOFTFP__ means that instead of floating point instructions, library calls are being generated for floating point math operations so that the code will run on a processor without an FPU. __VFP_FP__ and __MAVERICK__ are mutually exclusive. If neither is set, that means the floating point format in use is the old mixed- endian 45670123 format of the FPA unit. Note that __VFP_FP__ does /not/ mean that VFP code generation has been selected. It only speaks of the floating point data format in use and is normally set when softfloat has been selected. The correct test for VFP code generation, for example around asm fragments containing VFP instructions, is My question is: which variant use FPC

By default, on ARM/EABI FPC uses native-endian IEEE-754, but uses library calls (to internal code in the RTL) to emulate the floating point operations. So it's a combination of __VFP_FP__ and __SOFTFP__.

Jonas

Reply by email

Dariusz Mazur
to Jonas Maebe

Jonas Maebe pisze:

Show quoted text 38 lines
On 02 Dec 2009, at 15:17, Dariusz Mazur wrote: > * > > __VFP_FP__ means that the floating point format in use is that of > the ARM VFP unit, which is native-endian IEEE-754. > > * > > __MAVERICK__ means that the floating point format is that of the > irrus Logic MaverickCrunch > <http://wiki.debian.org/MaverickCrunch>, which is also IEEE-754 > and is always little-endian. > > * > > __SOFTFP__ means that instead of floating point instructions, > library calls are being generated for floating point math > operations so that the code will run on a processor without an FPU. > > __VFP_FP__ and __MAVERICK__ are mutually exclusive. If neither is > set, that means the floating point format in use is the old > mixed-endian 45670123 format of the FPA unit. > > Note that __VFP_FP__ does /not/ mean that VFP code generation has > been selected. It only speaks of the floating point data format in > use and is normally set when softfloat has been selected. The correct > test for VFP code generation, for example around asm fragments > containing VFP instructions, is > > > My question is: which variant use FPC By default, on ARM/EABI FPC uses native-endian IEEE-754, but uses library calls (to internal code in the RTL) to emulate the floating point operations. So it's a combination of __VFP_FP__ and __SOFTFP__.

I found that crti.o linking form toolchain is without VFP, i try to recompile this

Darek

Reply by email

Dariusz Mazur
to Dariusz Mazur

Dariusz Mazur pisze:

Show quoted text 43 lines
Jonas Maebe pisze: > > On 02 Dec 2009, at 15:17, Dariusz Mazur wrote: > >> * >> >> __VFP_FP__ means that the floating point format in use is that of >> the ARM VFP unit, which is native-endian IEEE-754. >> >> * >> >> __MAVERICK__ means that the floating point format is that of the >> irrus Logic MaverickCrunch >> <http://wiki.debian.org/MaverickCrunch>, which is also IEEE-754 >> and is always little-endian. >> >> * >> >> __SOFTFP__ means that instead of floating point instructions, >> library calls are being generated for floating point math >> operations so that the code will run on a processor without an FPU. >> >> __VFP_FP__ and __MAVERICK__ are mutually exclusive. If neither is >> set, that means the floating point format in use is the old >> mixed-endian 45670123 format of the FPA unit. >> >> Note that __VFP_FP__ does /not/ mean that VFP code generation has >> been selected. It only speaks of the floating point data format in >> use and is normally set when softfloat has been selected. The >> correct test for VFP code generation, for example around asm >> fragments containing VFP instructions, is >> >> >> My question is: which variant use FPC > > By default, on ARM/EABI FPC uses native-endian IEEE-754, but uses > library calls (to internal code in the RTL) to emulate the floating > point operations. So it's a combination of __VFP_FP__ and __SOFTFP__. > I found that crti.o linking form toolchain is without VFP, i try to recompile this

At last I made it,
I have new uclibc library compiled with VFP

for others
I use OpenWRT, to recompile
make menuconfig
add in advanced configuration/toolchain/target optimization -mfpu=vfp

after make i receive in toolchain path
readelf -a crti.o show flags: soft float and VFP

Darek

Reply by email