Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-22 Thread Florian Klaempfl
Marc Weustink schrieb:
> Luca Olivetti wrote:
>> En/na Marc Weustink ha escrit:
>>
>>>  From this I assume syscalls in this case are correct and I guess
>>> there is some difference between syscall calling and library calling.
>>
>> Maybe openmoko as an eabi kernel compiled with oabi compatibility?
>> (otherwise I think old style syscalls wouldn't work).
>> And, I don't know if there are differences in library calling, but
>> sure there are differences in structure alignment (especially if there
>> are enums in the structures).
> 
> 
> Yes, I know. But how can I tell the compiler that for syscalls oabi
> alignment should be used and for libraries eabi ?
> (assuming that is crashes on wrong alignment and that there is indeed
> such difference)

You shouldn't. We simply need to fix -dFPC_ARMEL.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-22 Thread Marc Weustink

Luca Olivetti wrote:

En/na Marc Weustink ha escrit:

 From this I assume syscalls in this case are correct and I guess 
there is some difference between syscall calling and library calling.


Maybe openmoko as an eabi kernel compiled with oabi compatibility? 
(otherwise I think old style syscalls wouldn't work).
And, I don't know if there are differences in library calling, but sure 
there are differences in structure alignment (especially if there are 
enums in the structures).



Yes, I know. But how can I tell the compiler that for syscalls oabi 
alignment should be used and for libraries eabi ?
(assuming that is crashes on wrong alignment and that there is indeed 
such difference)



Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-22 Thread Marc Weustink

Florian Klaempfl wrote:

Marc Weustink schrieb:

Marc Weustink wrote:

Florian Klaempfl wrote:

Luca Olivetti schrieb:

En/na Florian Klaempfl ha escrit:


It should be enough to build FPC with OPT=-dFPC_ARMEL

So it's now possible to produce eabi code with fpc?

Well, I did initial support. If you provide bugs reports, I'll try to
fix them.

hmm... current openmoko versions are eabi, but when I run a testapp
build by such fpc I get:

Program received signal SIGILL, Illegal instruction.
0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
(gdb) bt
#0  0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
#1  0x00012e1c in SYSTEM_FPGETRLIMIT$LONGINT$PRLIMIT$$LONGINT ()
#2  0x0001eef8 in SYSTEM_CHECKINITIALSTKLEN$LONGWORD$$LONGWORD ()
#3  0x0001efbc in SYSTEM_init ()
#4  0x0001a7ec in fpc_initializeunits ()
#5  0xe668 in main () at gtk2query.pp:263

I tried something more. I compiled FPC without FPC_ARMEL, but tweaked
init_settings.fputype:=fpu_soft in globals.pas so it would use soft fpu.

Now my testapp crashes on the first librarycall (how surprising), but
passes the fpc_initializeunits (and manages to do some writeln).
From this I assume syscalls in this case are correct and I guess there
is some difference between syscall calling and library calling.


As Luca suspected, this is the wrong way :) You've a kernel with old
syscall support. You should find out why it crashes with -dFPC_ARMEL.


I did this test only to see if there is a difference between calling 
conventions used for libraries and for syscalls.

It was not an attempt to get this path to working.

Assuming that there is a difference on purpose (need to sort that out), 
I tried to build a version with FPC_USE_LIBC to eliminate syscalls.
After 2 patches, I got a RTL build with it, but it somehow fails to 
allocate mem. (fmmap returns -1)

Also that needs to be investigated (it was way beyond my bedtime)

Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-22 Thread Florian Klaempfl
Marc Weustink schrieb:
> Marc Weustink wrote:
>> Florian Klaempfl wrote:
>>> Luca Olivetti schrieb:
 En/na Florian Klaempfl ha escrit:

> It should be enough to build FPC with OPT=-dFPC_ARMEL
 So it's now possible to produce eabi code with fpc?
>>>
>>> Well, I did initial support. If you provide bugs reports, I'll try to
>>> fix them.
>>
>> hmm... current openmoko versions are eabi, but when I run a testapp
>> build by such fpc I get:
>>
>> Program received signal SIGILL, Illegal instruction.
>> 0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
>> (gdb) bt
>> #0  0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
>> #1  0x00012e1c in SYSTEM_FPGETRLIMIT$LONGINT$PRLIMIT$$LONGINT ()
>> #2  0x0001eef8 in SYSTEM_CHECKINITIALSTKLEN$LONGWORD$$LONGWORD ()
>> #3  0x0001efbc in SYSTEM_init ()
>> #4  0x0001a7ec in fpc_initializeunits ()
>> #5  0xe668 in main () at gtk2query.pp:263
> 
> I tried something more. I compiled FPC without FPC_ARMEL, but tweaked
> init_settings.fputype:=fpu_soft in globals.pas so it would use soft fpu.
> 
> Now my testapp crashes on the first librarycall (how surprising), but
> passes the fpc_initializeunits (and manages to do some writeln).
> From this I assume syscalls in this case are correct and I guess there
> is some difference between syscall calling and library calling.

As Luca suspected, this is the wrong way :) You've a kernel with old
syscall support. You should find out why it crashes with -dFPC_ARMEL.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-22 Thread Luca Olivetti

En/na Marc Weustink ha escrit:

 From this I assume syscalls in this case are correct and I guess there 
is some difference between syscall calling and library calling.


Maybe openmoko as an eabi kernel compiled with oabi compatibility? 
(otherwise I think old style syscalls wouldn't work).
And, I don't know if there are differences in library calling, but sure 
there are differences in structure alignment (especially if there are 
enums in the structures).


Bye
--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004  Fax +34 93 5883007

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-21 Thread Marc Weustink

Marc Weustink wrote:

Florian Klaempfl wrote:

Luca Olivetti schrieb:

En/na Florian Klaempfl ha escrit:


It should be enough to build FPC with OPT=-dFPC_ARMEL

So it's now possible to produce eabi code with fpc?


Well, I did initial support. If you provide bugs reports, I'll try to
fix them.


hmm... current openmoko versions are eabi, but when I run a testapp 
build by such fpc I get:


Program received signal SIGILL, Illegal instruction.
0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
(gdb) bt
#0  0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
#1  0x00012e1c in SYSTEM_FPGETRLIMIT$LONGINT$PRLIMIT$$LONGINT ()
#2  0x0001eef8 in SYSTEM_CHECKINITIALSTKLEN$LONGWORD$$LONGWORD ()
#3  0x0001efbc in SYSTEM_init ()
#4  0x0001a7ec in fpc_initializeunits ()
#5  0xe668 in main () at gtk2query.pp:263


I tried something more. I compiled FPC without FPC_ARMEL, but tweaked 
init_settings.fputype:=fpu_soft in globals.pas so it would use soft fpu.


Now my testapp crashes on the first librarycall (how surprising), but 
passes the fpc_initializeunits (and manages to do some writeln).
From this I assume syscalls in this case are correct and I guess there 
is some difference between syscall calling and library calling.


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-21 Thread Marc Weustink

Florian Klaempfl wrote:

Luca Olivetti schrieb:

En/na Florian Klaempfl ha escrit:


It should be enough to build FPC with OPT=-dFPC_ARMEL

So it's now possible to produce eabi code with fpc?


Well, I did initial support. If you provide bugs reports, I'll try to
fix them.


hmm... current openmoko versions are eabi, but when I run a testapp 
build by such fpc I get:


Program received signal SIGILL, Illegal instruction.
0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
(gdb) bt
#0  0x000129d0 in SYSTEM_FPSYSCALL$LONGINT$$LONGINT ()
#1  0x00012e1c in SYSTEM_FPGETRLIMIT$LONGINT$PRLIMIT$$LONGINT ()
#2  0x0001eef8 in SYSTEM_CHECKINITIALSTKLEN$LONGWORD$$LONGWORD ()
#3  0x0001efbc in SYSTEM_init ()
#4  0x0001a7ec in fpc_initializeunits ()
#5  0xe668 in main () at gtk2query.pp:263


Marc


_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-21 Thread ik
Thank you for the information :)

Ido

On Jan 20, 2008 10:12 PM, Luca Olivetti <[EMAIL PROTECTED]> wrote:
> En/na ik ha escrit:
> > For someone that does not know arm cpus, what are oabi and eabi ?
>
> oabi (I don't think that's the proper definition, anyway "o" stands for
> "old") is the previous arm binary interface.
> eabi is the new one.
> The linux kernel can be compiled with support for one, the other, or
> both (since one of the differences is in the syscall convention)
>
>  From http://wiki.debian.org/ArmEabiPort
>
> "In a nutshell
>
> EABI is the new "Embedded" ABI by ARM ltd. EABI is actually a family of
> ABI's and one of the "subABIs" is GNU EABI, for Linux. The effective
> changes for users are:
>
>  *
>
>Floating point performance, with or without an FPU is very much
> faster, and mixing soft and hardfloat code is possible
>  * Structure packing is not as painful as it used to be
>  * More compatibility with various tools (in future - currently
> linux-elf is well supported)
>  *
>
>A more efficient syscall convention
>  * At present (with gcc-4.1.1) it works with ARMv4t, ARMv5t
> processors and above, but supporting ARMv4 (e.g., StrongARM) requires
> modification to GCC. See "Thumb interworking" below."
>
> Bye
> --
> Luca
>
>
> _
>  To unsubscribe: mail [EMAIL PROTECTED] with
> "unsubscribe" as the Subject
>archives at http://www.lazarus.freepascal.org/mailarchives
>



-- 
http://ik.homelinux.org/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-20 Thread Florian Klaempfl
Luca Olivetti schrieb:
> En/na Florian Klaempfl ha escrit:
> 
>>
>> It should be enough to build FPC with OPT=-dFPC_ARMEL
> 
> So it's now possible to produce eabi code with fpc?

Well, I did initial support. If you provide bugs reports, I'll try to
fix them.

> Great!
> (not that I grasp the full implications of oabi vs. eabi, but I'd like
> to make some experiment with my n800, which is an eabi system).
> 
> Bye

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-20 Thread Luca Olivetti

En/na ik ha escrit:

For someone that does not know arm cpus, what are oabi and eabi ?


oabi (I don't think that's the proper definition, anyway "o" stands for 
"old") is the previous arm binary interface.

eabi is the new one.
The linux kernel can be compiled with support for one, the other, or 
both (since one of the differences is in the syscall convention)


From http://wiki.debian.org/ArmEabiPort

"In a nutshell

EABI is the new "Embedded" ABI by ARM ltd. EABI is actually a family of 
ABI's and one of the "subABIs" is GNU EABI, for Linux. The effective 
changes for users are:


*

  Floating point performance, with or without an FPU is very much 
faster, and mixing soft and hardfloat code is possible

* Structure packing is not as painful as it used to be
* More compatibility with various tools (in future - currently 
linux-elf is well supported)

*

  A more efficient syscall convention
* At present (with gcc-4.1.1) it works with ARMv4t, ARMv5t 
processors and above, but supporting ARMv4 (e.g., StrongARM) requires 
modification to GCC. See "Thumb interworking" below."


Bye
--
Luca

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-20 Thread ik
For someone that does not know arm cpus, what are oabi and eabi ?

Thanks,
Ido

On Jan 20, 2008 9:21 PM, Luca Olivetti <[EMAIL PROTECTED]> wrote:
> En/na Florian Klaempfl ha escrit:
>
> >
> > It should be enough to build FPC with OPT=-dFPC_ARMEL
>
> So it's now possible to produce eabi code with fpc?
> Great!
> (not that I grasp the full implications of oabi vs. eabi, but I'd like
> to make some experiment with my n800, which is an eabi system).
>
> Bye
> --
> Luca Olivetti
> Wetron Automatización S.A. http://www.wetron.es/
> Tel. +34 93 5883004  Fax +34 93 5883007
>
>
> _
>  To unsubscribe: mail [EMAIL PROTECTED] with
> "unsubscribe" as the Subject
>archives at http://www.lazarus.freepascal.org/mailarchives
>



-- 
http://ik.homelinux.org/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-20 Thread Luca Olivetti

En/na Florian Klaempfl ha escrit:



It should be enough to build FPC with OPT=-dFPC_ARMEL


So it's now possible to produce eabi code with fpc?
Great!
(not that I grasp the full implications of oabi vs. eabi, but I'd like 
to make some experiment with my n800, which is an eabi system).


Bye
--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004  Fax +34 93 5883007

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-20 Thread Florian Klaempfl
Marc Weustink schrieb:
> Marc Weustink wrote:
>> ik wrote:
>>> Hi,
>>>
>>> While google suggest rewards for developing applications for Android,
>>> there is an open source firmware named OpenMoko
>>> (http://openmoko.org/).
>>> I asked Michael Shiloh what are some of the requirement in building
>>> apps in different compilers (FPC to be exact, and I also mentioned
>>> Lazarus :)). Well "all" that is required is to bind ourself to the C
>>> libraries.
>>>
>>> I wonder what does it mean (other then binding) to make FPC and
>>> Lazarus to support such environment.
>>
>> I've been playing with that thought also (I've been following that
>> project for a while now). It supports X and gtk so that part should
>> work and AFAIK it runs some arm-linux so imo fpc could genererste some
>> exe.
>> Since there wasn't an (easy) emulator environment, I stopped thinging
>> about it and didn't test.
> 
> OK, thinks have inmroved and you now can run a qemu emulator :)
> 
> I did some tests.
> First, just using the gnu-arm-linux binutils, I compiled a arm-linux
> trunk fpc and compiled a test (RTTIdump) console app. It runs fine on
> the emulated moko.
> 
> Second I tried one of my simple test gtk2 apps. It compiles, but failed
> to link since the gnu-arm-linux binutils don't understand the format
> used for the X, gdk, gtk libs.
> 
> I should have done some more initial reading, since openmoko brings its
> own binutils. After installing the openmoko toolchain I tried and
> linking my testapp failed again. Now ld was complaining that the .o
> files of the rtl had a wrong eabi version.
> Sure, true, indeed, I forgot to recompile fpc.
> And that ends in:
> /net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:
> Assembler messages:
> /net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:15225:
> Error: selected processor does not support `rfs r0'
> /net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:15228:
> Error: selected processor does not support `wfs r0'
> /net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:19155:
> Error: selected processor does not support `stfd f0,[r13]'
> 
> 
> It seems that the used arm core has no floatingpoint unit.
> 
> Does fpc support softfloat ? (if yes, how to use ?)

It should be enough to build FPC with OPT=-dFPC_ARMEL

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-20 Thread Marc Weustink

Marc Weustink wrote:

ik wrote:

Hi,

While google suggest rewards for developing applications for Android,
there is an open source firmware named OpenMoko
(http://openmoko.org/).
I asked Michael Shiloh what are some of the requirement in building
apps in different compilers (FPC to be exact, and I also mentioned
Lazarus :)). Well "all" that is required is to bind ourself to the C
libraries.

I wonder what does it mean (other then binding) to make FPC and
Lazarus to support such environment.


I've been playing with that thought also (I've been following that 
project for a while now). It supports X and gtk so that part should work 
and AFAIK it runs some arm-linux so imo fpc could genererste some exe.
Since there wasn't an (easy) emulator environment, I stopped thinging 
about it and didn't test.


OK, thinks have inmroved and you now can run a qemu emulator :)

I did some tests.
First, just using the gnu-arm-linux binutils, I compiled a arm-linux 
trunk fpc and compiled a test (RTTIdump) console app. It runs fine on 
the emulated moko.


Second I tried one of my simple test gtk2 apps. It compiles, but failed 
to link since the gnu-arm-linux binutils don't understand the format 
used for the X, gdk, gtk libs.


I should have done some more initial reading, since openmoko brings its 
own binutils. After installing the openmoko toolchain I tried and
linking my testapp failed again. Now ld was complaining that the .o 
files of the rtl had a wrong eabi version.

Sure, true, indeed, I forgot to recompile fpc.
And that ends in:
/net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s: 
Assembler messages:
/net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:15225: 
Error: selected processor does not support `rfs r0'
/net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:15228: 
Error: selected processor does not support `wfs r0'
/net/thunder/mnt/mirror1/src/fpc/trunk/rtl/units/arm-linux/system.s:19155: 
Error: selected processor does not support `stfd f0,[r13]'



It seems that the used arm core has no floatingpoint unit.

Does fpc support softfloat ? (if yes, how to use ?)

Marc




_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] OpenMoko and FPC/Lazarus

2008-01-16 Thread Marc Weustink

ik wrote:

Hi,

While google suggest rewards for developing applications for Android,
there is an open source firmware named OpenMoko
(http://openmoko.org/).
I asked Michael Shiloh what are some of the requirement in building
apps in different compilers (FPC to be exact, and I also mentioned
Lazarus :)). Well "all" that is required is to bind ourself to the C
libraries.

I wonder what does it mean (other then binding) to make FPC and
Lazarus to support such environment.


I've been playing with that thought also (I've been following that 
project for a while now). It supports X and gtk so that part should work 
and AFAIK it runs some arm-linux so imo fpc could genererste some exe.
Since there wasn't an (easy) emulator environment, I stopped thinging 
about it and didn't test.


Marc

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] OpenMoko and FPC/Lazarus

2008-01-16 Thread ik
Hi,

While google suggest rewards for developing applications for Android,
there is an open source firmware named OpenMoko
(http://openmoko.org/).
I asked Michael Shiloh what are some of the requirement in building
apps in different compilers (FPC to be exact, and I also mentioned
Lazarus :)). Well "all" that is required is to bind ourself to the C
libraries.

I wonder what does it mean (other then binding) to make FPC and
Lazarus to support such environment.

Ido
-- 
http://ik.homelinux.org/

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives