[LLVMdev] LLVM's Link Time Optimizer integrated into GNU ld

Chandler Carruth chandlerc at gmail.com
Sun Jan 7 08:29:22 PST 2007


Hello,

I have a very early version of GNU's ld, part of GNU binutils, with LLVM's
Link Time Optimization integrated with it. This allows the linker to link
LLVM bytecode and native objects together into a single executable. It is
still very early in development, and I'll be working on doing more robust
testing on it in the upcoming weeks, but it at least handles simple cases.
If you are interested in trying it out, and providing feedback on how it
performs, especially on some other platforms (mine is amd64-linux), I would
be very interested.

If you are interested in trying this, please pick up the patches to LLVM
from bugs #1055 and #1073, as they are necessary to build LLVM's LTO
suitable to link into binutils. The should be in LLVM's CVS soon, but aren't
yet.

Then use the following monolithic patch from the binutils CVS. It is
monolithic only because binutils includes the verbatim, and automatically
generated configure and Makefile.in scripts. The changes are actually quite
small, and should (hopefully) apply cleanly, even as the CVS moves -- the
files changed for this process are among the least frequently changing in
binutils development.
http://code.chandlerc.net/binutils/binutils-tot.2007.01.06.patch

*or*

Grab a branch of this bzr repository of binutils. I will try and sync it to
CVS every week or so, but it shouldn't be an issue for most people. It will
allow actually tinkering with the implementation in a nice DRCS manner.
http://code.chandlerc.net/binutils/bzr

Finally, configure and build binutils similar to the following

cd ${BINUTILS_OBJ_ROOT}
${BINUTILS_SRC_ROOT}/configure --prefix=${BINUTILS_INSTALL_PATH}
--with-llvm=${LLVM_INSTALL_PATH}
make
make install

where LLVM_INSTALL_PATH is equivalent to the prefix provided LLVM when it
was configured and built. If 'llvm-config' is in your path, then simply
specifying '--with-llvm' may be sufficient, but i haven't tested that
behavior.


Please, comments, suggestions, questions, and bugs are all welcome, and
hopefully this will grow to be a very usable tool.
-Chandler Carruth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070107/26dd4770/attachment.html>


More information about the llvm-dev mailing list