Recent

Author Topic: Why VFP register always in arguments While compiler is ARMEL  (Read 525 times)

cai

  • New Member
  • *
  • Posts: 41
Why VFP register always in arguments While compiler is ARMEL
« on: December 01, 2022, 11:35:22 am »
I already build cross arm compiler with OPT="-dFPC_ARMEL"

and my crosslib is support soft float

when I build a shared library,output link errors:

arm-linux-ld.exe: error: fpc\units\arm-linux\rtl\classes.o uses VFP register arguments, XXXXX\libtest.so does not


PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Why VFP register always in arguments While compiler is ARMEL
« Reply #1 on: December 01, 2022, 09:57:42 pm »
Try to compile both FPC itself (as part of OPT) and your library with -Cfsoft.

cai

  • New Member
  • *
  • Posts: 41
Re: Why VFP register always in arguments While compiler is ARMEL
« Reply #2 on: December 02, 2022, 04:24:39 am »
Try to compile both FPC itself (as part of OPT) and your library with -Cfsoft.

Hi,  this is my ppcrossarm.exe -i
--------------------------------------
Free Pascal Compiler version 3.3.1

Compiler date      : 2022/12/01
Compiler CPU target: arm

Supported targets (targets marked with '{*}' are under development):
  Linux: Linux for ARMEL
  WinCE: WinCE for ARM
  gba: GameBoy Advance
  PalmOS: PalmOS
  nds: Nintendo DS
  embedded: Embedded
  Symbian: Symbian OS for ARM
  iOS: iOS for ARM
  Android: Android for ARMEL
  AROS: AROS for ARM
  NetBSD: NetBSD for ARMHF {*}
  freertos: FreeRTOS

Supported CPU instruction sets:
  ARMV2,ARMV3,ARMV4,ARMV4T,ARMV5T,ARMV5TE,ARMV5TEJ,ARMV6,ARMV6K,ARMV6T2,
  ARMV6Z,ARMV6M,ARMV7,ARMV7A,ARMV7R,ARMV7M,ARMV7EM

Supported FPU instruction sets:
  NONE,SOFT,LIBGCC,FPA,FPA10,FPA11,VFPV2,VFPV3,NEON_VFPV3,VFPV3_D16,
  FPV4_S16,VFPV4,FPV4_SP_D16,NEON_VFPV4
--------------------------------------

I build FPC rtl & packages with FPC=ppcrossarm.exe

command line:
------------------
cd C:\fpcsrc\
make.exe rtl packages CROSSINSTALL=1 CPU_TARGET=arm OS_TARGET=linux BINUTILSPREFIX=arm-linux FPC=ppcrossarm.exe OPT="-Cfsoft"

output :
--------------------
arm-linux-as -meabi=5 -o C:/fpcsrc/rtl/units/arm-linux/prt0.o arm/prt0.as
ppcrossarm.exe -Ur -Tlinux -Parm -XParm-linux- -Ur -Xs -O2 -n -Fi../inc -Fi../arm -Fi../unix -Fiarm -FE. -FUC:/fpcsrc/rtl/units/arm-linux -Cfsoft -darm -dRELEASE  -Us -Sg system.pp

=========================
Bootstrap Compiler is win64 ppcx64.exe

finally,
I build my library in Lazarus with -Cfsoft in [Compiler Options]->[Custom Options] pages, still got errors, here is information:
----------------------------
Free Pascal Compiler version 3.3.1 [2022/12/01] for arm
Copyright (c) 1993-2021 by Florian Klaempfl and others
(1002) Target OS: Linux for ARMEL
(3104) Compiling xxxx.ppr
(3104) Compiling ..\..\..\..\Common\GraphLibEx.pas
....
....
(9015) Linking E:\xxxxxxx\Bin\Linux\arm-OpenHarmony\libxxxx.so
arm-linux-ld.exe: error: E:\xxxxxx\Tmp\Linux\arm-OpenHarmony\xxxx.o uses VFP register arguments, E:\XXXXXXX\Bin\Linux\arm-OpenHarmony\libxxxx.so does not
arm-linux-ld.exe: error: C:\fpc\fpc64\units\arm-linux\rtl\sysutils.o uses VFP register arguments, E:\XXXXXXX\Bin\Linux\arm-OpenHarmony\libxxxx.so does not

=========================
did i miss something, Your help would be greatly appreciated

cai

  • New Member
  • *
  • Posts: 41
Re: Why VFP register always in arguments While compiler is ARMEL
« Reply #3 on: December 13, 2022, 10:24:23 am »
finally, i found that -dFPC_ARMEL is unnecessary!

1. build cross compiler
make.exe compiler_cycle CROSSINSTALL=1 CPU_TARGET=arm OS_TARGET=linux FPC=ppc386.exe or ppcx64.exe

2. cross build fpc rtl package units with
CROSSOPT="-CfSOFT -CaEABI"
NOT TESTED: fast floating point with -OoFASTMATH

some infos may help:
--------------------
https://wiki.lazarus.freepascal.org/ARM_compiler_options

 

TinyPortal © 2005-2018