clang and scanbuild
Dimitry Andric
dim at FreeBSD.org
Wed Feb 11 21:43:17 UTC 2015
On 11 Feb 2015, at 22:17, Craig Rodrigues <rodrigc at FreeBSD.org> wrote:
>
> We currently have a Jenkins job which checks out llvm trunk and builds
> it like this:
>
> svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
> cd llvm
> ./configure --enable-optimized --disable-assertions --disable-docs
> --enable-targets=host \
> --with-c-include-dirs=${WORKDIR}/obj${WORKDIR}/src/tmp/usr/include \
> --with-cxx-include-root=${WORKDIR}/obj${WORKDIR}/src/tmp/usr/include
>
> gmake -j4
>
> cp -p ./tools/clang/tools/scan-build/scan-build \
> ./tools/clang/tools/scan-build/scanview.css \
> ./tools/clang/tools/scan-build/sorttable.js \
> Release/bin
>
> cp -p ./tools/clang/tools/scan-build/ccc-analyzer \
> ./tools/clang/tools/scan-build/c++-analyzer \
> Release/bin
>
> We then do this to invoke scan-build over the FreeBSD tree:
>
> /usr/bin/time -l \
> env CCC_ANALYZER_CHECKER_DEADCODE=0 \
> ${SCAN_BUILD} \
> --use-cc ${OBJ}${SRCDIR}/tmp/usr/bin/cc \
> --use-c++ ${OBJ}${SRCDIR}/tmp/usr/bin/c++ \
> -k -o $output make ${JFLAG} $MYFLAGS \
> CROSS_COMPILER_PREFIX=${OBJ}${SRCDIR}/tmp/usr/bin/ "$@"
>
>
> We can continue to do this, but I was wondering if:
> (1) is there a FreeBSD port which has this stuff?
Yes, choose either lang/clang-devel, or lang/clangXY, where XY is the
version you are interested in.
> (2) is there enough llvm source in FreeBSD that we can build this in
> FreeBSD instead of checking out llvm source?
You can already run the analyzers with the clang executable in base,
unless you built your world using WITHOUT_CLANG_FULL. You do need perl
installed, of course.
-Dimitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-toolchain/attachments/20150211/ad7a0d75/attachment.sig>
More information about the freebsd-toolchain
mailing list