Running Smatch on the Wine source code
Using smatch is described in detail on the "Using Smatch!!!" page.Note: You may want to use an older gcc (2.95 and 2.96 reportedly work) to compile the smatch gcc.
Running smatch is basicaly a two steps process:
- Recompiling Wine with the modified gcc.
- Piping the in the previous step generated
*.sm
files through the smatch scripts
- reduces compile time
- prevents some functions (like strdup) to be transformed into complex macros
If you decide to do real smatch work on wine you should switch to out
of source tree builds so your normal wine build won't interfere with the
smatch one. Don't forget to do a "make distclean
" in your
wine source tree before you start the out of source tree builds.
cd $WINESOURCE make distclean cd .. mkdir winebuild cd winebuild mkdir smatch wine cd smatch cat > doit << EOF #!/bin/bash CC="$PATH_TO_SMATCH_GCC/xgcc" CFLAGS="-B$PATH_TO_SMATCH_GCC --smatch" LDFLAGS="-B$PATH_TO_SMATCH_GCC" function mymake() { make CC="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" $* } mymake && exit $WINESOURCE/configure && mymake depend && mymake EOF chmod a+x doit ./doit