On 3/25/2013 11:40 PM, Joshua Cranmer 🐧 wrote:
As of yesterday, clang static-checking support has been checked into the tree. To use it, compile with clang 3.2 (tip-of-trunk may or may not work) and --enable-clang-plugin on a Linux machine. Mac support is currently not enabled since I don't own a Mac and the build system for this kind of stuff is really, really crappy. It is also not yet usable on try for reasons to do with header incompatibilities, although this will appear to be resolvable within a day or two if things go well.

This is now usable on try. The current complicated steps to do so are:

1. Copy browser/config/tooltool-manifests/linux64/clang.manifest to browser/config/tooltool-manifests/linux64/releng.manifest (you can also do the same for linux32). 2. Edit build/unix/mozconfig.linux to use clang instead of gcc as the compiler, and to add --enable-clang-plugin to the list of options. It should look as follows:
if [ -d "$topsrcdir/clang" ]; then
    # mozilla-central based build
    export CC=$topsrcdir/clang/bin/clang
    export CXX=$topsrcdir/clang/bin/clang++
    export LLVMCONFIG=$topsrcdir/clang/bin/llvm-config
elif [ -d "$topsrcdir/../clang" ]; then
    # comm-central based build
    export CC=$topsrcdir/../clang/bin/clang
    export CXX=$topsrcdir/../clang/bin/clang++
    export LLVMCONFIG=$topsrcdir/../clang/bin/llvm-config
fi

ac_add_options --enable-clang-plugin
3. Push to try that builds on Linux64, debug or opt.

I am currently working with releng to make this process less painful by getting a builder that is dedicated to running these sorts of steps. See bug 851753 for current progress.

As a side note, I will point out that we already have our first static checking failure checked into the tree, thanks to bug 840417.

--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to