RE: [fpc-devel] help with softfloat for arm big endian crosscompiler

2006-12-15 Thread peter green


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Michael
 Schnell
 Sent: 15 December 2006 11:59
 To: FPC developers' list
 Subject: Re: [fpc-devel] help with softfloat for arm big endian
 crosscompiler
 
 
  however some hardware is wired up for big endian (the linksys 
 NSLU2 springs to mind) and hence is a pain to get little endian 
 linux running on (i belive the network now works in little endian 
 mode but the front panel lights are still broken)

 AFAIK, the SLUG Linux is running since a log time 
Indeed

(I don't know with 
 what shortcomings, but the Network works,
The slug as shipped by linksys runs armeb linux and most of the earlier 
unofficial attempts were also armeb based.

Later they got little endian arm linux to work on the thing but for a long time 
the built in network adaptor didn't work with little endian linux (thats now 
fixed i belive) and last i checked front panel lights still weren't working in 
little endian linux.

For TCP/IP hardware big endian just plain makes sense as network byte order is 
big endian. I dunno how much difference this and the byteswapping drivers make 
to practical performance though.

finally some of us would quite like to have a big endian system arround for 
testing on and as big endian systems go the slug is cheap!


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


[fpc-devel] Problem when doing a make -C ide install on macosx

2006-12-15 Thread Schindler Karl-Michael

Hi

There is no libgdb support for macosx yet. but make or make nodbg  
produces a usable ide.

However, make install issues a

 $(MAKE) -C ../packages/base/gdbint

which fails with

libgdb.a not found, using default GDB GDB_V6
/usr/local/bin/ppc386 -Fu../../../rtl/units/i386-darwin -Fl../../../ 
libgdb/darwin -Fo../../../libgdb/darwin -FE. -FUunits/i386-darwin - 
di386 -dGDB_V6 gdbint.pp

gdbint.pp(191,4) Fatal: User defined: This OS is not yet supported !!!
Fatal: Compilation aborted
make: *** [gdbint.ppu] Error 1

the above line was added to Makefile.fpc in revission 5504l.

Maybe there is a way to pass nogdb and install, but I could not  
figure it out.


Happy coding - Michael
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Patch for RTLEvent calls which fixes a race condition

2006-12-15 Thread Lloyd Park

I had problems with a threaded app under Linux which hung because one
thread would sometimes call RTLSetEvent before the other called
RTLEventStartWait.  The attached patch for the 2.1.1 branch revision
5606 fixes the problem.
Index: cthreads.pp
===
--- cthreads.pp	(revision 5606)
+++ cthreads.pp	(working copy)
@@ -53,6 +53,7 @@
   TINTRTLEvent = record
 condvar: pthread_cond_t;
 mutex: pthread_mutex_t;
+IsSet: boolean;
end;
 
 {*
@@ -512,6 +513,7 @@
   new(p);
   pthread_cond_init(@p^.condvar, nil);
   pthread_mutex_init(@p^.mutex, nil);
+  p^.IsSet:= false;
   result:=PRTLEVENT(p);
 end;
 
@@ -532,17 +534,23 @@
 begin
   p:=pintrtlevent(aevent);
   pthread_mutex_lock(@p^.mutex);
+  p^.IsSet:= true;
   pthread_cond_signal(@p^.condvar);
   pthread_mutex_unlock(@p^.mutex);
 end;
 
 
 procedure intRTLEventResetEvent(AEvent: PRTLEvent);
-  begin
-{ events before startwait are ignored unix }
-  end;
+var p:pintrtlevent;
 
+begin
+  p:=pintrtlevent(aevent);
+  pthread_mutex_lock(@p^.mutex);
+  p^.IsSet:= false;
+  pthread_mutex_unlock(@p^.mutex);
+end;
 
+
 procedure intRTLEventStartWait(AEvent: PRTLEvent);
 var p:pintrtlevent;
 
@@ -556,11 +564,11 @@
 
 begin
   p:=pintrtlevent(aevent);
-  pthread_cond_wait(@p^.condvar, @p^.mutex);
+  while not p^.IsSet do pthread_cond_wait(@p^.condvar, @p^.mutex);
+  p^.IsSet:=false;
   pthread_mutex_unlock(@p^.mutex);
 end;
 
-
 procedure intRTLEventWaitForTimeout(AEvent: PRTLEvent;timeout : longint);
   var
 p : pintrtlevent;
@@ -578,11 +586,14 @@
   inc(timespec.tv_sec);
   dec(timespec.tv_nsec, 10);
 end;
-errres:=pthread_cond_timedwait(@p^.condvar, @p^.mutex, @timespec);
-if (errres=0) or (errres=ESysETIMEDOUT) then
-  pthread_mutex_unlock(@p^.mutex);
+errres:=0;
+while (not p^.IsSet) and (errres  ESysETIMEDOUT) do begin
+   errres:=pthread_cond_timedwait(@p^.condvar, @p^.mutex, @timespec);
+end;
+p^.IsSet:= false;
+pthread_mutex_unlock(@p^.mutex);
   end;
-  
+
 function cSemaphoreInit: Pointer;
 var
   s: PSemaphore;
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Patch for RTLEvent calls which fixes a race condition

2006-12-15 Thread Micha Nelissen
Lloyd Park wrote:
 I had problems with a threaded app under Linux which hung because one
 thread would sometimes call RTLSetEvent before the other called
 RTLEventStartWait.  The attached patch for the 2.1.1 branch revision
 5606 fixes the problem.

Better rewrite it to use semaphore (sem_*) functions. The conditional
variables are very disappointing (exactly for the reason you describe).

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


RE: [fpc-devel] help with softfloat for arm big endian crosscompiler

2006-12-15 Thread fpc
 finally some of us would quite like to have a big endian system arround
 for testing on and as big endian systems go the slug is cheap!

Well, for FPC developers (as well as others) I make accounts available to
those interested via SSH.  I run PPC under Debian/Sparc on a Sun Ultra 5.

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


Re: [fpc-devel] help with softfloat for arm big endian crosscompiler

2006-12-15 Thread Vincent Snijders

[EMAIL PROTECTED] schreef:

finally some of us would quite like to have a big endian system arround
for testing on and as big endian systems go the slug is cheap!


Well, for FPC developers (as well as others) I make accounts available to
those interested via SSH.  I run PPC under Debian/Sparc on a Sun Ultra 5.


I might be interested for creating Lazarus and fpc snapshots (see 
http://wiki.lazarus.freepascal.org/Lazarus_Snapshots_Downloads), if 
there is actual demand for such snapshots. No need in creating files and 
maintaining build scripts, if nobody downloads them.


How people are using or testing fpc on  sparc-linux?

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


RE: [fpc-devel] help with softfloat for arm big endian crosscompiler

2006-12-15 Thread Robert Wolfe
Well considering it looks like I'm the unofficial maintainer of the
Sparc-Linux port :)  I use it and Lazarus on my Ultra 5.  But as I said in
my FPC blog (http://www.net261.com:81/wordpress/ in the FPC category) I
build new binaries whenever new code is downloaded from SVN.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vincent
Snijders
Sent: Friday, December 15, 2006 4:38 PM
To: FPC developers' list
Subject: Re: [fpc-devel] help with softfloat for arm big endian
crosscompiler

[EMAIL PROTECTED] schreef:
 finally some of us would quite like to have a big endian system arround
 for testing on and as big endian systems go the slug is cheap!
 
 Well, for FPC developers (as well as others) I make accounts available to
 those interested via SSH.  I run PPC under Debian/Sparc on a Sun Ultra 5.

I might be interested for creating Lazarus and fpc snapshots (see 
http://wiki.lazarus.freepascal.org/Lazarus_Snapshots_Downloads), if 
there is actual demand for such snapshots. No need in creating files and 
maintaining build scripts, if nobody downloads them.

How people are using or testing fpc on  sparc-linux?

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

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


RE: [fpc-devel] help with softfloat for arm big endian crosscompiler

2006-12-15 Thread Robert Wolfe
Well as far as Lazarus snapshots go, well, I already started compiling Sparc
Linux snapshots of that as well -- will be doing Win32 ones as well and
making them available from my site if anyone would be interested.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vincent
Snijders
Sent: Friday, December 15, 2006 4:38 PM
To: FPC developers' list
Subject: Re: [fpc-devel] help with softfloat for arm big endian
crosscompiler

[EMAIL PROTECTED] schreef:
 finally some of us would quite like to have a big endian system arround
 for testing on and as big endian systems go the slug is cheap!
 
 Well, for FPC developers (as well as others) I make accounts available to
 those interested via SSH.  I run PPC under Debian/Sparc on a Sun Ultra 5.

I might be interested for creating Lazarus and fpc snapshots (see 
http://wiki.lazarus.freepascal.org/Lazarus_Snapshots_Downloads), if 
there is actual demand for such snapshots. No need in creating files and 
maintaining build scripts, if nobody downloads them.

How people are using or testing fpc on  sparc-linux?

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

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


[fpc-devel] fpc armeb nslu2 got a bit further with float probs on 2.0.5

2006-12-15 Thread Terry Kemp
I have flashed the slug to SlugOS (still big endian) and got gdb on it.
It appears that the issue is not so much the fpu or floating point but
with the FloatStr, StrToFloat etc conversions which seem to get stuck in
system.str.
I have tried to chase the system.str function but got lost in the {$i
} includes and header files :(
Any hints on how to debug this further?

Terry

here is the session...
[EMAIL PROTECTED]:/home/m50# gdb ./floattst


dlopen failed on 'libthread_db.so.1' - libthread_db.so.1: cannot open
shared object file: No such file or directory
GDB will not be able to debug pthreads.

GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for
details.
This GDB was configured as armeb-linux...
(gdb) start
Breakpoint 1 at 0x813c: file floattst.pp, line 16.
Starting program: /home/m50/floattst
main () at floattst.pp:16
16   b := 2.7;
(gdb) display a
1: A = 1.5
(gdb) display b
2: B = 0
(gdb) display c
3: C = 0
(gdb) display d
4: D = 0
(gdb) display s
5: S = (ANSISTRING) 0x0
(gdb) n
17   c := a * b;
5: S = (ANSISTRING) 0x0
4: D = 0
3: C = 0
2: B = 2.7005
1: A = 1.5
(gdb) n
18   Str(Single(c):0:3, s);
5: S = (ANSISTRING) 0x0
4: D = 0
3: C = 4.0519
2: B = 2.7005
1: A = 1.5
(gdb) n

* it goes full CPU usage here and hangs 

Program received signal SIGINT, Interrupt.
0xedac in SYSTEM_STR_REAL$LONGINT$LONGINT$DOUBLE$TREAL_TYPE
$OPENSTRING ()
5: S = (ANSISTRING) 0x0
4: D = 0
3: C = 4.0519
2: B = 2.7005
1: A = 1.5
(gdb) n
Single stepping until exit from function SYSTEM_STR_REAL$LONGINT$LONGINT
$DOUBLE$TREAL_TYPE$OPENSTRING,
which has no line number information.
n

Program received signal SIGINT, Interrupt.
0xede0 in SYSTEM_STR_REAL$LONGINT$LONGINT$DOUBLE$TREAL_TYPE
$OPENSTRING ()
5: S = (ANSISTRING) 0x0
4: D = 0
3: C = 4.0519
2: B = 2.7005
1: A = 1.5
(gdb) k
Kill the program being debugged? (y or n) y
(gdb) q



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


[fpc-devel] fpc 2.1.1 armeb nslu2

2006-12-15 Thread Terry Kemp
FYI
Can't get any program to run with this version.
programs segfault instantly...

Anyone know of a revision that works with arm? 
(I think I have 5590 but I dont know how to check)
Free Pascal Compiler version 2.1.1
Compiler Date  : 2006/12/14
Compiler CPU Target: arm


gdb session...

[EMAIL PROTECTED]:/home/m50# gdb ./floattst

This GDB was configured as armeb-linux...
(gdb) start
Breakpoint 1 at 0x812c: file floattst.pp, line 15.
Starting program: /home/m50/floattst

Program received signal SIGSEGV, Segmentation fault.
0x0001cc34 in fpc_ansistr_incr_ref ()
(gdb) n
Single stepping until exit from function fpc_ansistr_incr_ref,
which has no line number information.

Program exited normally.
(gdb) 

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


[fpc-devel] Lazarus Linkage Error

2006-12-15 Thread fpc
Trying to get Lazarus for Sparc built but when it comes to the time where
Lazarus is being linked, I get the following:

Free Pascal Compiler version 2.1.1 [2006/12/15] for sparc
Copyright (c) 1993-2006 by Florian Klaempfl
Target OS: Linux for SPARC
Compiling lazarus.pp
Assembling lazarus
Linking ../lazarus
/usr/bin/ld: cannot find -lgdk_pixbuf
lazarus.pp(114,42) Error: Error while linking
lazarus.pp(114,42) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[2]: *** [lazarus] Error 1
make[2]: Leaving directory `/home/robert/svn/lazarus/ide'
make[1]: *** [ide] Error 2
make[1]: Leaving directory `/home/robert/svn/lazarus/ide'
make: *** [ide] Error 2
[EMAIL PROTECTED]:~/svn/lazarus$

For some reason, it seems that everything else finds the gdk_pixbuf
library just fine.  Any suggestions would be greatly appreciated.

PS:  The binaries compile fine under Win32 and tonight's snapshot is on my
website for downloading for that architecture.

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