DragonFly BSD
DragonFly kernel List (threaded) for 2011-10
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Clang and DragonFlyBSD

From: Juan Francisco Cantero Hurtado <iam@xxxxxxxxxxxx>
Date: Fri, 14 Oct 2011 05:05:41 +0200

Hi. I remember in the past someone tried compile DragonFlyBSD with clang
and corrected various warnings and errors. I don't know if this person
continues with this "project" but I think no. Also a few days ago I
found this old page in the wiki
http://www.dragonflybsd.org/docs/developer/clang/ .

DragonFlyBSD works very good with GCC but also clang is very good
reporting errors or inconsistencies in the code. This week I've found a
intermediate solution for to have the best of both worlds without extra

In the "tools" directory of clang exists a tool for generate the same
reports of clang but without using clang for compile. scan-build is a
(perl) wrapper for gcc and generates html reports with the warnings and
errors of clang, but stills compiling the code with gcc (or other
compiler). http://clang-analyzer.llvm.org/scan-build.html .

I think this tool is perfect for complement the daily snapshots build.
The developers don't need work with two compilers different and they can
look just the results in the server. scan-build generates static
html files, so you can copy the directory with the results to
http://mirror-master.dragonflybsd.org/snapshots/ .

# cd /usr/src
# scan-build make nativekernel

This command generates the binaries with gcc but create a directory
with the reports in /tmp:
(download, decompress and open the index.html file)

The clang version in pkgsrc doesn't install scan-build. I've reported
the problem to the maintainer. Anyway, exists a temporary solution for
this problem:

- Install clang from pkgsrc.
- Download the latest build for OSX of scan-build from
http://clang-analyzer.llvm.org/installation.html .
- Console:
# tar -xjf checker-257.tar.bz2
# cd checker-257
# rm -Rf bin # (with this scan-build will use the clang in PATH)
# export PATH=$PATH:`pwd`
# cd /usr/src
# scan-build make buildkernel

Let me know if you have any question. Cheers :)

-- Juan Francisco Cantero Hurtado http://juanfra.info

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]