PSA: clang-cl can self host now!

Over the weekend I had a random urge to make clang-cl be able to self host. As of r230539, this should now be possible. Steps to try this out:

  1. Run vcvarsall.bat, same as you would for an MSVC hosted build.
  2. set CC=CXX=clang-cl (make sure it’s in your path
  3. Run CMake as you normally would, no special flags needed.
  4. There is no 4, that’s it!

Currently LLD will not build, so if you have cloned LLD into your repo you will need to not build it. llvm, clang, and lldb should build though, so you can run “ninja lldb clang” for example and produce a working build. I’ve been told that a fix for LLD is forthcoming sometime today or tomorrow.

Feel free to post any issues you encounter.

Nice. This should probably go to on the release notes :slight_smile:

Done: http://llvm.org/viewvc/llvm-project/cfe/branches/release_36/docs/ReleaseNotes.rst?view=markup#l113

We’ve been technically able to self-host for a some time, but now it’s simple as ‘CC=clang-cl CXX=clang-cl cmake’. =D

That’s great!
Especially with Andy’s forthcoming EH Win64 patch.

Over the weekend I had a random urge to make clang-cl be able to self
host. As of r230539, this should now be possible. Steps to try this out:

1) Run vcvarsall.bat, same as you would for an MSVC hosted build.
2) set CC=CXX=clang-cl (make sure it's in your path
3) Run CMake as you normally would, no special flags needed.
4) There is no 4, that's it!

Currently LLD will not build, so if you have cloned LLD into your repo you
will need to not build it. llvm, clang, and lldb should build though, so
you can run "ninja lldb clang" for example and produce a working build.
I've been told that a fix for LLD is forthcoming sometime today or tomorrow.

Hopefully this is now fixed with r230568.

Wait, the change was to trunk, no?

Cheers,
Rafael

True, but we've announced that self-hosting works a few times now, all for
slightly different milestones: 32-bit, x64, and now without manual
rules.ninja edits.

Here I suppose you mean run CMake using -G Ninja right? (It is not possible
to self-host using clang-cl.exe from within MSVC right?)
(Because I normally run CMake to generate MSVC projects)

We've always tested with ninja. Someone should test with VS. clang-cl works
with standard IDE-generated VS projects using MSBuild, though.