From 20dcb4c24dd245c25e4eae3dbb3762ab8dd4a4f7 Mon Sep 17 00:00:00 2001
From: Duncan Sands
The build requires having a compiler that supports Ada, C and C++. The Ada front-end is written in Ada so an Ada compiler is needed to - build it. The LLVM parts of llvm-gcc are written in C++ so a C++ + build it. What is more, the Ada compiler must not be more recent + than what it is trying to compile, otherwise the build will fail. + This rules out gcc-4.3 (but not gcc-4.2) and also the + 2007 GNAT GPL Edition. + The LLVM parts of llvm-gcc are written in C++ so a C++ compiler is needed to build them. The rest of gcc is written in C. Some linux distributions provide a version of gcc that supports all three languages (the Ada part often comes as an add-on package to the rest of gcc). Otherwise it is possible to combine two versions - of gcc, one that supports Ada and C (such as - GNAT GPL Edition) and another - which supports C++, see below.
Because the Ada front-end is experimental, it is wise to build the + compiler with checking enabled. This causes it to run slower, but + helps catch mistakes in the compiler (please report any problems using + LLVM bugzilla).
Supposing appropriate compilers are available, llvm-gcc with Ada support can @@ -153,21 +161,22 @@ cd llvm-objects
Configure LLVM (here it is configured to install into /usr/local):
../llvm/configure --prefix=/usr/local+
../llvm/configure --prefix=/usr/local
If you have a multi-compiler setup and the C++ compiler is not the default, then you can configure like this:
CXX=PATH_TO_C++_COMPILER ../llvm/configure --prefix=/usr/local+
CXX=PATH_TO_C++_COMPILER ../llvm/configure --prefix=/usr/local
Build LLVM:
+Build LLVM with checking enabled (use ENABLE_OPTIMIZED=1 to + build without checking):
make+
make ENABLE_OPTIMIZED=0
Configure llvm-gcc (here it is configured to install into /usr/local). + The --enable-checking flag turns on sanity checks inside the compiler. + If you omit it then LLVM must be built with make ENABLE_OPTIMIZED=1. Additional languages can be appended to the --enable-languages switch, for example --enable-languages=ada,c,c++.
../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib+
../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib
If you have a multi-compiler setup, then you can configure like this:
@@ -203,7 +214,7 @@ cd llvm-gcc-4.2-objectsexport CC=PATH_TO_C_AND_ADA_COMPILER export CXX=PATH_TO_C++_COMPILER -../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib+../llvm-gcc-4.2/configure --prefix=/usr/local --enable-languages=ada,c --enable-checking --enable-llvm=$PWD/../llvm-objects --disable-shared --disable-bootstrap --disable-multilib