Re: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread Jonas Maebe


On 03 Jul 2007, at 23:45, [EMAIL PROTECTED] wrote:


Luca,

 could you check bug 9191?

 http://www.freepascal.org/mantis/view.php?id=9191

if I try to compile, the  linker complaints about not finding the  
object  dl, though dl.o and dl.ppu are present in the rtl/units/arm- 
linux  directory.


D:\FPC214\B1\BINUTI~3\arm-linux-ld.exe: cannot find -ldl  pippo.pas 
(47,6) Error: Error while linking

pippo.pas(47,6) Fatal: There were 1 errors compiling module,  stopping
Fatal: Compilation aborted


The -ldl refers to libdl.so, not to dl.o. You have to copy it from  
your ARM system to your Windows machine, and add the directory with  
all your ARM libraries to the linker's search path, like Luca did:

-Fl/usr/lib/gcc/arm-linux-gnu/4.1.2

(or wherever the libraries are located on your system)


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


Re: [fpc-pascal] Need to declare FindIntToIdent in Classesh.inc

2007-07-04 Thread Michael Van Canneyt


On Tue, 3 Jul 2007, zaher dirkey wrote:

 IdentToInt use Map array (Map: array of TIdentMapEntry) not IntConstList
 with TIdentToInt registered functions
 And i emulating writing property values like as procedure
 TWriter.WriteProperty in writer.inc.

It's done, revision 7943.

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


RE: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread josepascual
 
  soft float just means that the compiler needs to emulate the floating
  point unit if it doesn't exist in your hardware (like some arm
  processors).  if you have an fpu, then you don't have to worry about
  soft float.  the following assumes that you need soft float in you
  compiler.
 
 If this program compiles and works fine:
 program floattest;
 
 uses sysutils;
 var a,b:double;
 
 begin
 a:=0.5;
 b:=0.3;
 writeln(format('%5.3f',[a*b]));
 
 end.
 
 
 
 can I assume that either my compiler has been built with the right
 options or I have a working fpu?
 I'm asking because jose original test program fails here, while the
 above program correctly prints out 0.150

I have a ARM920T (without fpu, kernel OABI)

I have (always in linux) a fpcrossarm compiler version 2.1.4 and one 2.3.1
(I don't know release).

I can compile with 2.1.4 with and without softfloat but 2.3.1 only without
softfloat.

I have compiled floattest with :

a) ppcrossarm 2.1.4 without CfSOFT -- result 0.150
b) ppcrossarm 2.1.4 with CfSOFT -- result 0.000 
c) ppcrossarm 2.3.1 without CfSOFT -- result 0.150

but I can run datetostr_test without error.





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


RE: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread josepascual
  I have downloaded svn version 7943 how can I donwload svn 7929?
 
  How are you build fpc for arm? make clean crossall CPU_TARGET=arm
  OS_TARGET=linux ?
  Which version of binutils do you have? (eabi?)
  Is SOFTFLOAT in freepascal the equivalent to EABI in c?
 
 
 soft float just means that the compiler needs to emulate the floating
 point unit if it doesn't exist in your hardware (like some arm
 processors).  if you have an fpu, then you don't have to worry about
 soft float.  the following assumes that you need soft float in you
 compiler.
 
 passing OPT='-CfSOFT' doesn't work anymore, so you have to edit your
 Makefile.fpc and look for the line BUILDOPTS=...  add your extra
 options there (i usually add OPT='-gl -CfSOFT').  then you will have
 to go fpcmake -rTall.
 
 then you can do make clean crossall with the usual suspects passed to
 it, like CPU_TARGET, OS_TARGET, BINUTILSPREFIX, etc).
 
 use the binutils that came with your device, or use something that
 someone else used successfully.
 
 make crossinstall still fails towards the end, but that's o.k.  your
 cross compiler will be there and ready to use.
 
 sorry if i'm making any mistakes here, it's off the top of my head.  i
 haven't got my build machine here...
 

Hi henry et all,

I have a little confused, Could you or someone help me with some question?

I have a ARM920T (without fpu, kernel OABI) . 
Which version of gcc are you using 3.4.1? 4.1.2?
Which libc version? (2.3.2 2.3.6)
Is your gcc for EABI?
Have you used same crosstools to generate fpc 2.3.1 libraries and to
compiling your final freepascal programs?
Can I Use a FPC for ARM (cross or not) with softfloat option for arm kernel
EABI and not EABI (OABI)?
What Freepascal only use from ARM binutils? (as, ld, ar, ranlib, ... Whats
()? (gcc is not necesary,  is it?)



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


RE: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread josepascual
Hi everyone

I have compile datetostr_test with -g and I have run program with GDB

this is the error output in gdb

Starting program: /tmp/datestrto_test

Program received signal SIGSEGV, Segmentation fault.
0xbcc8 in fpc_ansistr_decr_ref ()


It seems the problem is not exactly in datetimetostr but the string system.

Any opinion or suggestion?




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


Re: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread Bernd Mueller

Jonas Maebe wrote:
The -ldl refers to libdl.so, not to dl.o. You have to copy it from your 
ARM system to your Windows machine, and add the directory with all your 
ARM libraries to the linker's search path, like Luca did:

-Fl/usr/lib/gcc/arm-linux-gnu/4.1.2


thank you Jonas, that was helpful. I finally was able to compile the 
file, but I think there is still a problem with the libraries. The 
program does not run as expected.


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


RE: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread josepascual
  If this program compiles and works fine:
  program floattest;
 
  uses sysutils;
  var a,b:double;
 
  begin
  a:=0.5;
  b:=0.3;
  writeln(format('%5.3f',[a*b]));
 
  end.
 
 
 
  can I assume that either my compiler has been built with the right
  options or I have a working fpu?
 
 yes.
 
  I'm asking because jose original test program fails here, while the
  above program correctly prints out 0.150
 
 does the above work if you set a or be to a negative number?  my
 softfloat crashes with writeln(negative number).

negative number problem is not in float operation but in format or strings
subsystem.

try this new example:

program floattest;

uses sysutils;
var a,b,c,d,e:double;

begin
a:=0.5;
b:=0.3;
writeln(format('%5.3f',[a*b]));
a:=-0.5;
c:=a*b;
d:=a*c;
writeln(format('%5.3f',[d]));
if (c  0) then
begin
//  e := abs(c); seems not to work! please remove // and try it
  e := -1*c; // remove or comment if you use abs in above line
  writeln('-'+format('%5.3f',[e]));
end;
end.

perhaps, I think now, part of problem can be in something relative abs or
used by abs.

comment your results,

regards

Jose Pascual


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


Re: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread Henry Vermaak

On 04/07/07, josepascual [EMAIL PROTECTED] wrote:


negative number problem is not in float operation but in format or strings
subsystem.

try this new example:

program floattest;

uses sysutils;
var a,b,c,d,e:double;

begin
a:=0.5;
b:=0.3;
writeln(format('%5.3f',[a*b]));
a:=-0.5;
c:=a*b;
d:=a*c;
writeln(format('%5.3f',[d]));
if (c  0) then
begin
//  e := abs(c); seems not to work! please remove // and try it
  e := -1*c; // remove or comment if you use abs in above line
  writeln('-'+format('%5.3f',[e]));
end;
end.

perhaps, I think now, part of problem can be in something relative abs or
used by abs.

comment your results,



i've reported this a while ago.  i added a back trace the other day:

http://www.freepascal.org/mantis/view.php?id=8737


regards

Jose Pascual



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


Re: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread Bernd Mueller

Luca Olivetti wrote:

En/na [EMAIL PROTECTED] ha escrit:

Luca,

  could you check bug 9191?
 
  http://www.freepascal.org/mantis/view.php?id=9191

if I try to compile, the linker complaints about not finding the 
object dl, though dl.o and dl.ppu are present in the 
rtl/units/arm-linux directory.


D:\FPC214\B1\BINUTI~3\arm-linux-ld.exe: cannot find -ldl 
pippo.pas(47,6) Error: Error while linking

pippo.pas(47,6) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

How do you call the compiler? And please show me your fpc.cfg file.


I do simply an fpc pippo.pas (or fpc pippo2.pas), I'm running it 
directly on the arm, I'm not cross-compiling (that's why I asked you, I 
wanted to see if cross-compiling makes a difference). My fpc.cfg is what 
the installer for 2.1.3 generated, manually amended for 2.1.4 (consider 
that fpc is installed under /home/luca/fpc-2.1.4). It's attached.


I finally got your program crosscompiled on my windows machine. But if I 
start it on the linux target, I get the output not found. I think, I 
made something wrong, when I tried to resolve the library .so symlinks. 
Another problem was, that my ARM Linux uses uClibc and not libc, so the 
linker complaint about some missing references in cprt0. I made changes 
in cprt0.as and recompiled the rtl.


I need more time (and experience) to track this problem down.

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


[fpc-pascal] Problem with softfloat in fpc for ARM using negative number

2007-07-04 Thread josepascual
Hi

When I run next floattest program 

program floattest;

uses sysutils;
var a,b,c:double;

begin
a:=0.5;
b:=0.3;
writeln(format('%5.3f',[a*b]));
a:=-0.5;
c:=a*b;
writeln(format('%5.3f',[c]));
end.

I received this output:
= output =
0.150
An unhandled exception occurred at $D550 :
EOverflow : Floating point overflow
  $D550  FLOAT_RAISE,  line 111 of /opt/fpc/svn/fpc/rtl/inc/genmath.inc
  $B728  float64_mul,  line 4389 of /opt/fpc/svn/fpc/rtl/inc/softfpu.pp
  $E590  STR_REAL,  line 361 of /opt/fpc/svn/fpc/rtl/inc/real2str.inc
  $00010EB0  fpc_ansistr_float,  line 891 of
/opt/fpc/svn/fpc/rtl/inc/astrings.inc
  $0001B89C  FLOATTOSTRFINTL,  line 1249 of
/opt/fpc/svn/fpc/rtl/objpas/sysutils/sysstr.inc
  $0001C4A4  FLOATTOSTRF,  line 1505 of
/opt/fpc/svn/fpc/rtl/objpas/sysutils/sysstr.inc
  $0001A078  FORMAT,  line 250 of
/opt/fpc/svn/fpc/rtl/objpas/sysutils/sysformt.inc
  $0001B030  FORMAT,  line 895 of
/opt/fpc/svn/fpc/rtl/objpas/sysutils/sysstr.inc
  $81E8  main,  line 13 of floattest.pas
= output =

if I change from double to single I obtain the same output, Is single
implemented as double?

Jose Pascual

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


Re: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread Luca Olivetti

En/na Bernd Mueller ha escrit:

thank you Jonas, that was helpful. I finally was able to compile the 
file, but I think there is still a problem with the libraries. The 
program does not run as expected.


not expected as in the bug report or something completely different?

Bye
--
Luca

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


[fpc-pascal] In EABI ARM rootdisk dynamic linker is not named ld-linux.so.2

2007-07-04 Thread josepascual
Hi developer of freepascal (for arm) et all

I have tried a freepascal program for arm EABI. I have created a ppcrossarm
with SOFTFLOAT with binutils for EABI.
Freepascal program compiled okey but When I run it in ARM board (with
rootdisk EABI) I received a FILE NOT FOUND

It was due that ld-linux.so is not ld-linux.so.2 but ld-linux.so.3 (in order
to allow libraries for OABI and EABI in the 
same rootdisk at the same time).

problem can be resolved with a symbolic link or patching in
./compiler/systems/t_linux.pas

Simbolic link breaks possibility to allow libraries for OABI and EABI where
place 
in same rootdisk running OABI program and EABI program at the same time.

What is your opinion? (I'm very novice in EABI world so it's really possible
I'm wrong)
how does program detect to use dynamic linker ld-linux.so.2 or
ld-linux.so.3?
Should it be possible detect if fpc compiler has built with eabi toolschain
or are using eabi toolchain to generate
compiled programs?

best regards

Jose Pascual

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


Re: [fpc-pascal] In EABI ARM rootdisk dynamic linker is not named ld-linux.so.2

2007-07-04 Thread Daniël Mantione


Op Wed, 4 Jul 2007, schreef josepascual:

 Hi developer of freepascal (for arm) et all
 
 I have tried a freepascal program for arm EABI. I have created a ppcrossarm
 with SOFTFLOAT with binutils for EABI.
 Freepascal program compiled okey but When I run it in ARM board (with
 rootdisk EABI) I received a FILE NOT FOUND
 
 It was due that ld-linux.so is not ld-linux.so.2 but ld-linux.so.3 (in order
 to allow libraries for OABI and EABI in the 
 same rootdisk at the same time).
 
 problem can be resolved with a symbolic link or patching in
 ./compiler/systems/t_linux.pas
 
 Simbolic link breaks possibility to allow libraries for OABI and EABI where
 place 
 in same rootdisk running OABI program and EABI program at the same time.
 
 What is your opinion? (I'm very novice in EABI world so it's really possible
 I'm wrong)
 how does program detect to use dynamic linker ld-linux.so.2 or
 ld-linux.so.3?
 Should it be possible detect if fpc compiler has built with eabi toolschain
 or are using eabi toolchain to generate
 compiled programs?

The dynamic loader the compiler depends on the libc you use. What libc do 
you use?

Daniël___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] DateToStr in arm does not work!

2007-07-04 Thread mueller . b
On 4 Jul 2007, at 19:42, Luca Olivetti wrote:

 En/na Bernd Mueller ha escrit:
 
  thank you Jonas, that was helpful. I finally was able to compile the 
  file, but I think there is still a problem with the libraries. The 
  program does not run as expected.
 
 not expected as in the bug report or something completely different?
 
completely different. The program seems to start and terminates 
then with the output not found. As if the shell could not find the 
program. I need to install gdb on the target, to get more 
information. 

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


[fpc-pascal] Arm EABI vs OABI [was:DateToStr in arm does not work!]

2007-07-04 Thread Luca Olivetti

En/na Henry Vermaak ha escrit:


i urge you to read this:

http://wiki.debian.org/ArmEabiPort
http://www.codesourcery.com/gnu_toolchains/arm/faq.html

i haven't completely read it (hence i can't answer your questions that
well, sorry).


I'm wondering if my strange problems are due to a badly built compiler 
and/or rtl.
I know for sure that my kernel (that I cannot upgrade at the moment) 
supports OABI and has EABI badly patched in (i.e, it doesn't work 100%), 
everything else should be OABI (debian arm, not armel).
To build 2.1.4 I used a binary snapshot of 2.1.3 
(ftp://ftp.freepascal.org/pub/fpc/beta/2.1.2/arm-linux/) and did not 
specify any special option while building, so, what convention is my 
compiler/rtl using? Is it possible that it's generating EABI and hitting 
sometimes the special cases that don't work in my kernel? In that case, 
how should I rebuild it in order to generate OABI code?


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