[cfe-dev] Living on Clang

Douglas Gregor dgregor at apple.com
Thu Apr 15 08:18:01 PDT 2010

On Apr 15, 2010, at 8:04 AM, David Chisnall wrote:

> On 14 Apr 2010, at 21:51, Douglas Gregor wrote:
>> Helping is easy: just build Clang on your platform and start using it as your main compiler for LLVM and Clang development
> I never bother installing clang - I just add the build location to my path, which saves some time and disk space.  Unfortunately, this makes it impossible to build clang with clang, because it's replacing the libraries and executable while building.  

I suggest keeping a separate Clang-built-Clang that you live on, and update periodically to known-good revisions. Otherwise, you're likely to end up with a broken host compiler when something goes wrong on the trunk, which is a complete waste of time. Personally, I update my host Clang each morning to a version that has passed self-host + test.

> Would it be possible for the LLVM / Clang makefiles to build these files with a temporary name and then move them over the originals when the build process is finished?  This would make it much easier to live on clang.

A top level "bootstrap" target would address this issue better. I'd be opposed to having the normal build create temporary compilers that get moved over the originals, because that's more build-system ugliness to confuse IDEs and users alike.

> I also had problems last time I tried building LLVM with clang - apparently the makefiles were not respecting the CXX environment variable, so you need a complete reconfigure, which is incredibly irritating.  With other projects I test with GCC and clang just by doing:
> $ gmake CC=clang
> $ gmake clean
> $ gmake CC=gcc

gmake CXX=clang++ CC=clang

should work fine with the normal makefiles.

	- Doug

More information about the cfe-dev mailing list