[llvm-dev] Building LLVM and Clang using Clang?

Dan Liew via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 9 11:08:13 PDT 2015


Hi Greg,

On 9 September 2015 at 10:55, Greg Stark via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Try as I might I can't seem to get LLVM to bulid using clang/clang++.
> No matter what I do it insists on using /usr/bin/cc and /usr/bin/c++
> which are gcc. Am I missing something obvious? I vaguely remember some
> document describing a stage1 compiler built by your old toolchain and
> a stage2 compiler but I can't find the steps to do that any more.
>
>
> $ CC=/usr/local/bin/clang CXX=/usr/local/bin/clang++  cmake
> -DCMAKE_BUILD_TYPE=Release -Wno-dev ~/src/llvm
> -- Target triple: x86_64-unknown-linux-gnu

CMake will only detect the compiler once in a build directory. Based
on the console output you show the tests checking the capabilities of
the compiler and system headers **aren't being run**
which means you must have run cmake in the build directory previously
and now those results of testing the host compiler have been cached.

The easiest thing to do is just delete your entire build directory and
run CMake again. You could try deleting your CMake cache
(CMakeCache.txt) and rerunning CMake but I'm not sure if that will
work correctly.

HTH,
Dan.


More information about the llvm-dev mailing list