From 77f746998104af8ade4c3b2d947c9311fd1af836 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 16 Jul 2007 08:44:39 +0000 Subject: [PATCH] Clean up some formatting. Add some doc_code div tags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39915 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/GettingStarted.html | 89 ++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/docs/GettingStarted.html b/docs/GettingStarted.html index 33e3c2950ff..143c7a34c6e 100644 --- a/docs/GettingStarted.html +++ b/docs/GettingStarted.html @@ -722,10 +722,14 @@ revision), you can checkout it from the 'tags' directory (instead of

If you would like to get the LLVM test suite (a separate package as of 1.4), you get it from the Subversion repository:

+ +
-  cd llvm/projects
-  svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
+% cd llvm/projects
+% svn co http://llvm.org/svn/llvm-project/test-suite/trunk llvm-test
 
+
+

By placing it in the llvm/projects, it will be automatically configured by the LLVM configure script as well as automatically updated when you run svn update.

@@ -882,15 +886,16 @@ script to configure the build system:

To configure LLVM, follow these steps:

    -
  1. Change directory into the object root directory: -
    - cd OBJ_ROOT -

    +
  2. Change directory into the object root directory:

    -
  3. Run the configure script located in the LLVM source tree: -
    - SRC_ROOT/configure --prefix=/install/path [other options] -

    +
    % cd OBJ_ROOT
  4. + +
  5. Run the configure script located in the LLVM source + tree:

    + +
    +
    % SRC_ROOT/configure --prefix=/install/path [other options]
    +
@@ -934,7 +939,7 @@ builds:

Once you have LLVM configured, you can build it by entering the OBJ_ROOT directory and issuing the following command:

-

gmake

+
% gmake

If the build fails, please check here to see if you are using a version of GCC that is known not to compile LLVM.

@@ -944,7 +949,7 @@ If you have multiple processors in your machine, you may wish to use some of the parallel build options provided by GNU Make. For example, you could use the command:

-

gmake -j2

+
% gmake -j2

There are several special targets which are useful when working with the LLVM source code:

@@ -1082,12 +1087,12 @@ platforms or configurations using the same source tree.

The LLVM build will place files underneath OBJ_ROOT in directories @@ -1143,10 +1148,10 @@ first command may not be required if you are already using the module):

-   $ mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
-   $ echo ':llvm:M::llvm::/path/to/lli:' > /proc/sys/fs/binfmt_misc/register
-   $ chmod u+x hello.bc                (if needed)
-   $ ./hello.bc
+$ mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
+$ echo ':llvm:M::llvm::/path/to/lli:' > /proc/sys/fs/binfmt_misc/register
+$ chmod u+x hello.bc   (if needed)
+$ ./hello.bc
 
@@ -1502,25 +1507,30 @@ output.

    -
  1. First, create a simple C file, name it 'hello.c': -
    -   #include <stdio.h>
    -   int main() {
    -     printf("hello world\n");
    -     return 0;
    -   }
    -       
  2. +
  3. First, create a simple C file, name it 'hello.c':

    + +
    +
    +#include <stdio.h>
    +
    +int main() {
    +  printf("hello world\n");
    +  return 0;
    +}
    +
  4. Next, compile the C file into a native executable:

    -

    % llvm-gcc hello.c -o hello

    +
    % llvm-gcc hello.c -o hello

    Note that llvm-gcc works just like GCC by default. The standard -S and -c arguments work as usual (producing a native .s or .o file, - respectively).

    + respectively).

  5. Next, compile the C file into a LLVM bitcode file:

    -

    % llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc

    + +
    +
    % llvm-gcc -O3 -emit-llvm hello.c -c -o hello.bc

    The -emit-llvm option can be used with the -S or -c options to emit an LLVM ".ll" or ".bc" file (respectively) for the code. This allows you @@ -1532,11 +1542,11 @@ output.

  6. Run the program in both forms. To run the program, use:

    -

    % ./hello

    +
    % ./hello

    and

    -

    % lli hello.bc

    +
    % lli hello.bc

    The second examples shows how to invoke the LLVM JIT, lli.

  7. @@ -1544,21 +1554,28 @@ output.

  8. Use the llvm-dis utility to take a look at the LLVM assembly code:

    -

    % llvm-dis < hello.bc | less

  9. +
    +
    llvm-dis < hello.bc | less
    +
  10. Compile the program to native assembly using the LLC code generator:

    -

    % llc hello.bc -o hello.s

    +
    % llc hello.bc -o hello.s
  11. Assemble the native assembly language file into a program:

    -

    Solaris:% /opt/SUNWspro/bin/cc -xarch=v9 hello.s -o hello.native

    -

    Others:% gcc hello.s -o hello.native

    +
    +
    +Solaris: % /opt/SUNWspro/bin/cc -xarch=v9 hello.s -o hello.native
    +
    +Others:  % gcc hello.s -o hello.native
    +
    +
  12. Execute the native code program:

    -

    % ./hello.native

    +
    % ./hello.native

    Note that using llvm-gcc to compile directly to native code (i.e. when the -emit-llvm option is not present) does steps 6/7/8 for you.

    -- 2.34.1