Building clang 3.0 and later on Ubuntu 10.4 (64 bit) on AMD64

I am having big problems building clang 3.0 and later on Ubuntu 10.4 (64 bit) on AMD64.


The documentation appears to indicate that llvm-gcc is no longer supported and there is no version for llvm 3.0. In other places the documentation tells how to provide a link to it.

In the DragonEgg section there is this note but no clue where to get these:

Patching and building GCC is no longer required: the plugin should work with your system GCC (version 4.5 or 4.6; on Debian/Ubuntu systems the gcc-4.5-plugin-dev or gcc-4.6-plugin-dev package is also needed).

Is there one for gcc 4.4 as well?


I have tried a lot of different things but they all end up with errors like this which are I think caused by trying to link a 32 bit binary with a 64 bit library. This is probably because the way that Debian and Ubuntu store libraries is the problem.

llvm[3]: Linking Debug+Asserts Loadable Module
/usr/bin/ld: /usr/lib/llvm/gcc-4.2/lib/gcc/x86_64-linux-gnu/4.2.1/../../../../lib64/libstdc++.a(new_op.o): relocation R_X86_64_32S against `vtable for std::bad_alloc' can not be used when making a shared object; recompile with -fPIC
/usr/lib/llvm/gcc-4.2/lib/gcc/x86_64-linux-gnu/4.2.1/../../../../lib64/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

I have the same problem on both the LLVM 3.0 sources and also the current SVN.

Using binaries.

There is no binary supplied for Ubuntu 10.4 - there is for 11.4. Ubuntu 10.4 is a long life release. Please supply a binary for it. I have used the 11.4 binaries but to do so I needed to change the version of to avoid link time errors. I have used this: libstdc++6_4.6.3-1_amd64.deb
from here:

This works, but involves breaking my system setup.

I hope there is a way to build llvm and clang 3.0 and later for Ubuntu 10.4 but I have not found it yet.

I am a keen user of clang which helps a lot with C++ development. I don't want to have to upgrade my Ubuntu setups at this point. Please help

John Fletcher

Solution discovered to the build problem. Ubuntu 10.4 provides clang and llvm 2.7 and these were installed.

Deleting these packages removes the build problem. I have now been able to build clang 3.1