Go to the first, previous, next, last section, table of contents.

Crossbuilding a compiler.

Yet another possibility is crossbuilding : Using a crosscompiler to build GNU Pascal results in a compiler binary that runs on the cross-target platform. A possible reason why anybody would want to do this, is when the platform on which you want to run the GNU Pascal compiler, is not self-hosting. An example is cygwin32.

To crossbuild GNU Pascal, you have to install a crosscompiler for your target first. This is covered in chapter 4 of "Using and Porting GNU CC". Assuming you want to build a native cygwin32 Pascal compiler on a FreeBSD system, configure GCC:

% ../gcc-2.7.2.1/configure --prefix=/usr --build=i386-freebsd \
	--host=i386-cygwin32 --target=i386-cygwin32

Build it:

% make CFLAGS=-O2 LANGUAGES=c

Now, configure and build GPC. The output of `configure' should look like:

--------------------------------------------------------------------------
Configuration summary:
  Building a i386-cygwin32 crosscompiler hosted by i386-cygwin32

  GPC sources in:         ../gpc-2.0
  GCC sources in:         ../gcc-2.7.2.1
  GCC object code in:     ../gcc
  GCC version:            2.7.2.1

  Compiler for GPC:       i386-cygwin32-gcc
  Compiler for libgpc.a:  i386-cygwin32-gcc
  Compiler flags:         -g -O

  Cross-ar utility:       i386-cygwin32-ar
  Cross-ranlib utility:   i386-cygwin32-ranlib

  Installation path:      /usr/bin, /usr/lib/gcc-lib/i386-cygwin32/2.7.2.1
--------------------------------------------------------------------------

Now, type `make' to build the compiler and runtime system.

Again, `configure' should be able to detect and configure this setup without additional flags. If not, specify `--with-ar', `--with-ranlib', `--with-gcc' and/or `--with-rtsgcc' as appropriate.

A cross-built compiler must be installed by hand.


Go to the first, previous, next, last section, table of contents.