Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-08

SymbianOS port

29 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

I would like to start a SymbianOS port of the compiler.

What are the guidelines for the very early stages of a port?

I mean, should I wait until it´s reasonably working before inclusion on svn, or we could create a symbianos directory now, and add it´s targets to the makefiles? I think the second option would be easier for me to work with.

I would like to target both i386-symbian (the emulator) and arm-symbian.

Also, SymbianOS has many incompatible versions and User Interface models. There are 4 different SDKs for it. What would be a good way to select which SDK you wish to target? I think it would be rather ugly to add 4 directories for symbian os, and new sdks can be developed in the future. Perhaps some defines could be used? Like UIQ3, UIQ2, S60, etc

thanks,

Felipe Monteiro de Carvalho

Reply by email

Peter Vreman
to Felipe Monteiro de Carvalho
you wrote 10 lines
Hello, I would like to start a SymbianOS port of the compiler. What are the guidelines for the very early stages of a port? I mean, should I wait until it´s reasonably working before inclusion on svn, or we could create a symbianos directory now, and add it´s targets to the makefiles? I think the second option would be easier for me to work with.

1. Add symbian target to the compiler
2. Take the closest existing RTL as a start and start implementing it for Symbian

Show quoted text 8 lines
I would like to target both i386-symbian (the emulator) and arm-symbian. Also, SymbianOS has many incompatible versions and User Interface models. There are 4 different SDKs for it. What would be a good way to select which SDK you wish to target? I think it would be rather ugly to add 4 directories for symbian os, and new sdks can be developed in the future. Perhaps some defines could be used? Like UIQ3, UIQ2, S60, etc

User interface can be added in different units. The RTL only provides basic access and does not use it. That is then upto for example the LCL.

Peter

Reply by email

Felipe Monteiro de Carvalho
to Peter Vreman
Peter Vreman wrote
User interface can be added in different units. The RTL only provides basic access and does not use it. That is then upto for example the LCL.

They call it user interface, but according to my research it´s way beyond that. The most basic aspects are very different on each SDK, so we really need various RTLs.

Felipe Monteiro de Carvalho

Reply by email

Jonas Maebe
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
> 1. Add symbian target to the compiler How exactly do I add symbian target to the compiler? I mean, which files should I start altering?

compiler/system.pas, compiler/systems/i_symbian.pas, compiler/systems/ t_symbian.pas

In system.pas you mainly have to add an entry to the tsystem enum. You can use the other i_*/t_* files in the systems directory as example for the symbian files.

Jonas

Reply by email

Florian Klaempfl
to Jonas Maebe
Jonas Maebe wrote 15 lines
On 13 aug 2006, at 21:46, Felipe Monteiro de Carvalho wrote: >> 1. Add symbian target to the compiler > > How exactly do I add symbian target to the compiler? I mean, which > files should I start altering? compiler/system.pas, compiler/systems/i_symbian.pas, compiler/systems/t_symbian.pas In system.pas you mainly have to add an entry to the tsystem enum. You can use the other i_*/t_* files in the systems directory as example for the symbian files.

Maybe the results of this thread can be added to
http://www.freepascal.org/wiki/index.php/How_to_start or
http://www.freepascal.org/wiki/index.php/FPC_internals

Reply by email

Felipe Monteiro de Carvalho
to Jonas Maebe: compiler/system.pas, compiler/systems/i_symbian.pas, compiler/systems/ t_symbian.pas In…

Hi,

Sorry to revive such an old conversation, but this is a continuation of the old topic, and would be nice to keep things in one place.

To recapitulate, I am trying to build a cross-compiler from i386-win32 to i386-symbian, which is the symbian simulator.

The simulator runs executables on the same format as win32 pe, so it should be easy.

I already added the target to the files compiler/system.pas, compiler/systems/i_symbian.pas, compiler/systems/t_symbian.pas

Next I would like to build the cross-compiler using:

make OS_TARGET=symbian

But the makefile doesn´t support this target. It tells me to use fpcmake. So I look into makefile.fpc and I have no idea what to change to add symbian target.

What do I need to change to add symbian target to the makefiles??

thanks,

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to Marco van de Voort

Hi,

I can´t seam to get fpcmake to work. I did a svn update, and changed the following on fpcmmain.pp:

Index: fpcmmain.pp
=================================================================== --- fpcmmain.pp (revision 6038)
+++ fpcmmain.pp (working copy)
@@ -70,7 +70,7 @@
o_linux,o_go32v2,o_win32,o_os2,o_freebsd,o_beos,o_netbsd, o_amiga,o_atari, o_solaris, o_qnx, o_netware, o_openbsd,o_wdosx, o_palmos,o_macos,o_darwin,o_emx,o_watcom,o_morphos,o_netwlibc,
- o_win64,o_wince,o_gba,o_nds,o_embedded
+ o_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian

       );
       TTargetSet=array[tcpu,tos] of boolean;

@@ -88,14 +88,14 @@
'linux','go32v2','win32','os2','freebsd','beos','netbsd', 'amiga','atari','solaris', 'qnx', 'netware','openbsd','wdosx', 'palmos','macos','darwin','emx','watcom','morphos','netwlibc',
- 'win64','wince','gba','nds','embedded'
+ 'win64','wince','gba','nds','embedded','symbian'

       );

OSSuffix : array[TOS] of string=(
'_linux','_go32v2','_win32','_os2','_freebsd','_beos','_netbsd', '_amiga','_atari','_solaris', '_qnx', '_netware','_openbsd','_wdosx', '_palmos','_macos','_darwin','_emx','_watcom','_morphos','_netwlibc',
- '_win64','_wince','_gba','_nds','_embedded'
+ '_win64','_wince','_gba','_nds','_embedded','_symbian'

       );

{ This table is kept OS,Cpu because it is easier to maintain (PFV) } @@ -126,7 +126,8 @@
{ wince }( true, false, false, false, false, true, false), { gba } ( false, false, false, false, false, true, false), { nds } ( false, false, false, false, false, true, false),
- { embedded }( true, true, true, true, true, true, true)
+ { embedded }( true, true, true, true, true, true, true),
+ { symbian } ( true, false, false, false, false, true, false)

       );
     type

I also added symbian target to fpcmake.ini:

# Symbian OS
ifeq ($(OS_TARGET),symbian)
SHAREDLIBEXT=.dll
SHORTSUFFIX=symbian
endif

next I build fpcmake with fpc 2.0.4 and tryed to run it, but it crashes, and "make" command doesn´t seam to have included debug info.

C:\Programas\fpc21>fpcmake
An unhandled exception occurred at $0040C63C :
EAccessViolation :
$0040C63C
$0044DF0D
$00454DD6
$00410C46
$00401F28

Any ideas?

thanks,

Felipe Monteiro de Carvalho

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote
Hi, I can´t seam to get fpcmake to work. I did a svn update, and changed the following on fpcmmain.pp:

<snip>

Show quoted text 14 lines
next I build fpcmake with fpc 2.0.4 and tryed to run it, but it crashes, and "make" command doesn´t seam to have included debug info. C:\Programas\fpc21>fpcmake An unhandled exception occurred at $0040C63C : EAccessViolation : $0040C63C $0044DF0D $00454DD6 $00410C46 $00401F28 Any ideas?

Try compiling with debug info:

make OPT="-gl"

Vincent

Reply by email

Felipe Monteiro de Carvalho
to Florian Klaempfl
Florian Klaempfl wrote
Use fpc211 to build fpcmake 2.1.1

Yes, that was it! It´s working now =)

Althougth that´s a bit strange fpcmake didn´t work with 2.0.4. fpcmake should be a simple application

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to Felipe Monteiro de Carvalho

Ok, continuing, I tryed to compile fpc for symbian with:

make clean all OS_TARGET=symbian

using 2.0.4 as starting compiler.

I edited fpc/compiler/systems.pas, fpc/compiler/compiler.pas, fpc/compiler/i386/cputarg.pas and added i_symbian.pas and t_symbian.pas

And when I try to compile fpc for symbian I get an error:

pp.pas(146,1) Fatal: Can't find unit System
Fatal: Compilation aborted

I used -va option and I can see it doesn´t look for system.pp on fpc/rtl/symbian/ where my system unit is. So how can I make fpc understand that that directory is where it should look for my system unit?

thanks,

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to Felipe Monteiro de Carvalho

What are the official guidelines for adding new platforms on fpc trunk?

Should I wait until things are working or can I send partial patches?

I ask because I am working with another person, and if some basic things are added to official repository (like regenerated makefiles with symbian target), that would speed things up for us.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Florian Klaempfl
to Felipe Monteiro de Carvalho
What are the official guidelines for adding new platforms on fpc trunk? Should I wait until things are working or can I send partial patches?

You can either send partial patches if they don't affect the rest of the compiler or you can get a separate branch to work on it.

Show quoted text 6 lines
I ask because I am working with another person, and if some basic things are added to official repository (like regenerated makefiles with symbian target), that would speed things up for us. thanks,

Reply by email

Felipe Monteiro de Carvalho
to Florian Klaempfl
Florian Klaempfl wrote
You can either send partial patches if they don't affect the rest of the compiler or you can get a separate branch to work on it.

Ok, I prepared a very basic patch. It shouldn´t affect the rest of the compiler in any way.

Where should free pascal patches be sent? I am posting here in case the patch needs to be discussed.

There is a diff and 2 new files to be added to fpc/compiler/systems

It would be great if someone can recompile fpcmake and regenerate all makefiles =)

I didn´t add the rtl I am creating, because it will likely be modifyed a lot the next weeks.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to Florian Klaempfl

Hi,

I added an almost empty system.pp unit to fpc/rtl/symbian just to test, but the compiler isn´t yet search on this directory for the system unit.

I am using this command to use FPC 2.0.4 to compile a cross-compiler:

c:\Programas\fpc21> make clean all OS_TARGET=symbian OPT="-va"

Compilation will fail with:

pp.pas(146,1) Fatal: Can't find unit System
Fatal: Compilation aborted

And using -va I can see it isn´t searching fpc21/rtl/symbian

thanks,

Felipe Monteiro de Carvalho

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 16 lines
Hi, I added an almost empty system.pp unit to fpc/rtl/symbian just to test, but the compiler isn´t yet search on this directory for the system unit. I am using this command to use FPC 2.0.4 to compile a cross-compiler: c:\Programas\fpc21> make clean all OS_TARGET=symbian OPT="-va" Compilation will fail with: pp.pas(146,1) Fatal: Can't find unit System Fatal: Compilation aborted And using -va I can see it isn´t searching fpc21/rtl/symbian

I would start with make cycle.

cd c:\Programas\fpc21
make cycle OS_TARGET=symbian

Then I get this error:
D:/lazarus/source/fpc/2.1/compiler/ppcross386.exe -Tsymbian -XPi386-symbian- -Xc -Xr -Fui386 -Fusystems -Fu../rtl -Fii386 -FE. -FUi386/units/i386-symbian -di386 -dGDB -dBROWSERLOG -Fux86 pp.pas
pp.pas(146,1) Fatal: Can't find unit System

-Fu../rtl doesn't seem correct. As soon as you have a ../rtl/units/symbian directory, that one will be correct.

Another point, the rtl\symbian directory is still empty. But maybe you have more locally.

Vincent

Vincent

Reply by email

Florian Klaempfl
to Vincent Snijders
Show quoted text 34 lines
Felipe Monteiro de Carvalho schreef: > Hi, > > I added an almost empty system.pp unit to fpc/rtl/symbian just to > test, but the compiler isn´t yet search on this directory for the > system unit. > > I am using this command to use FPC 2.0.4 to compile a cross-compiler: > > c:\Programas\fpc21> make clean all OS_TARGET=symbian OPT="-va" > > Compilation will fail with: > > pp.pas(146,1) Fatal: Can't find unit System > Fatal: Compilation aborted > > And using -va I can see it isn´t searching fpc21/rtl/symbian I would start with make cycle. cd c:\Programas\fpc21 make cycle OS_TARGET=symbian Then I get this error: D:/lazarus/source/fpc/2.1/compiler/ppcross386.exe -Tsymbian -XPi386-symbian- -Xc -Xr -Fui386 -Fusystems -Fu../rtl -Fii386 -FE. -FUi386/units/i386-symbian -di386 -dGDB -dBROWSERLOG -Fux86 pp.pas pp.pas(146,1) Fatal: Can't find unit System -Fu../rtl doesn't seem correct. As soon as you have a ../rtl/units/symbian directory, that one will be correct. Another point, the rtl\symbian directory is still empty. But maybe you have more locally.

This is rather useless imo, even a cross cycle is far away for symbian. Something like
make arm
in the compiler dir and
make FPC=c:\fpc\compiler\ppcarm -XP$FPCTARGET-
in the rtl/symbian dir should be enough

Reply by email

Felipe Monteiro de Carvalho
to Florian Klaempfl

Hi,

Florian Klaempfl wrote 6 lines
This is rather useless imo, even a cross cycle is far away for symbian. Something like make arm in the compiler dir and make FPC=c:\fpc\compiler\ppcarm -XP$FPCTARGET- in the rtl/symbian dir should be enough

Actually I´m building for i386-symbian, which is the emulator.

I tryed make i386 on the compiler directory, and next:

C:\Programas\fpc21\rtl\symbian>make clean FPC=c:\Programas\fpc21\compiler\ppc386 .exe
make: Nothing to be done for `clean'.

Could you expain more about why my previous attempt (make clean all on fpc dir) was wrong?

The emulator for UIQ 3 uses normal win32 pe executables. I am trying to generate that using i386-symbian target.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Felipe Monteiro de Carvalho
to Felipe Monteiro de Carvalho: Actually I´m building for i386-symbian, which is the emulator. I tryed make i386 on the…
Felipe Monteiro de Carvalho wrote
C:\Programas\fpc21\rtl\symbian>make clean FPC=c:\Programas\fpc21\compiler\ppc386 .exe make: Nothing to be done for `clean'.

ops, it should be:

C:\Programas\fpc21\rtl\symbian>make FPC=c:\Programas\fpc21\compiler\ppc386.exe make: Nothing to be done for `default'.

Felipe Monteiro de Carvalho

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 13 lines
On 1/25/07, Felipe Monteiro de Carvalho wrote: > C:\Programas\fpc21\rtl\symbian>make clean > FPC=c:\Programas\fpc21\compiler\ppc386 > .exe > make: Nothing to be done for `clean'. ops, it should be: C:\Programas\fpc21\rtl\symbian>make FPC=c:\Programas\fpc21\compiler\ppc386.exe make: Nothing to be done for `default'.

That is right, no rtl units for Symbian have been written, so the Makefile doesn't contain them.

Start with the system unit I would say.

Vincent

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho: Actually I´m building for i386-symbian, which is the emulator. I tryed make i386 on the…
Felipe Monteiro de Carvalho wrote 21 lines
Hi, On 1/25/07, Florian Klaempfl wrote: > This is rather useless imo, even a cross cycle is far away for symbian. > Something like > make arm > in the compiler dir and > make FPC=c:\fpc\compiler\ppcarm -XP$FPCTARGET- > in the rtl/symbian dir should be enough Actually I´m building for i386-symbian, which is the emulator. I tryed make i386 on the compiler directory, and next: C:\Programas\fpc21\rtl\symbian>make clean FPC=c:\Programas\fpc21\compiler\ppc386 .exe make: Nothing to be done for `clean'. Could you expain more about why my previous attempt (make clean all on fpc dir) was wrong?

Not wrong, just overly complicated (or a too big step).

The emulator for UIQ 3 uses normal win32 pe executables. I am trying to generate that using i386-symbian target.

So you don't need a cross compiler, ppc386 can be used. You do need a symbian RTL.

Vincent

Reply by email

Felipe Monteiro de Carvalho
to Vincent Snijders: That is right, no rtl units for Symbian have been written, so the Makefile doesn't…
Vincent Snijders wrote
That is right, no rtl units for Symbian have been written, so the Makefile doesn't contain them. Start with the system unit I would say.

Yes, but I added my system unit, and used fpcmake to regenerate all makefiles on the rtl directory, also used it on the symbian directory, but it still doesn´t want to compile the symbian rtl ... also tryed to regenerate all makefiles on fpc directory.

I used "fpcmake -Tall", so I see it lists symbian as a target.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Vincent Snijders
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 13 lines
On 1/25/07, Vincent Snijders wrote: > That is right, no rtl units for Symbian have been written, so the > Makefile doesn't > contain them. > > Start with the system unit I would say. Yes, but I added my system unit, and used fpcmake to regenerate all makefiles on the rtl directory, also used it on the symbian directory, but it still doesn´t want to compile the symbian rtl ... also tryed to regenerate all makefiles on fpc directory. I used "fpcmake -Tall", so I see it lists symbian as a target.

But did you add your new system unit to the makefile in rtl\symbian?

Vincent

Reply by email

Felipe Monteiro de Carvalho
to Vincent Snijders
Vincent Snijders wrote
But did you add your new system unit to the makefile in rtl\symbian?

Ah, ok, that was the problem!

I didn´t know I had to alter the Makefile.fpc for each new unit.

thanks,

Felipe Monteiro de Carvalho

Reply by email