Static Analysis/Installing the Oink Stack: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(How to do pork, first-cut)
 
(committed hackery upstream)
Line 34: Line 34:
hg -R oink-stack/elsa update -C tip
hg -R oink-stack/elsa update -C tip
hg -R oink-stack/oink update -C tip</pre>
hg -R oink-stack/oink update -C tip</pre>
In order to get dehydra linking properly, I had to patch elsa/configure.pl:
<pre>--- a/configure.pl
+++ b/configure.pl
@@ -41,6 +41,8 @@ my @config_vars = qw(
# defaults
#  my $BASE_FLAGS = "-g -Wall -Wno-deprecated -D__UNIX__";
my @CFLAGS_EXTRA = ();
+
+push @CFLAGS_EXTRA, "-DXP_UNIX";
# true if we want to link with zipios
my $USE_ZIPIOS = 1;</pre>


Build it.
Build it.

Revision as of 19:22, 19 October 2007

This is a kinda rough scratchpad for how to install and use the oink stack on a Linux system to do Static Analysis.

Base system: FC7

Install GCC 3.4

sudo yum install compat-gcc-34
sudo yum install compat-gcc-34-c++

You may want to do a test-build of Mozilla at this point to make sure that it builds and links correctly.

Build and Install MCPP

svn co https://mcpp.svn.sourceforge.net/svnroot/mcpp/trunk mcpp
cd src
./configure --enable-replace-cpp CC=gcc34 CXX=g++34
make
sudo make install

Get Spidermonkey

System spidermonkey is used by dehydra:

sudo yum install js-devel

Do the oink thing

wget http://people.mozilla.org/~tglek/checkout.sh
sh checkout.sh http://hg.mozilla.org

Now, depending on your version of hg, you may need to manually update the working directory for elsa and elkhound:

hg -R oink-stack/elkhound update -C tip
hg -R oink-stack/elsa update -C tip
hg -R oink-stack/oink update -C tip

Build it.

cd oink-stack;
make

Building Mozilla with MCPP

To build Mozilla with MCPP to generate annotated .ii files, use the following configure command:

ac_cv_visibility_hidden=no CC="gcc34 -save-temps -Wp,-W0,-K" CXX="g++34 -save-temps -Wp,-W0,-K" CPPFLAGS=-DNS_DISABLE_LITERAL_TEMPLATE $srcdir/configure --enable-debug --disable-optimize --disable-accessibility --enable-application=browser --disable-crashreporter

Building will probably require disabling WARNINGS_AS_ERRORS:

make WARNINGS_AS_ERRORS=