View Issue Details

IDProjectCategoryView StatusLast Update
0014386FPCRTLpublic2011-05-01 21:37
ReporterHenry Vermaak Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Platformarm eabiOSlinux 
Product Version2.5.1 
Target Version2.4.2Fixed in Version2.4.2 
Summary0014386: arm eabi syscall removal
Descriptiona bunch of syscalls have been removed from the arm eabi kernel:

/*
 * The following syscalls are obsolete and no longer available for EABI.
 */
#if defined(__ARM_EABI__) && !defined(__KERNEL__)
#undef __NR_time
#undef __NR_umount
#undef __NR_stime
#undef __NR_alarm
#undef __NR_utime
#undef __NR_getrlimit
#undef __NR_select
#undef __NR_readdir
#undef __NR_mmap
#undef __NR_socketcall
#undef __NR_syscall
#undef __NR_ipc
#endif


i attach a patch that will take steps to fix the fpc rtl, hopefully. compiles o.k. not tested, yet, since hardware is at home. how do i run the testsuite?
TagsNo tags attached.
Fixed in Revision13717
FPCOldBugId0
FPCTarget
Attached Files

Activities

2009-08-19 18:23

 

eabi_syscall.patch (8,770 bytes)   
Index: rtl/unix/sockets.pp
===================================================================
--- rtl/unix/sockets.pp	(revision 13557)
+++ rtl/unix/sockets.pp	(working copy)
@@ -17,6 +17,8 @@
 Uses baseunix,UnixType;
 {$endif}
 
+{$i osdefs.inc}       { Compile time defines }
+
 {$ifdef FreeBSD}
 {$DEFINE SOCK_HAS_SINLEN}               // BSD definition of socketaddr
 {$endif}
Index: rtl/unix/ipc.pp
===================================================================
--- rtl/unix/ipc.pp	(revision 13557)
+++ rtl/unix/ipc.pp	(working copy)
@@ -23,6 +23,8 @@
 {$endif}
   BaseUnix,UnixType;
 
+{$i osdefs.inc}       { Compile time defines }
+
 { ----------------------------------------------------------------------
   General IPC stuff
   ----------------------------------------------------------------------}
@@ -517,7 +519,7 @@
 
 {$ifndef FPC_USE_LIBC}
  {$ifdef Linux}
-  {$ifdef cpux86_64}
+  {$if defined(cpux86_64) or defined(NO_SYSCALL_IPC)}
     {$i ipcsys.inc}
   {$else}
     {$i ipccall.inc}
Index: rtl/linux/arm/sysnr.inc
===================================================================
--- rtl/linux/arm/sysnr.inc	(revision 13557)
+++ rtl/linux/arm/sysnr.inc	(working copy)
@@ -39,7 +39,9 @@
   syscall_nr_unlink                     =  syscall_nr_base+10;
   syscall_nr_execve                     =  syscall_nr_base+11;
   syscall_nr_chdir                      =  syscall_nr_base+12;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_time                       =  syscall_nr_base+13;
+{$endif}
   syscall_nr_mknod                      =  syscall_nr_base+14;
   syscall_nr_chmod                      =  syscall_nr_base+15;
   syscall_nr_lchown                     =  syscall_nr_base+16;
@@ -48,15 +50,23 @@
   syscall_nr_lseek                      =  syscall_nr_base+19;
   syscall_nr_getpid                     =  syscall_nr_base+20;
   syscall_nr_mount                      =  syscall_nr_base+21;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_umount                     =  syscall_nr_base+22;
+{$endif}
   syscall_nr_setuid                     =  syscall_nr_base+23;
   syscall_nr_getuid                     =  syscall_nr_base+24;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_stime                      =  syscall_nr_base+25;
+{$endif}
   syscall_nr_ptrace                     =  syscall_nr_base+26;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_alarm                      =  syscall_nr_base+27;
+{$endif}
 
   syscall_nr_pause                      =  syscall_nr_base+29;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_utime                      =  syscall_nr_base+30;
+{$endif}
   syscall_nr_stty                       =  syscall_nr_base+31;
   syscall_nr_gtty                       =  syscall_nr_base+32;
   syscall_nr_access                     =  syscall_nr_base+33;
@@ -102,21 +112,27 @@
   syscall_nr_sigpending                 =  syscall_nr_base+73;
   syscall_nr_sethostname                =  syscall_nr_base+74;
   syscall_nr_setrlimit                  =  syscall_nr_base+75;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_getrlimit                  =  syscall_nr_base+76;
+{$endif}
   syscall_nr_getrusage                  =  syscall_nr_base+77;
   syscall_nr_gettimeofday               =  syscall_nr_base+78;
   syscall_nr_settimeofday               =  syscall_nr_base+79;
   syscall_nr_getgroups                  =  syscall_nr_base+80;
   syscall_nr_setgroups                  =  syscall_nr_base+81;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_select                     =  syscall_nr_base+82;
+{$endif}
   syscall_nr_symlink                    =  syscall_nr_base+83;
 
   syscall_nr_readlink                   =  syscall_nr_base+85;
   syscall_nr_uselib                     =  syscall_nr_base+86;
   syscall_nr_swapon                     =  syscall_nr_base+87;
   syscall_nr_reboot                     =  syscall_nr_base+88;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_readdir                    =  syscall_nr_base+89;
   syscall_nr_mmap                       =  syscall_nr_base+90;
+{$endif}
   syscall_nr_munmap                     =  syscall_nr_base+91;
   syscall_nr_truncate                   =  syscall_nr_base+92;
   syscall_nr_ftruncate                  =  syscall_nr_base+93;
@@ -128,7 +144,9 @@
   syscall_nr_statfs                     =  syscall_nr_base+99;
   syscall_nr_fstatfs                    = syscall_nr_base+100;
   syscall_nr_ioperm                     = syscall_nr_base+101;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_socketcall                 = syscall_nr_base+102;
+{$endif}
   syscall_nr_syslog                     = syscall_nr_base+103;
   syscall_nr_setitimer                  = syscall_nr_base+104;
   syscall_nr_getitimer                  = syscall_nr_base+105;
@@ -137,11 +155,15 @@
   syscall_nr_fstat                      = syscall_nr_base+108;
   syscall_nr_vhangup                    = syscall_nr_base+111;
   syscall_nr_idle                       = syscall_nr_base+112;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_syscall                    = syscall_nr_base+113;
+{$endif}
   syscall_nr_wait4                      = syscall_nr_base+114;
   syscall_nr_swapoff                    = syscall_nr_base+115;
   syscall_nr_sysinfo                    = syscall_nr_base+116;
+{$ifndef FPC_ABI_EABI}
   syscall_nr_ipc                        = syscall_nr_base+117;
+{$endif}
   syscall_nr_fsync                      = syscall_nr_base+118;
   syscall_nr_sigreturn                  = syscall_nr_base+119;
   syscall_nr_clone                      = syscall_nr_base+120;
@@ -394,6 +416,3 @@
   __ARM_NR_usr32			= __ARM_NR_BASE+4;
   __ARM_NR_set_tls		        = __ARM_NR_BASE+5;
 
-
-
-
Index: rtl/linux/osdefs.inc
===================================================================
--- rtl/linux/osdefs.inc	(revision 13557)
+++ rtl/linux/osdefs.inc	(working copy)
@@ -39,7 +39,21 @@
 {$endif}
 
 {$if (defined(cpuarm) and defined(FPC_ABI_EABI))}
-{$define FPC_USEGETTIMEOFDAY}
+  {$define FPC_USEGETTIMEOFDAY}
+  {$undef usestime}
+
+  {$define NO_SYSCALL_TIME}
+  {$define NO_SYSCALL_UMOUNT}
+  {$define NO_SYSCALL_STIME}
+  {$define NO_SYSCALL_ALARM}
+  {$define NO_SYSCALL_UTIME}
+  {$define NO_SYSCALL_GETRLIMIT}
+  {$define NO_SYSCALL_SELECT}
+  {$define NO_SYSCALL_READDIR}
+  {$define NO_SYSCALL_MMAP}
+  {$define NO_SYSCALL_SOCKETCALL}
+  {$define NO_SYSCALL_SYSCALL}
+  {$define NO_SYSCALL_IPC}
 {$endif}
 
  {$ifdef CPUARM}
Index: rtl/linux/unixsock.inc
===================================================================
--- rtl/linux/unixsock.inc	(revision 13557)
+++ rtl/linux/unixsock.inc	(working copy)
@@ -13,7 +13,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 }
 
-{$ifndef cpux86_64}
+{$if not defined(cpux86_64) and not defined(NO_SYSCALL_SOCKETCALL)}
   {$define NEED_SOCKETCALL}
 {$endif}
 
Index: rtl/linux/bunxsysc.inc
===================================================================
--- rtl/linux/bunxsysc.inc	(revision 13557)
+++ rtl/linux/bunxsysc.inc	(working copy)
@@ -330,13 +330,30 @@
   fpChOwn:=do_syscall(syscall_nr_chown,TSysParam(path),TSysParam(owner),TSysParam(group));
 end;
 
+{$ifndef NO_SYSCALL_UTIME}
+
 Function fpUtime(path:pchar;times:putimbuf):cint;
 
 begin
- fputime:=do_syscall(syscall_nr_utime,TSysParam(path),TSysParam(times));
+  fputime:=do_syscall(syscall_nr_utime,TSysParam(path),TSysParam(times));
 end;
 
+{$else}
 
+Function fpUtime(path:pchar;times:putimbuf):cint;
+var
+  tva: Array[0..1] of timeval;
+begin
+  tva[0].tv_sec := times^.actime;
+  tva[0].tv_usec := 0;
+  tva[1].tv_sec := times^.modtime;
+  tva[1].tv_usec := 0;
+  fputime:=do_syscall(syscall_nr_utimes,TSysParam(path),TSysParam(@tva));
+end;
+
+{$endif}
+
+
 {$ifndef FPC_BASEUNIX_HAS_FPPIPE}
 Function fppipe(var fildes : tfildes):cint;
 
Index: rtl/linux/ossysc.inc
===================================================================
--- rtl/linux/ossysc.inc	(revision 13557)
+++ rtl/linux/ossysc.inc	(working copy)
@@ -568,12 +568,13 @@
  fpgettimeofday:=do_syscall(syscall_nr_gettimeofday,TSysParam(tp),TSysParam(tzp));
 end;
 
-
+{$ifndef NO_SYSCALL_GETRLIMIT}
 function FpGetRLimit(resource : cInt; rlim : PRLimit) : cInt;
 begin
   FpGetRLimit := do_syscall(syscall_nr_getrlimit,
     TSysParam(resource), TSysParam(rlim));
 end;
+{$endif}
 
 {$ifdef HAS_UGETRLIMIT}
 function fpugetrlimit(resource : cInt; rlim : PRLimit) : cInt;
Index: rtl/linux/system.pp
===================================================================
--- rtl/linux/system.pp	(revision 13557)
+++ rtl/linux/system.pp	(working copy)
@@ -312,8 +312,10 @@
   {$ifdef has_ugetrlimit}
   success := fpugetrlimit(RLIMIT_STACK, @limits)=0;
   {$endif}
+  {$ifndef NO_SYSCALL_GETRLIMIT}
   if (not success) then
     success := fpgetrlimit(RLIMIT_STACK, @limits)=0;
+  {$endif}
   if (success) and (limits.rlim_cur < stklen) then
     result := limits.rlim_cur
   else
eabi_syscall.patch (8,770 bytes)   

Jonas Maebe

2009-08-19 18:41

manager   ~0029982

> how do i run the testsuite?

After compiling everything with a "make all OPT=..." in the main fpc directory, go into the fpc/tests directory and use something like (this assumes a cross-compiling setup on a Unix-like platform, and make sure to create the TEST_REMOTEPATH in advance on the device)

make FPC=<yournativefpc> TEST_FPC=`pwd`/../compiler/ppcrossarm TEST_BINUTILSPREFIX=arm-unknown-gnueabi- TEST_SSH=<login>@<name_of_arm_device> TEST_REMOTEPATH=/tmp/tests TEST_OPT="-O2 -ap" clean all digest

See fpc/tests/readme.txt for more information.

Henry Vermaak

2009-08-19 18:46

reporter   ~0029983

thanks, that's neat. i'll try that at home, since i've got an nslu2 that's on eabi. does the freepascal team have any eabi test machines?

Jonas Maebe

2009-08-19 18:57

manager   ~0029985

> does the freepascal team have any eabi test machines?

I believe Florian has a mobile phone that qualifies, but it's extremely slow (too slow for testsuite runs).

Recently we bought an EVB Beagleboard for our research at the university (Cortex-A8 600MHz with 256MB ram), but I haven't had time yet to set up nightly test runs on it. And once we start using it for our work, I don't know whether it'll still be possible to use it for testsuite runs.

Henry Vermaak

2009-08-19 19:52

reporter   ~0029986

hmm, the slug is very slow. maybe i'll let the testsuite run overnight. the best thing is probably to get a sheevaplug: http://www.plugcomputer.org/ at least that will have enough power to run a nightly test suite.

Jonas Maebe

2009-08-19 20:08

manager   ~0029987

It's probably also very slow due to the fact that every test requires an scp followed by an ssh. It might be slightly faster if you enable rsh and use RSH=... instead of SSH=... in the above command, although with the repeated network connections it will never really fly.

Florian

2009-08-19 21:02

administrator   ~0029989

> hmm, the slug is very slow.

You should be able run it natively. My ARM testing machine still runs Debian Lenny, I could only upgrade to get an eabi one.

> I believe Florian has a mobile phone that qualifies,

The mobile has vfp, eabi can be used on any arm machine supporting 32 bit arm.

2009-08-19 22:15

 

without-patch.txt (605 bytes)   
Total = 373 (2:371)
Total number of compilations = 371 (2:369)
Successfully compiled = 10
Successfully failed = 359
Compilation failures = 0
Compilation that did not fail while they should = 2
Total number of runs = 2 (0:2)
Successful runs = 2
Failed runs = 0
Number units compiled = 2
Number program that should not be run = 1
Number of skipped tests = 11
Number of skipped graph tests = 0
Number of skipped interactive tests = 0
Number of skipped known bug tests = 0
Number of skipped tests for other versions = 1
Number of skipped tests for other cpus = 8
Number of skipped tests for other targets = 2
without-patch.txt (605 bytes)   

2009-08-19 22:16

 

with-patch.txt (609 bytes)   
Total = 433 (4:429)
Total number of compilations = 406 (4:402)
Successfully compiled = 37
Successfully failed = 365
Compilation failures = 2
Compilation that did not fail while they should = 2
Total number of runs = 27 (0:27)
Successful runs = 27
Failed runs = 0
Number units compiled = 3
Number program that should not be run = 1
Number of skipped tests = 14
Number of skipped graph tests = 0
Number of skipped interactive tests = 0
Number of skipped known bug tests = 1
Number of skipped tests for other versions = 1
Number of skipped tests for other cpus = 10
Number of skipped tests for other targets = 2
with-patch.txt (609 bytes)   

Henry Vermaak

2009-08-19 22:17

reporter   ~0029991

I've uploaded test results, but I don't really know what it means. Seems like with the patch there's a lot more runs (27 vs 2). Shall I attach the logs?

Henry Vermaak

2009-08-19 22:29

reporter   ~0029992

Building the compiler, rtl and packages (with clean), takes 4m27.372s on my incredibly old and slow laptop. Running the testsuite via ssh takes 2m53.044s. Gives me plenty of time to drink beer.

Jonas Maebe

2009-08-19 22:38

manager   ~0029994

> Shall I attach the logs?

Yes, please. The "uploadrun" is unlike to have succeeded. You need to be able to log in on svn.freepascal.org for that to work. What you can do is make the "tarfile" target and attach output/arm-linux/*.tar.gz file.

Jonas Maebe

2009-08-19 22:39

manager   ~0029995

> Running the testsuite via ssh takes 2m53.044s.

2 minutes? I guess you mean 2 hours?

Henry Vermaak

2009-08-19 22:53

reporter   ~0029996

>> Running the testsuite via ssh takes 2m53.044s.

> 2 minutes? I guess you mean 2 hours?

No, almost 3 minutes. Something is obviously not working properly, I guess. I'll attach the logs.

Jonas Maebe

2009-08-19 23:04

manager   ~0029998

Last edited: 2009-08-19 23:09

It only runs 300-400 tests out of the approx. 4800, so there's definitely something wrong.

Edit: and so I've discovered that <tilde>number in Mantis means "reference to note <number>" :)

Henry Vermaak

2009-08-19 23:05

reporter   ~0029999

Heh, there wasn't enough space in /tmp. Sigh. I'll get back to you tomorrow with those logs.

Florian

2009-08-19 23:13

administrator   ~0030000

Pass TEST_DELTEMP=1 to make

Jonas Maebe

2009-08-19 23:25

manager   ~0030001

> Pass TEST_DELTEMP=1 to make

That's a bad idea, because several tests nowadays depend on previous tests still existing.

Henry Vermaak

2009-08-19 23:37

reporter   ~0030002

> It only runs 300-400 tests out of the approx. 4800, so there's definitely
> something wrong.

Right, I dumped the tests onto a drive with lots of space on it, so it's running now. Seems like it will take 3-4 hours to complete o_O. I might try and set it up to do a native build and test tomorrow night.

> Edit: and so I've discovered that <tilde>number in Mantis means "reference
> to note <number>" :)

This is handy to know. Thanks for all the help with this, much appreciated.

2009-08-20 00:33

 

Henry Vermaak

2009-08-20 00:36

reporter   ~0030007

I uploaded the file. The whole process too about 1.5 hours. Does this look plausible?

Total = 4735 (136:4599)
Total number of compilations = 2805 (120:2685)
Successfully compiled = 2094
Successfully failed = 591
Compilation failures = 117
Compilation that did not fail while they should = 3
Total number of runs = 1930 (16:1914)
Successful runs = 1914
Failed runs = 16
Number units compiled = 97
Number program that should not be run = 64
Number of skipped tests = 246
Number of skipped graph tests = 10
Number of skipped interactive tests = 22
Number of skipped known bug tests = 5
Number of skipped tests for other versions = 16
Number of skipped tests for other cpus = 154
Number of skipped tests for other targets = 39

Michael Van Canneyt

2009-08-20 10:01

administrator   ~0030013

Applied the patch, thank you.

Issue History

Date Modified Username Field Change
2009-08-19 18:23 Henry Vermaak New Issue
2009-08-19 18:23 Henry Vermaak File Added: eabi_syscall.patch
2009-08-19 18:41 Jonas Maebe Note Added: 0029982
2009-08-19 18:46 Henry Vermaak Note Added: 0029983
2009-08-19 18:57 Jonas Maebe Note Added: 0029985
2009-08-19 19:52 Henry Vermaak Note Added: 0029986
2009-08-19 20:08 Jonas Maebe Note Added: 0029987
2009-08-19 21:02 Florian Note Added: 0029989
2009-08-19 22:15 Henry Vermaak File Added: without-patch.txt
2009-08-19 22:16 Henry Vermaak File Added: with-patch.txt
2009-08-19 22:17 Henry Vermaak Note Added: 0029991
2009-08-19 22:29 Henry Vermaak Note Added: 0029992
2009-08-19 22:38 Jonas Maebe Note Added: 0029994
2009-08-19 22:39 Jonas Maebe Note Added: 0029995
2009-08-19 22:53 Henry Vermaak Note Added: 0029996
2009-08-19 23:04 Jonas Maebe Note Added: 0029998
2009-08-19 23:05 Henry Vermaak Note Added: 0029999
2009-08-19 23:09 Jonas Maebe Note Edited: 0029998
2009-08-19 23:13 Florian Note Added: 0030000
2009-08-19 23:25 Jonas Maebe Note Added: 0030001
2009-08-19 23:37 Henry Vermaak Note Added: 0030002
2009-08-20 00:33 Henry Vermaak File Added: hcv-laptop-200908192331.tar.gz
2009-08-20 00:36 Henry Vermaak Note Added: 0030007
2009-08-20 10:00 Michael Van Canneyt Status new => assigned
2009-08-20 10:00 Michael Van Canneyt Assigned To => Michael Van Canneyt
2009-08-20 10:01 Michael Van Canneyt Fixed in Revision => 13563
2009-08-20 10:01 Michael Van Canneyt Status assigned => resolved
2009-08-20 10:01 Michael Van Canneyt Fixed in Version => 2.5.1
2009-08-20 10:01 Michael Van Canneyt Resolution open => fixed
2009-08-20 10:01 Michael Van Canneyt Note Added: 0030013
2009-08-20 10:01 Michael Van Canneyt Target Version => 2.5.1
2010-05-23 11:22 Jonas Maebe FPCOldBugId => 0
2010-05-23 11:22 Jonas Maebe Fixed in Revision 13563 => 13717
2010-05-23 11:22 Jonas Maebe Fixed in Version 2.5.1 => 2.4.1
2010-11-16 17:03 Jonas Maebe Target Version 2.5.1 => 2.4.2
2011-05-01 21:37 Marco van de Voort Status resolved => closed