clang and scanbuild

Craig Rodrigues rodrigc at FreeBSD.org
Wed Feb 11 21:17:07 UTC 2015


Hi,

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?
   (2)  is there enough llvm source in FreeBSD that we can build this in
         FreeBSD instead of checking out llvm source?

--
Craig


More information about the freebsd-toolchain mailing list