ELLCC

ELLCC Installation

Home
News
Documentation
Installation
Wiki
Bug Database
Source Repository
Contact
  1. ELLCC Installation
    1. Prerequisites
    2. Create the Build Directory
    3. Building LLVM
    4. Building ecc
The installation procedure for ELLCC is a bit complicated at the moment. There are currently no binary downloads available, you have to build from source. Having said that, here are step by step instructions that describe how to build ELLCC under Linux. These instructions also work under Cygwin.

It takes a long time to build ELLCC. It helps to have a system with at least 3GB of RAM to speed up the LLVM build.

Prerequisites

 An ELLCC build requires the following packages to be installed:
  • A C/C++ compiler
  • Subversion
  • Perl
  • Flex
  • Bison
Flex is used to build tools that are used to build ELLCC. The is currently a bug in some of the tools that use /usr/include/FlexLexer.h. The current work-around is edit /usr/include/FlexLexer.h (as superuser) and change the line

Create the Build Directory

Create a directory to build in. In the examples below, I use "ecc". Make the directory and get the ELLCC sources:

[~] main% mkdir ecc
[~] main% cd ecc
[~/ecc] main% svn co http://ellcc.org/svn/ellcc/trunk ellcc

Building LLVM

Get the ELLCC version of LLVM:

[~/ecc] main% svn co http://ellcc.org/svn/llvm/trunk llvm
[~/ecc] main% mkdir llvm-build
[~/ecc] main% cd llvm-build
[~/ecc/llvm-build] main% ../llvm/configure --prefix=`pwd`/../ellcc

The --prefix option sets the installation directory of this build of LLVM to the directory ellcc.

Next, build and install LLVM:

[~/ecc/llvm-build] main% make
[~/ecc/llvm-build] main% make install
[~/ecc/llvm-build] main% cd ..
[~/ecc] main%

Building ecc

The next step is to build the ecc compiler. Build the ELLCC sources:

[~/ecc] main% cd ellcc
[~/ecc/ellcc] main%
[~/ecc/ellcc] main% ./configure
[~/ecc/ellcc] main% make

If everything has been successful up to this point, you have built ecc. It, and the binaries created by the LLVM build are in the bin subdirectory of the build directory, i.e. in ~/ecc/bin in my example. The bin directory should look something like this:

[~/ecc/ellcc] main% ls bin
alpha-elf-e++@  lli*              llvm-ld*       msp430-elf-e++@     powerpc-elf-ecc@  x86-elf-e++@
alpha-elf-ecc@  llvm-ar*          llvm-link*     msp430-elf-ecc@     sparc-elf-e++@    x86-elf-ecc@
arm-elf-e++@    llvm-as*          llvm-nm*       nios2-elf-e++@      sparc-elf-ecc@    x86-pe-e++@
arm-elf-ecc@    llvm-bcanalyzer*  llvm-prof*     nios2-elf-ecc@      spu-elf-e++@      x86-pe-ecc@
bugpoint*       llvmc*            llvm-ranlib*   opt*                spu-elf-ecc@
e++@            llvm-config*      llvm-stub*     powerpc64-elf-e++@  tblgen*
ecc*            llvm-dis*         mips-elf-e++@  powerpc64-elf-ecc@  x86_64-elf-e++@
llc*            llvm-extract*     mips-elf-ecc@  powerpc-elf-e++@    x86_64-elf-ecc@

Some of the executables are as a result of building LLVM, but building ecc created the ecc executable and many symbolic links to it. You may when to put the bin directory in your PATH, but it is not required at this point. ecc and e++ are the hosted C and C++ compilers: They use the system header files in /usr/include  and use the system cc and c++ compilers to do the final program link so that the system startup code and libraries are used. This means you can use ecc and e++ to compile programs that run natively on your system.

The symbolic links to ecc set up defaults that cause it to target a specific processor and target environment. We'll see how to use them in Setting Up Target Support.