[llvm-commits] [dragonegg] r133427 - in /dragonegg/trunk: Makefile README extras/do_self_strap gcc-patches/ www/index.html

Duncan Sands baldrick at free.fr
Mon Jun 20 00:43:10 PDT 2011


Author: baldrick
Date: Mon Jun 20 02:43:10 2011
New Revision: 133427

URL: http://llvm.org/viewvc/llvm-project?rev=133427&view=rev
Log:
Dragonegg no longer requires a patched version of gcc.  Update the docs
to reflect that.  Also, change the Makefile so that it defaults to
building for "gcc" rather than "gcc-4.5".  Use the GCC variable to
override as explained in the README.

Removed:
    dragonegg/trunk/gcc-patches/
Modified:
    dragonegg/trunk/Makefile
    dragonegg/trunk/README
    dragonegg/trunk/extras/do_self_strap
    dragonegg/trunk/www/index.html

Modified: dragonegg/trunk/Makefile
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Makefile?rev=133427&r1=133426&r2=133427&view=diff
==============================================================================
--- dragonegg/trunk/Makefile (original)
+++ dragonegg/trunk/Makefile Mon Jun 20 02:43:10 2011
@@ -1,5 +1,5 @@
 # Specify the gcc executable you will use the dragonegg plugin with here.
-GCC?=gcc-4.5
+GCC?=gcc
 
 # Specify the copy of LLVM you will build the plugin against by giving its
 # llvm-config here.  To use an installed copy of LLVM, specify the installed

Modified: dragonegg/trunk/README
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/README?rev=133427&r1=133426&r2=133427&view=diff
==============================================================================
--- dragonegg/trunk/README (original)
+++ dragonegg/trunk/README Mon Jun 20 02:43:10 2011
@@ -2,95 +2,60 @@
 - BUILD INSTRUCTIONS -
 ----------------------
 
-Step 0: Build and install llvm
-------------------------------
+Prerequisites
+-------------
 
-I'm assuming anyone reading this knows how to build and install llvm.
-You need the latest llvm from the subversion repository.
+The dragonegg plugin works with gcc 4.5 or gcc 4.6, so you will need to have one
+of these installed.  Many linux distributions ship one or both of them, perhaps
+as an addon package; binaries can be downloaded for most platforms.  Otherwise
+you can always build one of these gcc versions yourself.  Both plugin support
+(--enable-plugin) and support for link time optimization (--enable-lto) need
+to be enabled in gcc, but since they are enabled by default on most platforms
+this should be the case.
 
-Step 1: Build gcc
------------------
+Step 0: Build and install llvm
+------------------------------
 
-Obtain a copy of the source code for the gcc-4.5 release.  You can get it from
-one of the gcc mirrors, see http://gcc.gnu.org/mirrors.html.  Alternatively, you
-can use the gcc-4.5 branch of the gcc subversion repository:
-  svn checkout svn://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch SomeLocalDir
-If you are feeling brave then you can try gcc mainline:
-  svn checkout svn://gcc.gnu.org/svn/gcc/trunk SomeLocalDir
-Changes on gcc mainline occasionally break the plugin, so your mileage may vary.
-You can find a subversion revision number that is known to work well in the file
-gcc_revision_tested_with (in the same directory as this README).
-
-Apply the patches in the gcc-patches subdirectory, if any.  The following should
-do the trick ("SomeLocalDir" is where you checked/unpacked the gcc source):
-  cat gcc-patches/*.diff | patch -d SomeLocalDir -p1
-
-Configure gcc with your favorite options and also with --enable-plugin and
---enable-lto.  Build gcc and install it somewhere.  If you don't have libelf
-installed then the configure step may fail because the configure script thinks
-that LTO requires libelf, though in fact it does not when using dragonegg.  See
-  http://gcc.gnu.org/wiki/LinkTimeOptimization#Building_the_branch
-In theory the gcc you build can be a cross-compiler, and the plugin should work
-and build code for the targeted platform.  I don't think anyone has ever tried
-this though.
-
-Darwin special: the gcc configure script thinks darwin doesn't support dynamic
-libraries and concludes that plugins won't work.  You can find patches to fix
-this here:
-http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00610.html
-NOTE: This may be fixed in gcc mainline (gcc 4.6).
-
-Darwin special 2: the gcc configure script thinks darwin doesn't support LTO
-because it is not an ELF platform.  Dragonegg repurposes the LTO infrastructure,
-and thus needs LTO support enabled, but it makes no use of the parts of LTO that
-require ELF.  You just need to turn off the ELF check in the configure script.
-If anyone has a patch to do this, I will be happy to add it here!
-NOTE: This is fixed in gcc mainline (gcc 4.6).
+I'm assuming anyone reading this knows how to build and install llvm.  The
+version of llvm must match the version of the plugin, so if you are building
+dragonegg-3.0 then you should use llvm-3.0, while if you are building the
+development version of dragonegg then use the development version of llvm.
 
 
-Step 2: Build the plugin
+Step 1: Build the plugin
 ------------------------
 
 Build the plugin like this:
-  GCC=PATH_TO_JUST_INSTALLED_GCC make
-This should be done in the directory containing this README.
+  GCC=PATH_TO_INSTALLED_GCC make
+This command should be executed in the directory containing this README.
 
 The plugin needs to know about the version of gcc it will be loaded into, which
-is why you need to specify the gcc installed in step 1 via the GCC variable like
-this.  If you have arranged for the new gcc to occur in your path with the name
-gcc-4.5 (using a symbolic link for example) then you can build the plugin using:
+is why you need to specify your version of gcc 4.5/4.6 via the GCC variable like
+this.  If you don't set the GCC variable then by default "gcc" is used, so you
+can just do
   make
+to build if your system gcc is gcc version 4.5 or 4.6.
+
 The plugin is compiled using the system compiler, and not with the gcc specified
-in the GCC variable (which wouldn't work if you built a cross compiler).  If you
-want to also compile the plugin with the new gcc, you can do:
-  CC=PATH_TO_JUST_INSTALLED_GCC CXX=PATH_TO_JUST_INSTALLED_GCC GCC=PATH_TO_JUST_INSTALLED_GCC make
+in the GCC variable (which wouldn't work if it is a cross compiler).  If you
+want to also compile the plugin with your copy gcc 4.5/4.6, you can do:
+  CC=PATH_TO_INSTALLED_GCC CXX=PATH_TO_INSTALLED_GCC GCC=PATH_TO_INSTALLED_GCC make
 
 The build system runs the "llvm-config" program (which should be in your path if
-you installed LLVM properly in step 0) to find out about the copy of LLVM you
+you installed llvm properly in step 0) to find out about the copy of LLVM you
 installed, so there is no need to tell the build system explicitly about LLVM.
 If llvm-config is not in your path then you can specify where to find it using
 the LLVM_CONFIG variable.
 
 The end result of the build is a shared library, dragonegg.so.
 
--------------------------
-- COMMON BUILD PROBLEMS -
--------------------------
-
-To build gcc-4.5 you need the GMP, MPC and MPFR libraries.  If you installed the
-libraries locally, so their header files are not in the standard system include
-path, then the dragonegg build will probably fail due to failing to find header
-files like mpc.h.  To solve this, use CPPFLAGS to add additional include paths,
-for example:
-  CPPFLAGS="-I/path/to/header/files" make
-
 
 ----------------------
 - USAGE INSTRUCTIONS -
 ----------------------
 
 Run gcc as usual, but pass -fplugin=./dragonegg.so as an extra command line
-argument.  Make sure you use the gcc you installed above, not the system gcc!
+argument.  Make sure you use the gcc you built dragonegg against (see step 1)!
 
 
 ------------------

Modified: dragonegg/trunk/extras/do_self_strap
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/extras/do_self_strap?rev=133427&r1=133426&r2=133427&view=diff
==============================================================================
--- dragonegg/trunk/extras/do_self_strap (original)
+++ dragonegg/trunk/extras/do_self_strap Mon Jun 20 02:43:10 2011
@@ -100,19 +100,11 @@
   svn co -r $GCC_REVISION svn://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch $GCC_SOURCE
 elif [ ! -L $GCC_SOURCE ] ; then	# Do not update symbolic links.  This is
 					# for the benefit of the buildbots.
-  echo "Reverting any applied patches"
-  svn revert -R $GCC_SOURCE/gcc
   echo "Updating GCC"
   svn update -r $GCC_REVISION $GCC_SOURCE
 fi
 
 
-# Apply any needed patches to GCC
-for PATCH in $DRAGONEGG_SOURCE/gcc-patches/*.diff ; do
-  echo "Applying patch $PATCH"
-  patch -d $GCC_SOURCE -p1 < $PATCH
-done
-
 PLUGIN_OPTION= # No plugin yet
 PREV_DRAGONEGG_BUILD= # No previous dragonegg
 for STAGE in $STAGES ; do

Modified: dragonegg/trunk/www/index.html
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/www/index.html?rev=133427&r1=133426&r2=133427&view=diff
==============================================================================
--- dragonegg/trunk/www/index.html (original)
+++ dragonegg/trunk/www/index.html Mon Jun 20 02:43:10 2011
@@ -37,19 +37,22 @@
   <!--=====================================================================-->
 
   <ul>
-  <li>C works well, for example you can build a working gcc using it</li>
+  <li>C works well, for example you can build a working gcc using it.</li>
   <li>C++ works fairly well, for example you can build LLVM, clang and boost
   with it (the resulting LLVM and clang work correctly; boost mostly works but
-  there are some mysterious failures)</li>
+  there are some mysterious failures).</li>
   <li>Fortran works fairly well, for example SPEC CPU mostly compiles and works,
-  but there are some failures</li>
+  but there are some failures.  These have all been fixed in the development
+  version.</li>
   <li>It can compile quite a lot of Ada, and the compiled code mostly seems to
-  work</li>
-  <li>It can compile a small amount of Obj-C and Obj-C++</li>
-  <li>It can compile simple Java programs</li>
-  <li>Limited debug info</li>
-  <li>Requires patching gcc</li>
-  <li>Only supports x86-32 and x86-64</li>
+  work.</li>
+  <li>It can compile a small amount of Obj-C and Obj-C++.</li>
+  <li>It can compile simple Java programs, but they don't execute properly
+  (this is a consequence of the java front-end not supporting GCC's LTO).</li>
+  <li>Limited debug info.</li>
+  <li>Versions 2.9 and earlier require patching gcc (the development version
+  does not).</li>
+  <li>Only supports x86-32 and x86-64.</li>
   <li>Only supports linux, darwin and freebsd (additional gcc patches may be
       needed on darwin, see the <tt>README</tt> file).
   </ul>
@@ -278,12 +281,7 @@
      <pre>	svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm</pre>
   <p><a href="http://llvm.org/docs/GettingStarted.html">Build LLVM</a> in the
   usual way.</p>
-  <p>Get the <a href="http://gcc.gnu.org/gcc-4.5/">gcc-4.5 source code</a>:</p>
-     <pre>	svn co http://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch gcc-4.5</pre>
-  <p>Apply all of the patches in <tt>dragonegg/gcc-patches/</tt>, if any, to the
-     gcc-4.5 source. You need to pass the <tt>-p1</tt> option to <tt>patch</tt>.
-     <a href="http://gcc.gnu.org/install/">Build and install gcc-4.5</a> in the
-     usual way.</p>
+  <p>Install gcc-4.5 or gcc-4.6 (you do not need to build your own copy).</p>
   <p>Doing</p>
      <pre>	GCC=path_to_just_installed_gcc make</pre>
   <p>in the <tt>dragonegg</tt> directory should then build <tt>dragonegg.so</tt>.





More information about the llvm-commits mailing list