[fpc-pascal] Free Pascal, Dos, Cross compiling, Etc

Tomas Hajny XHajT03 at mbox.vol.cz
Tue Jan 18 22:03:13 CET 2005


On Tue, 18 Jan 2005 18:03:57 +0100, Florian Klaempfl wrote
> Skybuck at home.nl wrote:
> 
> > Hi,
> > 
> > I just downloaded Free Pascal 1.9.6 for Win32.  (fpc-1.9.6.i386-win32.zip)
> > 
> > Unzipped it, Installed it and added the thing to the end of the path etc.
> > 
> > I would like to compile a simple Hello World program to all targets.
> > 
> > Apperently I can only compile/link/build to the win32 target :( !
> > 
> > I would like to compile the hello world example so that it can be run from
> > ms-dos 6.22 as well.
> > 
> > Sigh.
> > 
> > Since I now have a BIGGGGG harddisk 120 Gigabytes ;) I would simply like to
> > download a free pascal cross compiler binary/zip/distribution which has
> > everything needed to compile to ALL TARGETS !
> > 
> > Does such a distribution of free pascal already exist ?
> 
> No. It could only exist if somebody offers an approbriate mirror :)
> > 
> > Or do I now have to start building my own free pascal cross compiler for
> > every target ?!?
> 
> Yes.

Well, you certainly don't need FPC cross-compiler for every target. Every FPC native compiler can generate code for all supported targets on the same CPU. This means that e.g. an i386-win32 compiler (that one you downloaded) can compile for all of Win32, GO32v2 (DOS), OS/2, Linux, FreeBSD, Netware and NetwLibc. However, for this to work you either need cross GNU binutils, or only generate assembler files using -s compiler parameter and assemble and link on the target platform. Quite a few pre-built cross binutils packages can be downloaded from ftp://ftp.freepascal.org/pub/fpc/contrib/cross, for the particular case of GO32v2 you can _in_some_cases_ take the advantage of ability of Windows to run DOS apps and use aslddos.zip distributed with the DOS release (it is _not_ guaranteed to work, though - there are limitations). In addition, you might need some libraries from the target system if such packages are used in the program being compiled.

Tomas





More information about the fpc-pascal mailing list