[fpc-pascal] Crosscompiler for Arm Cortex A7

2017-05-17 Thread Bogdan


Hi,

On Windows 7 I have build FPC crosscompiler for Moxa UC-8410A with Arm 
Cortex A7 microprocessor with following:


set PPBINDIR=c:\FPC\3.0.2\bin\i386-win32
set SRCDIR=c:\FPC\3.0.2
set INSTDIR=c:\FPC\pp84a
set MYCFG=uc84a.cfg
set HH=i386-win32

make clean all install CROSSINSTALL=1 NOGDB=1 OS_TARGET=linux 
CPU_TARGET=arm OPT="-dFPC_ARMHF" CROSSOPT="-dFPC_ARMHF -CpARMV7A 
-CaEABIHF -CfVFPV3" INSTALL_PREFIX=%INSTDIR% PP=%PPBINDIR%\fpc.exe 
CROSSBINDIR=%INSTDIR%\bin\%HH% BINUTILSPREFIX=arm-linux-gnueabihf-


Cross binutils are from http://gnutoolchains.com/raspberry/ 
(raspberry-gcc4.9.2-r4.exe)



When I crosscompile one of my project, I get errors from assembler:

[0.417] Assembling v8par
[0.417] Executing 
"c:\FPC\pp84a\bin\i386-win32\arm-linux-gnueabihf-as.exe" with command 
line "-mfloat-abi=hard -meabi=5 -march=armv7-a -mfpu=vfpv3 -o 
lib\uc8410a\v8par.o  lib\uc8410a\v8par.s"

lib\uc8410a\v8par.s: Assembler messages:
lib\uc8410a\v8par.s:3386: Error: garbage following instruction -- `blx 
V8$_$TV8LIST_$__$$_GET$LONGINT$$TV8DATA'
lib\uc8410a\v8par.s:3500: Error: garbage following instruction -- `blx 
V8$_$TV8LIST_$__$$_GETCOUNT$$LONGINT'
lib\uc8410a\v8par.s:3733: Error: garbage following instruction -- `blx 
V8$_$TV8SETSTRINGPARAM_$__$$_CREATE$LONGINT$LONGINT$LONGINT$ANSISTRING$$TV8SETSTRINGPARAM'
lib\uc8410a\v8par.s:3736: Error: garbage following instruction -- `blx 
V8$_$TV8LIST_$__$$_ADD$TV8DATA'
lib\uc8410a\v8par.s:3758: Error: garbage following instruction -- `blx 
V8$_$TV8SETFLOATPARAM_$__$$_CREATE$LONGINT$LONGINT$LONGINT$DOUBLE$$TV8SETFLOATPARAM'
lib\uc8410a\v8par.s:3761: Error: garbage following instruction -- `blx 
V8$_$TV8LIST_$__$$_ADD$TV8DATA'

[0.432] v8par.pas(745) Error: Error while assembling exitcode 1
[0.433] v8par.pas(745) Fatal: There were 2 errors compiling module, stopping


Is crosscompiler build with wrong options or is something else ?

Thanks.



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Int64 multiplication error

2012-02-21 Thread Bogdan

Hello

I have a problem with int64 multiplication:

program tstint64;

{$MODE objfpc} {$H+}

uses SysUtils;

var
  i: integer;
  y: int64;
begin
  y := 1;
  for i := 1 to 10 do
  begin
writeln (i, ' y=', IntToHex(y,16));
y := y * 10;
  end;
end.

The program is compiled with crosscompiler on Windows7 for ARM 
Xscale-IXP43X (Linux 2.6, big endian)

After downloading to device UC-8410, I get:

root@MoxaPcvHeTest:/var/sda/tmp# ./tstint64
1 y=0001
2 y=000A
3 y=0064
4 y=03E8
5 y=2710
6 y=000186A0
7 y=000F4240
8 y=00989680
9 y=05F5E100
10 y=3B9ACA00

 HI and LO dwords are swaped in every second line.

The crosscompiler for Windows host is made from FPC 2.6.0 
/tags/release_2_6_0 revision 20381 with:
c:\FPC\2.6.0\bin\i386-win32\make.exe all CPU_TARGET=armeb 
OS_TARGET=linux BINUTILSPREFIX=armeb-linux- FPC=ppc386.exe 
OPT=-dFPC_ARMEB CROSSOPT=-dFPC_ARMEB -Cb -CfSOFT -Cparmv4


With previous version of crosscompiler I was using (FPC 2.4.2),  there 
was no such error.  Previous version of crosscompiler was compiled with 
CROSSOPT -CparmV5,
but with FPC.2.6.0 I get a lot of  Warning: Arm BLX instruction targets 
Arm function.


I think something is wrong with crosscompiler.

Bogdan

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Bus error on ARM-WinCE crosscompiler FPC 2.3.1

2009-09-14 Thread Bogdan
Hi

If I crosscompile the folowing program with
Lazarus-0.9.29-21694-fpc-2.3.1-20090914-win32.exe and
Lazarus-0.9.29-21694-fpc-2.3.1-20090914-cross-arm-wince-win32.exe:

program test4;

{$MODE Delphi}
{$APPTYPE CONSOLE}

uses
{$IFDEF WINDOWS} Windows, {$ENDIF}
  SysUtils, Classes, DateUtils;

{$IFDEF WINDOWS} {$R test4.rc} {$ENDIF}

function cvt1 (t: TdateTime): string;
var yy,mm,dd,hh,nn,ss,ms: Word;
begin
  DecodeDateTime (t,yy,mm,dd,hh,nn,ss,ms);
  result := Format('%d %d %d %d %d %d %d',[yy,mm,dd,hh,nn,ss,ms]);   //  
Bus error or misaligned data access 
end;

function cvt2 (t: TdateTime): string;
var yy,mm,dd,hh,nn,ss,ms: Word;
begin
  DecodeDateTime (t,yy,mm,dd,hh,nn,ss,ms);
  try
result := Format('%d %d %d %d %d %d %d',[yy,mm,dd,hh,nn,ss,ms]);  // OK, no 
Bus Error 
  except
on E: Exception do writeln ('cvt2 ERROR ' + E.Message);
  end;
end;


begin
  try
writeln ('cvt1: Now = ' + cvt1(Now));
  except
on E: Exception do writeln ('cvt1 ERROR ' + E.Message);
  end;

  writeln ('cvt2: Now = ' + cvt2(Now));
end.

and download to ARM (Advantech UNO-1019, WinCE 5.0) the output from program is:

  cvt1 ERROR Bus error or misaligned data access
  cvt2: Now = 2009 9 14 12 55 31 0


Crosscompiling with 2.2.4   Lazarus-0.9.29-21694-fpc-2.2.4-20090914-win32.exe 
and
Lazarus-0.9.29-21694-fpc-2.2.4-20090914-cross-arm-wince-win32.exe is OK:

  cvt1: Now = 2009 9 14 13 20 11 0
  cvt2: Now = 2009 9 14 13 20 11 0


Is this Bus error a compiler bug or something else ?

Regards .

Bogdan

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal