Archive

Posts Tagged ‘gcc’

Compiling nestedVM on Ubuntu 10.04 (Lucid Lynx)

2 septembre 2010 1 commentaire

nestedVM is a cool tool for translating running c/c++ code into java bytecode. I tried to follow the little tutorial that
can be found at http://wiki.brianweb.net/NestedVM/QuickStartGuide, but there were many problems with my favourite distro

Here is how i finally managed to compile the tool, and the mips cross compiler that comes with it :

1) check you own the following packages :
sudo apt-get install openjdk-6-jdk curl darcs texinfo g++

2) get the latest nestedVM release,

curl http://nestedvm.ibex.org/dist/nestedvm-2009-08-09.tgz > nestedvm-2009-08-09.tgz
tar -zxvf nestedvm-2009-08-09.tgz

3) arghh the old version of binutils that is used by default produces crashing executables, you’ll have to tell the
makefile that you want the latest one instead (binutils 2.20.1).

sed -i 's/version_binutils = 2\\.6/version_binutils = 2\\.20\\.1/'  ./nestedvm-2009-08-09/upstream/Makefile

4) as we changed the version for binutils, one of the provided patch do not work anymore

echo '' >  ./nestedvm-2009-08-09/upstream/binutils-no64.patch

5) the url for one file is outdated. In upstream/Makefile, I had to download it manually, and then replace the url_regex property in upstream/Makefile with
the pseudo-url of the manually downloaded file : url_regex = file:///home/julien/Telechargements/regex3.8a.tar.gz

TIP : During the installation, the makefile tries to download newlib from redhat ftp, which is REAL SLOW,
so gave up and tried an http mirror : In the file ‘upstream/Makefile’, I replaced ftp://sources.redhat.com/pub/newlib/
by  http://www.mirrorservice.org/sites/sourceware.org/pub/newlib/

TIP : If something fails during download, you’ll have to manually remove one of the files that were created
in the ./nestedvm-2009-08-09/upstream/tasks directory before relaunching make. removing the corrupted tar is not sufficient.

6) use the following make command, instead of simply typing ‘make’ :
cd ./nestedvm-2009-08-09/upstream && make CC='gcc -D_FORTIFY_SOURCE=0'

7) at the beginning of the compilation, you may have a complaint about a patch that was already applied. Just skip it (type y)

6) Wait a bit, have a coffe. or two.

When it’s over, you’ll have the mips-* tools compiled gently, you can follow the end of the initially suggested procedure

Publicités
Catégories :Uncategorized Étiquettes : , , ,