Wednesday, February 18, 2009

Goal 0 Completed

Project reference: http://wiki.mozilla.org/LIR_compiler

Goal 0 was completed on Monday - I successfully linked libjs_static.a with the a custom written program. Earlier, what I was doing was trying to build libjs_static.a from scratch all over again, since I thought that was the basic purpose of the makefile. Incidentally, the above mentioned library is not that easy to build(so I realised, the hard way), and I figured that as my first makefile, I wouldn't have been allotted such a difficult task to complete on my own! Putting two and two together and finally making four, I developed a new makefile to link my program with libjs_static.a, and in turn would be built using the default tools already provided with the source tree.

My project directory will be /js/src/build-debug/lirc. The makefile and custom program reside there itself. The makefile used is:
#First makefile!
CC=g++
CPPFLAGS=-DDEBUG -g3 -include ../mozilla-config.h -I../../nanojit -I ../dist/include/js -I../
all: jittest
jittest: jittest.cpp ../libjs_static.a
$(CC) $(CPPFLAGS) -o $@ $^
clean:
rm *.o
rm jittest
TODO: embed VPATH in makefile itself.

Now, task 0 completed, I have to build a parser for raw LIR instructions, and call the corresponding jit methods to convert the instruction into machine code. More on that later.

Thursday, February 12, 2009

Goal 0: step 0!

My project is to develop a standalone compiler for LIR and converting them into corresponding binary code using nanojit library.(https://wiki.mozilla.org/LIR_compiler)

So far, I have made progress on Goal 0 of the project. Goal 0 was:
Write, compile and link a small C++ program with the Nanojit library.
The main aim is to get to link with the Nanojit library. The program I use just includes LIR.h,, and returns 0 from main.

So far, a working makefile has been developed, although the linking part is not yet complete. Again, I ran into some trouble with the usage of my easy build, and the makefile reported some files missing, namely jsautocfg.h and a few others.

jorendorff pointed me to a few links yesterday to correct this problem, and I am going to try to get a working build during the weekend.