Sign in Join
Wiki copytemporary

Cross-compilation from Win32 to GO32v2: what changed

Revision 2 to 3. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-## Contents
2-
3- * 1 Multiple options for cross compilation
4- * 2 Use real cross-compile binutils
5- * 3 Use GO32v2 binutils
6- * 4 Use emulation
7- * 5 FPC RTL issues
8- * 5.1 Creating GO32v2 binaries under WinXX DOS box
9- * 6 See also
10-
111## Multiple options for cross compilation
122
13-In general, FPC support of cross-compilation expects you to have "cross-tools" (assembler and linker), i.e. tools running on the source platform, but creating binaries for (a different) target platform in your usual "bin" directory (i.e. i386-win32 for your Win32 installation). Filenames of these tools should be prefixed with the target platform specification (e.g. "i386-linux-as.exe" or "i386-go32v2-ld.exe").
3+In general, FPC support of cross-compilation expects you to have "cross-tools" (assembler and linker), i.e. tools running on the source platform, but creating binaries for (a different) target platform in your usual "bin" directory (i.e. i386-win32 for your Win32 installation). Filenames of these tools should be prefixed with the target platform specification (e.g. "i386-linux-as.exe" or "i386-go32v2-ld.exe").
144
15-When talking specifically about GO32v2 target under Win32, there are two possible ways how to get this.
5+When talking specifically about GO32v2 target under Win32, there are two possible ways how to get this.
166
177## Use real cross-compile binutils
188
19-The general way (possible for GO32v2 too) is to compile real cross-tools, i.e. compile the GO32v2 version of as.exe with GNU C for Win32 (Cygwin or MingW32) to get real Win32 binary producing outputs for GO32v2. This is the only possible solution for platforms for which there isn't emulation layer for running "their" binaries (Linux, FreeBSD, Netware etc.). Pre-compiled cross-tools for some host-guest combinations are available on [our FTP server](<ftp://ftp.freepascal.org/pub/fpc/contrib/cross/>) \- if you build those tools for other combinations, or build (and successfully test) newer versions of existing ones, you are welcome to contribute them.
9+The general way (possible for GO32v2 too) is to compile real cross-tools, i.e. compile the GO32v2 version of as.exe with GNU C for Win32 (Cygwin or MingW32) to get real Win32 binary producing outputs for GO32v2. This is the only possible solution for platforms for which there isn't emulation layer for running "their" binaries (Linux, FreeBSD, Netware etc.). Pre-compiled cross-tools for some host-guest combinations are available on [our FTP server](ftp://ftp.freepascal.org/pub/fpc/contrib/cross/) - if you build those tools for other combinations, or build (and successfully test) newer versions of existing ones, you are welcome to contribute them.
2010
2111## Use GO32v2 binutils
2212
23-The second possibility is to take the advantage of WinXX being able to run DOS binaries and just copy the GO32v2 versions of GNU tools to a new location and different name. This has some limitations (e.g. with regard to maximum length of the command line), but it works in general (although I wouldn't consider this solution really supported one - however, it's an easier one).
13+The second possibility is to take the advantage of WinXX being able to run DOS binaries and just copy the GO32v2 versions of GNU tools to a new location and different name. This has some limitations (e.g. with regard to maximum length of the command line), but it works in general (although I wouldn't consider this solution really supported one - however, it's an easier one).
2414
2515## Use emulation
2616
27-The third possibility is using DOS emulation provided by WinXX to avoid cross-compilation. If this works for you (see "Creating GO32v2 binaries under WinXX DOS box" below for more detailed information), this is the easiest solution. However, you are completely on your own there, since the WinXX emulation of DOS is far from being perfect and different WinXX versions impose various different limitations and issues one may need to face.
17+The third possibility is using DOS emulation provided by WinXX to avoid cross-compilation. If this works for you (see "Creating GO32v2 binaries under WinXX DOS box" below for more detailed information), this is the easiest solution. However, you are completely on your own there, since the WinXX emulation of DOS is far from being perfect and different WinXX versions impose various different limitations and issues one may need to face.
2818
2919## FPC RTL issues
3020
31-In any case, you need both FPC RTLs (source) available, of course. One additional issue is that the GO32v2 compiler expects the RTL in /units/go32v2/rtl (to allow it to run even in plain DOS which suffers from 8.3 name length constraint), whereas the Win32 compiler (including that one integrated in our IDE) expects directories with full target names (i386-go32v2).
21+In any case, you need both FPC RTLs (source) available, of course. One additional issue is that the GO32v2 compiler expects the RTL in /units/go32v2/rtl (to allow it to run even in plain DOS which suffers from 8.3 name length constraint), whereas the Win32 compiler (including that one integrated in our IDE) expects directories with full target names (i386-go32v2).
3222
33-This means you need to either rename the directory distributed together with the native GO32v2 release (if you don't intend to use the native GO32v2 compiler any more), or create a copy.
23+This means you need to either rename the directory distributed together with the native GO32v2 release (if you don't intend to use the native GO32v2 compiler any more), or create a copy.
3424
35-Finally, cross-debugging (debugging of GO32v2 binaries in Win32 IDE) isn't possible at the moment. The only possibility is to use GO32v2 IDE (or standalone GO32v2 gdb) directly.
25+Finally, cross-debugging (debugging of GO32v2 binaries in Win32 IDE) isn't possible at the moment. The only possibility is to use GO32v2 IDE (or standalone GO32v2 gdb) directly.
3626
3727### Creating GO32v2 binaries under WinXX DOS box
3828
39-A simple way to generate plain DOS programs under 32-bit Win32 is the following:
29+A simple way to generate plain DOS programs under 32-bit Win32 is the following:
4030
41- * Install the Go32V2 version under Win32 in e.g. \ppdos.
42- * Install a current Win32 version of FPC in e.g. \ppwin.
43- * Do your development with the Win32 version.
44- * If everything runs ok, use a DOS box (or a command shell) and compile your source code via the command line version of Go32v2. You have to inform the compiler (via command line switches) about the location of your units.
31+- Install the Go32V2 version under Win32 in e.g. \ppdos.
32+- Install a current Win32 version of FPC in e.g. \ppwin.
33+- Do your development with the Win32 version.
34+- If everything runs ok, use a DOS box (or a command shell) and compile your source code via the command line version of Go32v2. You have to inform the compiler (via command line switches) about the location of your units.
4535
46-The resulting *.exe runs fine as _long_ as DPMI is present (you may distribute your *.exe together with cwsdpmi.exe which is in your FPC directory). If you don't want a separate DPMI host you may use one of the ways described below or compile your program under plain DOS (e.g. using FreeDOS).
36+The resulting *.exe runs fine as _long_ as DPMI is present (you may distribute your *.exe together with cwsdpmi.exe which is in your FPC directory). If you don't want a separate DPMI host you may use one of the ways described below or compile your program under plain DOS (e.g. using FreeDOS).
4737
48-To avoid problems with long file names (larger than 8.3) you may use the "subst" command to access your files: e.g. "subst b: c:\documents...." would let you find all files in b: which are located in c:\documents.
38+To avoid problems with long file names (larger than 8.3) you may use the "subst" command to access your files: e.g. "subst b: c:\documents...." would let you find all files in b: which are located in c:\documents.
4939
5040## See also
5141
52- * [[Cross compiling]]
53- * [[Cross compiling for Windows under Linux]] another cross compiling setup
54- * [[buildfaq]] information for building the compiler and cross compilers
42+- [[Cross compiling]]
43+- [[Cross compiling for Windows under Linux]] another cross compiling setup
44+- [[buildfaq]] information for building the compiler and cross compilers
5545
5646---
57-*From the Free Pascal wiki, page "Cross-compilation from Win32 to GO32v2", as the Internet Archive kept it on 2022-06-06. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
47+*From the Free Pascal wiki, page "Cross-compilation from Win32 to GO32v2", as it stood on 2021-07-19 after a change by Dbannon, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
48+Category: Cross compilation

Back to history