SourceForge Logo Smatch Logo

Installing Smatch!!!


Note: gcc-3.1.1 is the only release to use. (There is no good reason for this choice, it was just a milestone to develop against at the time).
  1. Download gcc-3.1.1 (gcc mirrors).
  2. zcat gcc-3.1.1.tar.gz | tar -xv
  3. Download the most recent diff-smatch from sourceforge
  4. cd gcc-3.1.1 && cat ../diff-smatch.<version> | patch -p1
  5. cd ..
  6. mkdir build/
  7. cd build/
  8. ../gcc-3.1.1/configure --prefix=../build --enable-languages=c
  9. make

At this point you will have compiled a program build/gcc/xgcc that can generate Smatch output. Read the section on using Smatch to compile a kernel.

Or to upgrade from a previous version of smatch:

  1. cd gcc-3.1.1
  2. cat ../diff-smatch.<old version> | patch -p1 -R
  3. cat ../diff-smatch.<new version> | patch -p1
  4. cd ../build/ && make