[illumos-Discuss] clang/llvm on OpenSolaris 145

Antonio Vieiro antonio at antonioshome.net
Mon Nov 1 02:31:16 PDT 2010


Hi all,

So I've successfully compiled clang/llvm (svn head) on OpenSolaris build 145,
and I'm posting some instructions just in case any of you want to give this
compiler a run.

Requirements:

- Environment as per
  http://illumos.org/projects/illumos-gate/wiki/How_To_Build_illumos
- pkg install pkg:/text/groff too

Build insructions:

- Get the source code:

  cd /code
  svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
  cd llvm/tools
  svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
  cd ../..
  mkdir build
  cd build

- Configure
  ../llvm/configure --prefix=/opt/llvm NM=/usr/sfw/bin/gnm

- Modify a single Makefile
  Edit /code/build/tools/clang/include/clang-c/Makefile
  - Comment lines 23 and 31 (ifneq/endif).

- Make stuff
  gmake
  (about 25 min in my Core2Quad Q6600 @ 2.4Ghz)

- Prepare your path for installation
  Add /usr/perl5/bin to your $PATH (for "pod2html").

- Install
  gmake install

And you should be all set:

opensolaris:~$ llvm-config --version
2.9svn
opensolaris:~$ clang --version
clang version 2.9 (trunk 117853)
Target: i386-pc-solaris2.11
Thread model: posix

Happy hacking,
Antonio



More information about the Discuss mailing list