<li><a href="#quickstart">Getting started quickly (a summary)</a>
<li><a href="#terminology">Terminology and Notation</tt></a>
<li><a href="#environment">Setting up your environment</a>
+ <li><a href="#unpack">Unpacking the LLVM Archives</a>
<li><a href="#checkout">Checkout LLVM from CVS</a>
<li><a href="#config">Local LLVM Configuration</tt></a>
<li><a href="#compile">Compiling the LLVM Suite Source Code</a>
on other platforms, so it should be possible to generate and produce LLVM
bytecode on unsupported platforms (although bytecode generated on one
platform may not work on another platform). However, the code generators
- and Just In Time Compilers (JIT's) only generate SparcV9 or x86 machine
- code.
+ and Just-In-Time (JIT) compilers only generate SparcV9 or x86 machine code.
<!--=====================================================================-->
<h4><a name="software"><b>Software</b></a></h4>
<!--=====================================================================-->
<p>
+
+ Unpacking the distribution requires the following tools:
+ <dl compact>
+ <dt>GNU Zip (gzip)
+ <dt>GNU Tar
+ <dd>
+ These tools are needed to uncompress and unarchive the software.
+ Regular Solaris <tt>tar</tt> may work for unpacking the TAR archive but
+ is untested.
+ </dl>
+
Compiling LLVM requires that you have several different software packages
installed:
<dt>LLVMGCCDIR
<dd>
This is the pathname to the location where the LLVM C Front End will
- be installed. Note that the C front end does not need to be installed
+ be installed. Note that the C front end does not need to be installed
during the LLVM suite build; you will just need to know where it will
go for configuring the build system and running the test suite later.
<p>
+ For the pre-built C front end binaries, the LLVMGCCDIR is
+ <tt>cfrontend/<i>platform</i>/llvm-gcc</tt>.
<dt>GCCSRC
<dd>
your <tt>PATH</tt> or typing in its complete pathname.
</dl>
+ <!------------------------------------------------------------------------->
+ <h3><a name="unpack">Unpacking the LLVM Archives</a></h3>
+ <!------------------------------------------------------------------------->
+
+ <p>
+ If you have the LLVM distribution, you will need to unpack it before you
+ can begin to compile it. LLVM is distributed as a set of four files. Each
+ file is a TAR archive that is compressed with the gzip program.
+ </p>
+
+ <p> The four files are the following:
+ <dl compact>
+ <dt>llvm.tar.gz
+ <dd>This is the source code to the LLVM suite.
+ <p>
+
+ <dt>cfrontend.sparc.tar.gz
+ <dd>This is the binary release of the C front end for Solaris/Sparc.
+ <p>
+
+ <dt>cfrontend.x86.tar.gz
+ <dd>This is the binary release of the C front end for Linux/x86.
+ <p>
+
+ <dt>cfrontend-src.tar.gz
+ <dd>This is the source code release of the C front end.
+ <p>
+ </dl>
+
+ <p>
+ To unpack the files, take each one, unzip it, and then untar it. A fast
+ way to do that is with the following:
+ </p>
+
+ <tt>gunzip --stdout <i>name of file</i> | tar -xvf -</tt>
+
+ <p>
+ For example, to extract the LLVM source code, use the following command:
+ </p>
+
+ <tt>gunzip --stdout llvm.tar.gz | tar -xvf -</tt>
+
<!------------------------------------------------------------------------->
<h3><a name="checkout">Checkout LLVM from CVS</a></h3>
<!------------------------------------------------------------------------->
- <p>To get a fresh copy of the entire source code, all you
- need to do is check it out from CVS as follows:
+ <p>If you have access to our CVS repository, you can get a fresh copy of
+ the entire source code. All you need to do is check it out from CVS as
+ follows:
<ul>
<li><tt>cd <i>where-you-want-llvm-to-live</i></tt>
<li><tt>cvs -d <i>CVSROOTDIR</i> checkout llvm</tt></p>
can directly execute LLVM bytecode (although very slowly...). In addition
to a simple interpreter, <tt>lli</tt> is also has debugger and tracing
modes (entered by specifying <tt>-debug</tt> or <tt>-trace</tt> on the
- command line, respectively).<p>
+ command line, respectively). Finally, for architectures that support it
+ (currently only x86 and Sparc), by default, <tt>lli</tt> will function as
+ a Just-In-Time compiler (if the functionality was compiled in), and will
+ execute the code <i>much</i> faster than the interpreter.<p>
<dt><tt><b>llc</b></tt><dd> <tt>llc</tt> is the LLVM backend compiler,
- which translates LLVM bytecode to a SPARC assembly file.<p>
+ which translates LLVM bytecode to a SPARC or x86 assembly file.<p>
<dt><tt><b>llvmgcc</b></tt><dd> <tt>llvmgcc</tt> is a GCC based C frontend
that has been retargeted to emit LLVM code as the machine code output. It
<tt>% dis < hello.bc | less</tt><p>
<li>Compile the program to native Sparc assembly using the code
- generator:<p>
+ generator (assuming you are currently on a Sparc system):<p>
<tt>% llc hello.bc -o hello.s</tt><p>