Sign in Join

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

Mailing lists / fpc-devel / 2005-01

Freepascal on SPARC, MIPS(EL) and ARM GNU/Linux hosts

15 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Sunil Amitkumar Janki

I want to know how to build Freepascal so it runs on SPARC, MIPS(EL) and ARM GNU/Linux. For the latter two I will probably first have to cross-build to these architectures if possible but I don't know how to do this yet.

This is the error I get when I build FPC 2.2.0 on SPARC using FPC 2.0.0:

Show quoted text 23 lines
/opt/programming/pascal/freepascal/applications/compilers/2/2.0/2.0.0/bin/ppcsparc -Ur -Ur -Xs -n -Xs -Fi../inc -Fi../sparc -Fi../unix -Fisparc -FE. -FU/tmp/fpc-2.2.0/rtl/units/sparc-linux -dsparc -dRELEASE ../objpas/rtlconsts.pp /opt/programming/pascal/freepascal/applications/compilers/2/2.0/2.0.0/bin/ppcsparc -Ur -Ur -Xs -n -Xs -Fi../inc -Fi../sparc -Fi../unix -Fisparc -FE. -FU/tmp/fpc-2.2.0/rtl/units/sparc-linux -dsparc -dRELEASE -Sg ../objpas/typinfo.pp /opt/programming/pascal/freepascal/applications/compilers/2/2.0/2.0.0/bin/ppcsparc -Ur -Ur -Xs -n -Xs -Fi../inc -Fi../sparc -Fi../unix -Fisparc -FE. -FU/tmp/fpc-2.2.0/rtl/units/sparc-linux -dsparc -dRELEASE ../objpas/math.pp math.pp(2185,10) Error: Calling convention doesn't match forward math.pp(2190,10) Error: Calling convention doesn't match forward math.pp(2195,10) Error: Calling convention doesn't match forward math.pp(2207,10) Error: Calling convention doesn't match forward math.pp(2218,10) Error: Calling convention doesn't match forward math.pp(2229,10) Error: Calling convention doesn't match forward math.pp(2241,10) Error: Calling convention doesn't match forward math.pp(2253,10) Error: Calling convention doesn't match forward math.pp(2349) Fatal: There were 8 errors compiling module, stopping math.pp(2349) Error: Compilation aborted make[7]: *** [math.ppu] Error 1

I don't know if ARM and MIPS host support do in fact exist at all but if not I would like to add these. I am not too knowledgeable about ARM assembly and differences for the various versions.

I do have some experience and documents on MIPS assembly so I should have to get by on that with the help of information across the internet. Any help will be appreciated.

Sunil

Reply by email

Jonas Maebe
to Sunil Amitkumar Janki
Sunil Amitkumar Janki wrote
I want to know how to build Freepascal so it runs on SPARC, MIPS(EL) and ARM GNU/Linux. For the latter two I will probably first have to cross-build to these architectures if possible but I don't know how to do this yet.

There is no MIPS support yet. ARM works though, although running the compiler itself on ARM usually doesn't work because of a lack of ram (and ARM systems are also quite slow usually).

Show quoted text 26 lines
This is the error I get when I build FPC 2.2.0 on SPARC using FPC 2.0.0: > /opt/programming/pascal/freepascal/applications/compilers/ > 2/2.0/2.0.0/bin/ppcsparc -Ur -Ur -Xs -n -Xs -Fi../inc -Fi../sparc > -Fi../unix -Fisparc -FE. -FU/tmp/fpc-2.2.0/rtl/units/sparc-linux - > dsparc -dRELEASE ../objpas/rtlconsts.pp > /opt/programming/pascal/freepascal/applications/compilers/ > 2/2.0/2.0.0/bin/ppcsparc -Ur -Ur -Xs -n -Xs -Fi../inc -Fi../sparc > -Fi../unix -Fisparc -FE. -FU/tmp/fpc-2.2.0/rtl/units/sparc-linux - > dsparc -dRELEASE -Sg ../objpas/typinfo.pp > /opt/programming/pascal/freepascal/applications/compilers/ > 2/2.0/2.0.0/bin/ppcsparc -Ur -Ur -Xs -n -Xs -Fi../inc -Fi../sparc > -Fi../unix -Fisparc -FE. -FU/tmp/fpc-2.2.0/rtl/units/sparc-linux - > dsparc -dRELEASE ../objpas/math.pp > math.pp(2185,10) Error: Calling convention doesn't match forward > math.pp(2190,10) Error: Calling convention doesn't match forward > math.pp(2195,10) Error: Calling convention doesn't match forward > math.pp(2207,10) Error: Calling convention doesn't match forward > math.pp(2218,10) Error: Calling convention doesn't match forward > math.pp(2229,10) Error: Calling convention doesn't match forward > math.pp(2241,10) Error: Calling convention doesn't match forward > math.pp(2253,10) Error: Calling convention doesn't match forward > math.pp(2349) Fatal: There were 8 errors compiling module, stopping > math.pp(2349) Error: Compilation aborted > make[7]: *** [math.ppu] Error 1

Building FPC 2.2.0 is only supported starting with 2.0.4. Since there is no 2.0.4 for sparc/linux, you will have to cross-compile it from another platform (e.g. from linux/i386). Further, no one is currently maintaining sparc/linux, so it might not even build (although it should). I run a nightly test for sparc/solaris and from time to time fix regressions for that platform, but I don't actively use it. I fixed some sparc/linux bugs in the run-up to 2.2.0, but no longer have access to a sparc/linux system now.

You might want to have a look at the cross building faq: http://www.stack.nl/~marcov/buildfaq.pdf

Show quoted text 7 lines
I don't know if ARM and MIPS host support do in fact exist at all but if not I would like to add these. I am not too knowledgeable about ARM assembly and differences for the various versions. I do have some experience and documents on MIPS assembly so I should have to get by on that with the help of information across the internet. Any help will be appreciated.

There's not really much documentation about the code generator design. The easiest is probably to look at the sparc or arm code generator (whichever architecture is closest), to copy them to a mips directory and modify the copied files.

If you have specific questions, you're of course always welcome to ask here.

Jonas

Reply by email

Florian Klaempfl
to Jonas Maebe
Show quoted text 11 lines
On 24 Sep 2007, at 10:29, Sunil Amitkumar Janki wrote: > I want to know how to build Freepascal so it runs on SPARC, > MIPS(EL) and ARM GNU/Linux. For the latter two I will probably > first have to cross-build to these architectures if possible but I > don't know how to do this yet. There is no MIPS support yet. ARM works though, although running the compiler itself on ARM usually doesn't work because of a lack of ram (and ARM systems are also quite slow usually).

Depends, on my thecus it works fine thought make cycle takes 25 min :)

Reply by email

Sunil Amitkumar Janki
to Florian Klaempfl
Florian Klaempfl wrote 15 lines
Jonas Maebe schrieb: > On 24 Sep 2007, at 10:29, Sunil Amitkumar Janki wrote: > > >> I want to know how to build Freepascal so it runs on SPARC, >> MIPS(EL) and ARM GNU/Linux. For the latter two I will probably >> first have to cross-build to these architectures if possible but I >> don't know how to do this yet. >> > There is no MIPS support yet. ARM works though, although running the > compiler itself on ARM usually doesn't work because of a lack of ram > (and ARM systems are also quite slow usually). > Depends, on my thecus it works fine thought make cycle takes 25 min :)

Thanks for the link to that document. I will try and get the SPARC port running using a SPARC cross-compiler running on x86 which shouldn't be a problem anymore now that I know how to do so.

My MIPS machine is a Fu Long computer with a Loongson processor and I was just reading the forums. Someone has largely ported FPC to little-endian MIPS, so I will try to contact him.

The lack of memory on ARM targets is not really a have QEMU virtual machines for various architectures and I can assign 256 MB to an ARM one, more than is physically available on a PDA which I intend to port Linux to.

It runs about 5 times as slow as the host, but that's still fast enough to get FPC to build and not that much slower than real hardware. The amount of memory should also be enough, I think.

Sunil

Reply by email

Michael Schnell
to Sunil Amitkumar Janki: I want to know how to build Freepascal so it runs on SPARC, MIPS(EL) and ARM GNU/Linux.…
I want to know how to build Freepascal so it runs on SPARC, MIPS(EL) and ARM GNU/Linux. For the latter two I will probably first have to cross-build to these architectures if possible but I don't know how to do this yet.

AFAIK cross compiling for ARM/Linux already is fully supported (though I only read about successful ARM/WinCE projects yet).

There seem to be some first steps of a MIPS cross compiler, but AFAIK, it does not compile yet.

I would be very interested (i.e. willing to work on) a NIOS cross compiler. NIOS is said to be very similar to MIPS, so it might be possible to do a compiler that covers both.

-Michael

Reply by email

Michael Schnell
to Sunil Amitkumar Janki: Thanks for the link to that document. I will try and get the SPARC port running using a…
I was just reading the forums. Someone has largely ported FPC to little-endian MIPS, so I will try to contact him.

Please let me know about what you find !

Show quoted text 5 lines
The lack of memory on ARM targets is not really a problem at all. I have QEMU virtual machines for various architectures and I can assign 256 MB to an ARM one, more than is physically available on a PDA which I intend to port Linux to.

The memory issues will be overcome soon. I'm just starting to design a Linux PCB and find that I likely will have 32MByte memory (even though I just need some 6 MB), as there are no smaller DDR.2 chips.

Do you think it's really essential to have the compiler run on the target ? Cross-compiling should be much easier to do and a lot easier to work with for the users. (Is anybody really supposed to write programs on his PDA ? )

-Michael

Reply by email

Luca Olivetti
to Florian Klaempfl: Depends, on my thecus it works fine thought make cycle takes 25 min :)

En/na Florian Klaempfl ha escrit:

Show quoted text 12 lines
Jonas Maebe schrieb: > On 24 Sep 2007, at 10:29, Sunil Amitkumar Janki wrote: > >> I want to know how to build Freepascal so it runs on SPARC, >> MIPS(EL) and ARM GNU/Linux. For the latter two I will probably >> first have to cross-build to these architectures if possible but I >> don't know how to do this yet. > There is no MIPS support yet. ARM works though, although running the > compiler itself on ARM usually doesn't work because of a lack of ram > (and ARM systems are also quite slow usually). Depends, on my thecus it works fine thought make cycle takes 25 min :)

It also works fine on my lspro (even if I don't remember how long does it take for a make cycle, and I didn't try yet with 2.2.0, last I tried was 2.1.4, which leads me to the question: are you going to provide a native arm 2.2.0 tarball?) ;-)

Bye

Luca

Reply by email

Jonas Maebe
to Sunil Amitkumar Janki: Thanks for the link to that document. I will try and get the SPARC port running using a…
Sunil Amitkumar Janki wrote
My MIPS machine is a Fu Long computer with a Loongson processor and I was just reading the forums. Someone has largely ported FPC to little-endian MIPS, so I will try to contact him.

If you get those sources, it would be nice if you could provide them to us so we can add them to svn (even if they don't work with the current svn version, it's nice to have a base in case someone wants to continue work on it).

The lack of memory on ARM targets is not really a problem at all. I have QEMU virtual machines for various architectures and I can assign 256 MB to an ARM one, more than is physically available on a PDA which I intend to port Linux to.

Ok. Just note that in general for embedded systems it is usually faster to cross-compile than to use a native compiler (especially if you run that native compiler in a virtual environment).

It runs about 5 times as slow as the host, but that's still fast enough to get FPC to build and not that much slower than real hardware. The amount of memory should also be enough, I think.

Certainly. Compiling the compiler with itself only requires about 22MB of ram.

Jonas

Reply by email

Luca Olivetti
to Michael Schnell: Please let me know about what you find ! The memory issues will be overcome soon. I'm…

En/na Michael Schnell ha escrit:

Do you think it's really essential to have the compiler run on the target ? Cross-compiling should be much easier to do and a lot easier to work with for the users. (Is anybody really supposed to write programs on his PDA ? )

Well, my arm machine (a buffalo linkstation pro) is sold as a network drive, has 128MBytes, it comes from the factory with a vendor provided stripped-down linux, and it has been hacked to run full-fledged debian, so it's not exactly a pda (in fact it's my personal mail/web/jabber/nfs/and various other things server). Cross-compiling is too much of a hassle for me, since I'd have to reproduce the library environment of the lspro on the host machine, and I should also carefully study the documentation on cross-compiling ;-)

Bye

Luca

Reply by email

Sunil Amitkumar Janki
to Luca Olivetti: En/na Florian Klaempfl ha escrit: It also works fine on my lspro (even if I don't…
Luca Olivetti wrote 6 lines
It also works fine on my lspro (even if I don't remember how long does it take for a make cycle, and I didn't try yet with 2.2.0, last I tried was 2.1.4, which leads me to the question: are you going to provide a native arm 2.2.0 tarball?) ;-) Bye

I think it's time to reveal what this is all about. I am running Slackware (Splack) on SPARC and have contributed some things to Slackware on x86 and ARM (Armedslack).

And I am trying to get as much software to build on all targets natively so they are all equal from an applications perspective and it's easy to switch between them. I know of Debian and Gentoo but prefer Slackware.

I may also acquire an Iyonix or other ARM system somewhere in the future. So if I have the time and can provide a native ARM tarball I certainly will do so. First I have to learn some Linux and ARM programming though :-).

Sunil

Reply by email

Luca Olivetti
to Sunil Amitkumar Janki

En/na Sunil Amitkumar Janki ha escrit:

Show quoted text 5 lines
Luca Olivetti wrote: > It also works fine on my lspro (even if I don't remember how long does > it take for a make cycle, and I didn't try yet with 2.2.0, last I > tried was 2.1.4, which leads me to the question: are you going to > provide a native arm 2.2.0 tarball?) ;-)

[...]

I may also acquire an Iyonix or other ARM system somewhere in the future. So if I have the time and can provide a native ARM tarball I certainly will do so. First I have to learn some Linux and ARM programming though :-).

Don't worry, the question was for Florian, since he provided a binary snapshot of 2.1.3 (IIRC) and he has the means to do it (as do I, but if he already did it I'd gladly avoid a make cycle ;-) )

Bye

Luca

Reply by email

Michael Schnell
to Luca Olivetti: En/na Michael Schnell ha escrit: Well, my arm machine (a buffalo linkstation pro) is sold…
Luca Olivetti wrote 16 lines
En/na Michael Schnell ha escrit: > Do you think it's really essential to have the compiler run on the > target ? Cross-compiling should be much easier to do and a lot easier > to work with for the users. (Is anybody really supposed to write > programs on his PDA ? ) Well, my arm machine (a buffalo linkstation pro) is sold as a network drive, has 128MBytes, it comes from the factory with a vendor provided stripped-down linux, and it has been hacked to run full-fledged debian, so it's not exactly a pda (in fact it's my personal mail/web/jabber/nfs/and various other things server). Cross-compiling is too much of a hassle for me, since I'd have to reproduce the library environment of the lspro on the host machine, and I should also carefully study the documentation on cross-compiling ;-)

OK this indeed might bean advantage from time to time. A friend of mine installed a MySQL server on a similar machine by just running the MySQL make script at the target itself. So he did not need to bother with cross compiling.

-Michael

Reply by email

Florian Klaempfl
to Luca Olivetti: En/na Michael Schnell ha escrit: Well, my arm machine (a buffalo linkstation pro) is sold…
Show quoted text 15 lines
En/na Michael Schnell ha escrit: > Do you think it's really essential to have the compiler run on the > target ? Cross-compiling should be much easier to do and a lot easier > to work with for the users. (Is anybody really supposed to write > programs on his PDA ? ) Well, my arm machine (a buffalo linkstation pro) is sold as a network drive, has 128MBytes, it comes from the factory with a vendor provided stripped-down linux, and it has been hacked to run full-fledged debian, so it's not exactly a pda (in fact it's my personal mail/web/jabber/nfs/and various other things server). Cross-compiling is too much of a hassle for me, since I'd have to reproduce the library environment of the lspro on the host machine, and I should also carefully study the documentation on cross-compiling ;-)

I built one but it seems that it didn't made it onto the website.

Reply by email