Thank you very much.

I succeeded in building a new compiler from the SVN sources,
and it runs successfully for the win32 target.

C:\fpc_test>ppc386 pasform.pas
Free Pascal Compiler version 2.7.1 [2013/07/24] for i386
Copyright (c) 1993-2013 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling pasform.pas
pasform.pas(746,8) Note: Local variable "CH" not used
pasform.pas(1147,8) Note: Local variable "I" not used
pasform.pas(1411,11) Note: Local variable "EINRUECKSAVE" not used
pasform.pas(1405,8) Note: Local variable "EINRUECKS2" not used
pasform.pas(1981,8) Note: Local variable "I" not used
pasform.pas(118,5) Note: Local variable "INCSTATE" is assigned but never used
pasform.pas(121,5) Note: Local variable "KPINDEX" is assigned but never used
Linking pasform.exe
2197 lines compiled, 0.1 sec, 48208 bytes code, 1220 bytes data
7 note(s) issued

and the program works as expected.

Then I built the RTL for linux, which also worked successfully, as far as I saw,
but when compiling with -Tlinux, I now get the following message:

C:\fpc_test>ppc386 -Tlinux pasform.pas
Free Pascal Compiler version 2.7.1 [2013/07/24] for i386
Copyright (c) 1993-2013 by Florian Klaempfl and others
Target OS: Linux for i386
Compiling pasform.pas
PPU Loading C:\fpc\rtl\units\i386-linux\system.ppu
PPU Invalid Version 135
Fatal: Can't find unit system used by PASFORM
Fatal: Compilation aborted

that is: the system.ppu seems to be found, but there is something wrong
with the version.

When trying to build the RTL for OS/2 (running make in the os2 subdir of
fpc/rtl), I get the following messages:

C:\fpc\rtl\os2>make
C:/lazarus/fpc/2.6.2/bin/i386-win32/gmkdir.exe -p ../../rtl/units/os2
i386-os2-as -o ../../rtl/units/os2/prt0.o prt0.as
process_begin: CreateProcess((null), i386-os2-as -o ../../rtl/units/os2/prt0.o p
rt0.as, ...) failed.
make (e=2): Das System kann die angegebene Datei nicht finden.
make: *** [prt0.o] Error 2

apparently, there is no i386-os2-as

when I did the same thing in the linux subdir, it worked (but: see above).

Do I need a special ASSEMBLER to build the OS/2 RTL?

Is it possible to download a pre-built OS/2 RTL?

No need to invest much time in those questions: I already had some
insights in the techniques of cross-compiling ... and in any case I'm now able
to build a new compiler from the compiler sources.

Kind regards

Bernd



Am 24.07.2013 14:19, schrieb Sven Barth:
Am 24.07.2013 14:12, schrieb Bernd Oppolzer:
Sorry, I'm sure, this is a very basic question,
just to speed up things a little ...

when I run the compiler on Windows on my test sources,
everythings works fine.

Now I wanted to build executables for OS/2 and Linux-386,
just to learn more about cross-compile. But the installed compiler-exe
(which came with Lazarus) only supports the win32 target.

The compiler message is as follows:

C:\fpc_test>ppc386 -Tos2 pasform.pas
Free Pascal Compiler version 2.6.2 [2013/06/09] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: OS/2
Compiling pasform.pas
Fatal: Can't find unit system used by PASFORM
Fatal: Compilation aborted

Same goes for -Tlinux

Of course, I have to build a new compiler. Or: do I misinterpret
the error message?

I downloaded the development tree using svn.

What is the easiest way to build a new compiler, and:
will it be possible to build a compiler that is able to build
different targets at the same time?

The problem is not the compiler. Each compiler can compile for each target of the supported platform. E.g. an i386-win32 compiler can also compile for i386-os2 and i386-linux. It can not however compile for e.g. x86_64-win64 or powerpc-linux. What is not provided by default for other targets is the RTL (and FCL and packages) which the compiler needs to compile programs. These you need to create by yourself, but for this you'll also need the according binutils and depending on the target platform and your program also libraries from the platform (e.g. when you compile for Linux systems). Cross compiling for different combinations is described here: http://wiki.freepascal.org/Cross_compiling In the simplest cases the approach mentioned for Win32 -> Win64 is sufficient, but you should also take a look at the BuildFAQ: http://wiki.freepascal.org/buildfaq

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel



--
Bernd Oppolzer
---------------------------------------------------------------
*Oppolzer-Informatik
* Dipl. Inf. Bernd Oppolzer
Bärenhofstraße 23
70771 Leinfelden-Echterdingen
---------------------------------------------------------------
Tel.: +49 711 2272522
priv.: +49 711 7949590
eMail: bernd.oppol...@t-online.de <mailto:bernd.oppol...@t-online.de>
---------------------------------------------------------------
Für Umsatzsteuerzwecke:
SteuerNr.: 97 076 / 29921
USt-ID-Nr.: DE 147 700 393
---------------------------------------------------------------
Jubiläumsjahr 2013:
30 Jahre Oppolzer-Informatik

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to