RFC: JamVM - Taste the New Flavour! - Implementation comments

Xerxes Ranby xerxes at zafena.se
Sat Feb 19 14:22:36 PST 2011


On 2011-02-19 21:20, Xerxes Ranby wrote:
> Greetings!
>
> "JamVM's got a shiny new Git repository, which contains the port to 
> the OpenJDK class-library."
> http://draenog.blogspot.com/2011/02/openjdkjamvm-git-repository.html
>
> The attached patch adds Robert Lougher's new JamVM flavour to Icedtea6!
>

Some comments to various parts of the patch while i have it fresh in my 
mind:
The patch mimics how CACAO got integrated into IcedTea6.
When creating the patch I decided to only implement two ways of 
configuring IcedTea6 to use jamvm namely --enable-jamvm and 
--with-additional-vms=jamvm

########## Implementation notes of the --enable-jamvm option
--enable-jamvm

This configure option makes the IcedTea6 build use the OpenJDK
ALT_HOTSPOT_IMPORT_PATH variable to install JamVM as the default VM of 
the build.

The only problem by using the ALT_HOTSPOT_IMPORT_PATH functionality to 
import JamVM are that the OpenJDK makefiles assumes that some hotspot 
specific files and one architecture-name-dependent folder exist in the 
import path:

jre/lib/amd64/libjsig.so
jre/lib/amd64/server/libjvm.so
jre/lib/amd64/server/Xusage.txt
jre/lib/amd64/client

JamVM itself only needs and builds the libjvm.so file.
The way I solved this was to transform the JamVM install path into what 
looked like a hotspot import path by adding empty files for libjsig.so 
and Xusage.txt and create the needed directory structure, like this:

+stamps/jamvm.stamp: $(OPENJDK_TREE) stamps/rt.stamp
+if BUILD_JAMVM
+	cd jamvm/jamvm&&  \
+	./autogen.sh --with-java-runtime-library=openjdk \
+	  --prefix=$(abs_top_builddir)/jamvm/install ; \
+	$(MAKE) ; \
+	$(MAKE) install
+	mkdir -p $(abs_top_builddir)/jamvm/install/hotspot/jre/lib/$(INSTALL_ARCH_DIR)/server
+	cp $(abs_top_builddir)/jamvm/install/lib/libjvm.so $(abs_top_builddir)/jamvm/install/hotspot/jre/lib/$(INSTALL_ARCH_DIR)/server
+	ln -s server $(abs_top_builddir)/jamvm/install/hotspot/jre/lib/$(INSTALL_ARCH_DIR)/client
+	touch $(abs_top_builddir)/jamvm/install/hotspot/jre/lib/$(INSTALL_ARCH_DIR)/server/Xusage.txt
+	touch $(abs_top_builddir)/jamvm/install/hotspot/jre/lib/$(INSTALL_ARCH_DIR)/libjsig.so
+endif


########## Implementation notes of the --with-additional-vms=jamvm option
--with-additional-vms=jamvm

This configure option makes the IcedTea6 build inserts JamVM as one additional vm
of hotspot.
JamVM gets installed in its own folder jamvm next to the regular Hotspot server and client folders.
jvm.cfg files gets updated so that jamvm can get started by running
java -jamvm
implemented like this:
+stamps/add-jamvm.stamp: stamps/icedtea.stamp stamps/jamvm.stamp
+if ADD_JAMVM_BUILD
+	mkdir -p $(BUILD_JRE_ARCH_DIR)/jamvm
+	install -m 644 jamvm/install/lib/libjvm.so \
+		$(BUILD_JRE_ARCH_DIR)/jamvm/
+	printf -- '-jamvm KNOWN\n'>>  $(BUILD_JRE_ARCH_DIR)/jvm.cfg
+else

This way are in my opinion the cleanest way to install JamVM into OpenJDK.

########## Comments to the rest of the patch ?

I have to write a proper ChangeLog that mention all added macros and 
defines.

Not much to say mostly autoconf related... The rest of the patch makes 
sure that the new configure options are available, sees that JamVM gets 
downloaded and extracted and also it makes sure that the jvm.cfg gets 
updated correctly dependent on which configure option are used.

A special note, In Makefile.am .PHONY target:

@@ -582,8 +604,10 @@
  	clean-icedtea icedtea-against-icedtea clean-icedtea-ecj \
  	clean-tools-jar clean-copy clean-rt hotspot \
  	hotspot-helper clean-extra clean-jtreg clean-jtreg-reports \
-	clean-add-zero clean-add-zero-debug clean-icedtea clean-icedtea-debug
-	clean-icedtea-against-ecj clean-cacao clean-add-cacao clean-add-cacao-debug \
+	clean-add-zero clean-add-zero-debug clean-icedtea clean-icedtea-debug \
+	clean-icedtea-against-ecj \
+	clean-jamvm clean-add-jamvm clean-add-jamvm-debug \
+	clean-cacao clean-add-cacao clean-add-cacao-debug \
  	clean-ports clean-overlay clean-extract-ecj clean-extract clean-extract-openjdk \
  	clean-replace-hotspot clean-generated clean-download clean-hgforest clean-download-openjdk \
  	clean-rewriter clean-rewrite-rhino clean-add-systemtap clean-add-systemtap-debug \


While adding all clean*jamvm targets to this part i noticed a missing \ 
after clean-icedtea-debug so i added it. I hope this change makes the 
make clean target better.

Cheers
Xerxes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20110219/22c4513a/attachment.html 


More information about the distro-pkg-dev mailing list