X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FCFEBuildInstrs.html;h=86d239659de967d426903a690608e0a36c154bf9;hb=714b69d0479e0fab36195e36da4578742ed4b63d;hp=5f2ed6f987497954f8eb8e45d7e1178bd4888a26;hpb=7911ce2578fd143f37ef4de7aa3e5795c18df4a6;p=oota-llvm.git diff --git a/docs/CFEBuildInstrs.html b/docs/CFEBuildInstrs.html index 5f2ed6f9874..86d239659de 100644 --- a/docs/CFEBuildInstrs.html +++ b/docs/CFEBuildInstrs.html @@ -14,12 +14,18 @@
@@ -39,13 +45,51 @@ process, and you should only try to do it if:We welcome patches to help make this process simpler.
+ + + + +If you are building LLVM and the GCC front-end under Cygwin, please note that +the LLVM and GCC makefiles do not correctly handle spaces in paths. To deal +with this issue, make sure that your LLVM and GCC source and build trees are +located in a top-level directory (like /cygdrive/c/llvm and +/cygdrive/c/llvm-cfrontend), not in a directory that contains a space +(which includes your "home directory", because it lives under the "Documents +and Settings" directory). We welcome patches to fix this issue. +
+It has been found that the GCC 3.3.3 compiler provided with recent Cygwin +versions is incapable of compiling the LLVM CFE correctly. If your Cygwin +installation includes GCC 3.3.3 we strongly recommend that you download +GCC 3.4.3, build it separately, and use it for compiling LLVM CFE. This has been +shown to work correctly.
+Some versions of Cygwin utilize an experimental version of GNU binutils that
+will cause the GNU ld linker to fail an assertion when linking
+components of the libstdc++. It is recommended that you replace the entire
+binutils package with version 2.15 such that "ld --version" responds
+with
+
GNU ld version 2.15+not with:
GNU ld version 2.15.91 20040725+
If you are building LLVM and the GCC front-end under AIX, do NOT use GNU +Binutils. They are not stable under AIX and may produce incorrect and/or +invalid code. Instead, use the system assembler and linker. +
+
Configure and build the LLVM libraries and tools using:
-+
Configure and build the LLVM libraries and tools. There are two ways to +do this: either with objdir == srcdir or not. It is recommended +that srcdir not be the same as objdir:
++ % cd objdir + % srcdir/configure --prefix=/some/path/you/can/install/to [options...] + % gmake tools-only +
% cd llvm - % ./configure [options...] + % ./configure --prefix=/some/path/you/can/install/to [options...] % gmake tools-only --
The use of the non-default target "tools-only" means that the - LLVM tools and libraries will build, and the binaries will be - deposited in llvm/tools/Debug, but the runtime (bytecode) - libraries will not build.
This will build all of the LLVM tools and libraries. The --prefix +option defaults to /usr/local (per configure standards) but unless you are a +system administrator, you probably won't be able to install LLVM there because +of permissions. Specify a path into which LLVM can be installed (e.g. +--prefix=/home/user/llvm).
+Add the directory containing the tools to your PATH.
- % set path = ( `cd llvm/tools/Debug && pwd` $path ) + % set path = ( `cd llvm/Debug/bin && pwd` $path )
Unpack the C/C++ front-end source into cfrontend/src.
Edit src/configure. Change the first line (starting w/ #!) to - contain the correct full pathname of sh.
Make "build" and "install" directories as siblings of the "src" - tree.
+Make "build" and "install" directories as siblings of the "src" tree.
% pwd /usr/local/example/cfrontend/src @@ -86,30 +137,37 @@ process, and you should only try to do it if: % set CFEINSTALL = `pwd`/install
Configure, build, and install the C front-end:
+ +Configure, build, and install the GCC front-end:
-Linux/x86:
-
-MacOS X/PowerPC:
+Linux/x86:
+MacOS X/PowerPC (requires dlcompat library):
+AIX/PowerPC:
% cd build - % ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls --disable-shared \ - --enable-languages=c,c++ - % gmake all-gcc - % setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc + % ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \ + --disable-shared --enable-languages=c,c++ --program-prefix=llvm- + % gmake all; gmake install ++ +
Cygwin/x86:
+ ++ % cd build + % ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \ + --disable-shared --enable-languages=c,c++ --disable-c-mbchar \ + --program-prefix=llvm- % gmake all; gmake install-
-Solaris/SPARC: -
+Solaris/SPARC:
-For Solaris/SPARC, LLVM only supports the SPARC V9. Therefore, the -configure command line should specify sparcv9, as shown below. Also, +For Solaris/SPARC, LLVM only supports the SPARC V9 architecture. Therefore, +the configure command line should specify sparcv9, as shown below. Also, note that Solaris has trouble with various wide (multibyte) character functions from C as referenced from C++, so we typically configure with --disable-c-mbchar (cf. Bug 206). @@ -119,9 +177,7 @@ functions from C as referenced from C++, so we typically configure with % cd build % ../src/configure --prefix=$CFEINSTALL --disable-threads --disable-nls \ --disable-shared --enable-languages=c,c++ --host=sparcv9-sun-solaris2.8 \ - --disable-c-mbchar - % gmake all-gcc - % setenv LLVM_LIB_SEARCH_PATH `pwd`/gcc + --disable-c-mbchar --program-prefix=llvm- % gmake all; gmake install @@ -132,8 +188,8 @@ functions from C as referenced from C++, so we typically configure with
Fix 1: If you have system header files that include
inline assembly, you may have to modify them to remove the inline
- assembly, and install the modified versions in
- $CFEINSTALL/target-triplet/sys-include
.
$CFEINSTALL/lib/gcc/target-triplet/3.4-llvm/include
.Porting to a new architecture: If you are porting the new front-end - to a new architecture, or compiling in a different configuration that we have - previously, there are probably several changes you will have to make to the GCC - target to get it to work correctly. These include:
+
Porting to a new architecture: If you are porting the front-end + to a new architecture or compiling in a configuration that we have + not tried previously, there are probably several changes you will have to make + to the GCC target to get it to work correctly. These include:
Go back into the LLVM source tree proper. Edit Makefile.config
-to redefine LLVMGCCDIR
to the full pathname of the
-$CFEINSTALL
directory, which is the directory you just
-installed the C front-end into. (The ./configure script is likely to
-have set this to a directory which does not exist on your system.)
If you edited header files during the C/C++ front-end build as
-described in "Fix 1" above, you must now copy those header files from
-$CFEINSTALL/target-triplet/sys-include
to
-$CFEINSTALL/lib/gcc/target-triplet/3.4-llvm/include
.
-(This should be the "include" directory in the same directory as the
-libgcc.a library, which you can find by running
-$CFEINSTALL/bin/gcc --print-libgcc-file-name
.)
Build and install the runtime (bytecode) libraries by running:
+Put $CFEINSTALL/bin into your PATH environment +variable.
+Go back into the LLVM source tree proper. Rerun configure, using +the same options as the last time. This will cause the configuration to now find +the newly built llvm-gcc and llvm-g++ executables.
Rebuild your CVS tree. This shouldn't cause the whole thing to be + rebuilt, but it should build the runtime libraries. After the tree is + built, install the runtime libraries into your GCC front-end build tree. + These are the commands you need.
- % gmake -C runtime - % mkdir $CFEINSTALL/bytecode-libs + % gmake % gmake -C runtime install-bytecode - % setenv LLVM_LIB_SEARCH_PATH $CFEINSTALL/bytecode-libs
Optionally, build a symbol table for the newly installed runtime +libraries. Although this step is optional, you are strongly encouraged to +do this as the symbol tables will make a significant difference in your +link times. Use the llvm-ranlib tool to do this, as follows:
++ % cd $CFEINSTALL/lib + % llvm-ranlib libiberty.a + % llvm-ranlib libstdc++.a + % llvm-ranlib libsupc++.a + % cd $CFEINSTALL/lib/gcc/target-triplet/3.4-llvm + % llvm-ranlib libgcc.a + % llvm-ranlib libgcov.a ++
Test the newly-installed C frontend by one or more of the following means:
gmake -C
- test/Programs