Required source packages
- The "core" package of a recent GCC 3.4.x, 4.0.x, or 4.1.x
- The GDC source package.
For runtime software requirements, see the user manual.
- The usual GCC
- An existing C++ compiler (even if you use make bootstrap). G++ 3.x,
4.0.1, and later versions
are known to work. G++ 2.x and 4.0.0 are
known to not work.
-- Location of the GCC sources
-- Build directory for GCC
-- Install directory for GCC
Building the Compiler and Runtime Library
- Unpack the GCC archive. This creates <srcdir>.
- Change to the <srcdir>/gcc directory.
- Unpack the gdc archive. This will create a
subdirectory named "d".
- Change back to <srcdir> and run the setup script:
- Build GCC using the normal install
only difference is that "d"
is added to the --enable-languages
If you need to specify a compiler
to build GCC other than the
system's default, change the PATH,
or use the "CC"
and "CXX" environment
CC=gcc3 CXX=g++3 <srcdir>/configure
Remember to always use "gmake"
if GNU Make is not the system's default.
- Install with "make
Building a Cross Compiler
(This section is not complete)
Building a cross compiler takes some extra effort now (except for
MinGW.) It will become more automated as people contribute
information for various targets.
You will need to create two files (three for a unix target) that are
normally generated during a native build. The files are frag-gen,
frag-math, and (for unix) frag-unix. Here are some ways to create
Once you have the files, put them in a directory and configure with the
- Do a native build on the target. The files will
be in <builddir>/<target>/libphobos.
- Look at the existing files in <srcdir>/gcc/d/phobos/config/mingw as
an example of what is need.
- Let the build fail for Phobos. You will have a working C
cross-compiler at that point. Compile gen_config1.c,
gen_math.c, gen_unix.c, run them on the target, and copy the resultant
to your build system.
Runtime Library Notes
- To run the unit tests, run "make
- On some targets, std.math tests will fail because
is no 80-bit real (or library support for it.)
- On some targets, std.conv tests will fail because the floating
point conversion functions do not work as expected.
- On FreeBSD and Linux, the test of the "%A" format will fail due
to a library bug.