changeset 1797:f06356634030

Forwardport --with-additional-vms support. 2009-05-01 Matthias Klose <doko@ubuntu.com> * patches/cacao/launcher.patch: Create new thread depending on the current VM. * Makefile.am (ICEDTEA_PATCHES): Apply unconditionally. (icedtea-against-icedtea): Add dependencies on stamps/add-cacao.stamp, stamps/add-zero.stamp. (icedtea-debug-against-icedtea): Add dependencies on stamps/add-cacao-debug.stamp, stamps/add-zero-debug.stamp. (stamps/add-{cacao,zero}{,-debug}.stamp: New. (clean, stamps/download.stamp, clean-download, stamps/extract.stamp stamps/cacao.stamp): Use BUILD_CACAO instead of WITH_CACAO. (stamps/icedtea.stamp, stamps/icedtea-debug.stamp): Add VM aliases for cacao and zero when configured as ZERO_BUILD or WITH_CACAO. * configure.ac: New option --with-additional-vms=, new conditionals ADD_CACAO_BUILD, ADD_ZERO_BUILD, ADD_SHARK_BUILD, BUILD_CACAO.
author Andrew John Hughes <ahughes@redhat.com>
date Wed, 20 May 2009 20:23:37 +0100
parents 0a36fab09f89
children 7409d7ed0c8b
files ChangeLog HACKING INSTALL Makefile.am NEWS README configure.ac patches/cacao/launcher.patch
diffstat 8 files changed, 268 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed May 20 19:51:45 2009 +0100
+++ b/ChangeLog	Wed May 20 20:23:37 2009 +0100
@@ -1,3 +1,20 @@
+2009-05-01  Matthias Klose  <doko@ubuntu.com>
+
+	* patches/cacao/launcher.patch: Create new thread depending on the
+	current VM.
+	* Makefile.am (ICEDTEA_PATCHES): Apply unconditionally.
+	(icedtea-against-icedtea): Add dependencies on stamps/add-cacao.stamp,
+	stamps/add-zero.stamp.
+	(icedtea-debug-against-icedtea): Add dependencies on
+	stamps/add-cacao-debug.stamp, stamps/add-zero-debug.stamp.
+	(stamps/add-{cacao,zero}{,-debug}.stamp: New.
+	(clean, stamps/download.stamp, clean-download, stamps/extract.stamp
+	stamps/cacao.stamp): Use BUILD_CACAO instead of WITH_CACAO.
+	(stamps/icedtea.stamp, stamps/icedtea-debug.stamp): Add VM aliases
+	for cacao and zero when configured as ZERO_BUILD or WITH_CACAO.
+	* configure.ac: New option --with-additional-vms=, new conditionals
+	ADD_CACAO_BUILD, ADD_ZERO_BUILD, ADD_SHARK_BUILD, BUILD_CACAO.
+
 2009-05-04  Mark Wielaard  <mjw@redhat.com>
 
 	* Makefile.am (icedtea.stamp): Strip client probes from hotspot.stp
--- a/HACKING	Wed May 20 19:51:45 2009 +0100
+++ b/HACKING	Wed May 20 20:23:37 2009 +0100
@@ -70,6 +70,7 @@
 * icedtea-cc-interp-backedge.patch: Remove some duplicated code in DO_BACKEDGE_CHECKS.
 * icedtea-includedb.patch: Add missing include files. (S6793825, mostly applied in b47)
 * icedtea-xml-encodinginfo.patch: Fix possible StackOverflowError in EncodingInfo (PR295).
+* cacao/launcher.patch: For the 'java' command, create new thread depending on the current VM.
 
 The following patches are only applied to OpenJDK6 in IcedTea6:
 
@@ -158,8 +159,6 @@
 
 The following patches are only applied when building with the CACAO virtual machine:
 
-* icedtea-cacao.patch: Don't run 'java' in a new thread.
-
 The following patches are to support Xrender pipeline (-Dsun.java2d.xrender):
 
 * icedtea-xrender-xxx.patch: Numbered patches from xrender branch
--- a/INSTALL	Wed May 20 19:51:45 2009 +0100
+++ b/INSTALL	Wed May 20 20:23:37 2009 +0100
@@ -114,3 +114,20 @@
 --with-cacao-home=<dir> to point to an existing installation which use
 the Sun VM interface.
 
+Building additional virtual machines
+------------------------------------
+
+Although IcedTea can be built multiple times to use a different virtual
+machine, addtional VM's can be built without building the other components
+multiple times.
+
+On architectures where hotspot is available, use
+   --with-additional-vms=cacao,zero  (or shark instead of zero)
+on architectures where only zero (or shark) is available, use
+   --with-additional-vms=cacao
+to build the additional VM's.  It's not possible to build cacao as the
+default VM, and zero as additional VM.
+
+The additional VM's are available by calling the java with the option
+`-cacao' or `-zero' (for shark as well), or by calling the java tools with
+`-J-<vm name>'.
--- a/Makefile.am	Wed May 20 19:51:45 2009 +0100
+++ b/Makefile.am	Wed May 20 20:23:37 2009 +0100
@@ -75,8 +75,13 @@
 if ENABLE_PLUGIN
 	rm -f IcedTeaPlugin.o IcedTeaPlugin.so
 endif
+if BUILD_CACAO
 	rm -rf cacao
+endif
 	rm -f jni-common.o
+if ADD_ZERO_BUILD
+	rm -rf zerovm
+endif
 if BUILD_NATIVE_ECJ
 	rm -f native-ecj
 endif
@@ -1748,7 +1753,7 @@
 	  $(WGET) $(HS_URL)/archive/$(HS_CHANGESET).tar.gz -O $(HOTSPOT_SRC_ZIP) ; \
 	fi
 endif
-if WITH_CACAO
+if BUILD_CACAO
 if !USE_SYSTEM_CACAO
 if USE_ALT_CACAO_SRC_ZIP
 else
@@ -1826,7 +1831,7 @@
 clean-download:
 	rm -f stamps/download.stamp
 	rm -f $(OPENJDK_SRC_ZIP)
-if WITH_CACAO
+if BUILD_CACAO
 	rm -f $(CACAO_SRC_ZIP)
 endif
 if WITH_VISUALVM
@@ -1969,6 +1974,7 @@
 	patches/icedtea-jvmtiEnv.patch \
 	patches/icedtea-xml-encodinginfo.patch \
 	patches/icedtea-cc-interp-backedge.patch \
+	patches/cacao/launcher.patch \
 	$(DISTRIBUTION_PATCHES)
 
 if WITH_RHINO
@@ -1978,7 +1984,6 @@
 
 if WITH_CACAO
 ICEDTEA_PATCHES += \
-	patches/cacao/launcher.patch \
 	patches/cacao/ignore-tests.patch
 endif
 
@@ -2114,7 +2119,7 @@
 	touch stamps/extract.stamp
 
 stamps/extract-cacao.stamp: stamps/extract.stamp
-if WITH_CACAO
+if BUILD_CACAO
 if !USE_SYSTEM_CACAO
 	if ! test -d cacao ; \
 	then \
@@ -2607,6 +2612,12 @@
 	cp $(NETX_RESOURCE_DIR)/about.jnlp \
 	  extra-lib/about.jar \
 	  $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib
+if ZERO_BUILD
+	printf -- '-zero ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg
+endif
+if WITH_CACAO
+	printf -- '-cacao ALIASED_TO -server\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg
+endif
 if ENABLE_SYSTEMTAP
 	mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset ; \
 	grep "client IGNORE" $(BUILD_JRE_ARCH_DIR)/jvm.cfg; \
@@ -2678,6 +2689,12 @@
 	cp $(NETX_RESOURCE_DIR)/default.jnlp \
 	  extra-lib/about.jar \
 	  $(BUILD_OUTPUT_DIR)-debug/j2sdk-image/jre/lib
+if ZERO_BUILD
+	printf -- '-zero ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg
+endif
+if WITH_CACAO
+	printf -- '-cacao ALIASED_TO -server\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg
+endif
 if ENABLE_SYSTEMTAP
 	mkdir -p $(BUILD_OUTPUT_DIR)/j2sdk-image/tapset ; \
 	grep "client IGNORE" $(BUILD_JRE_ARCH_DIR)/jvm.cfg; \
@@ -2703,11 +2720,15 @@
 
 icedtea-against-icedtea: \
 	stamps/bootstrap-directory-symlink.stamp \
-	stamps/icedtea.stamp
+	stamps/icedtea.stamp \
+	stamps/add-cacao.stamp \
+	stamps/add-zero.stamp
 
 icedtea-debug-against-icedtea: \
 	stamps/bootstrap-directory-symlink.stamp \
-	stamps/icedtea-debug.stamp
+	stamps/icedtea-debug.stamp \
+	stamps/add-cacao-debug.stamp \
+	stamps/add-zero-debug.stamp
 
 # OpenJDK ecj Targets
 # ===================
@@ -3012,10 +3033,10 @@
 	touch $@
 
 stamps/cacao.stamp: stamps/extract.stamp stamps/rt-class-files.stamp
-if WITH_CACAO
+if BUILD_CACAO
 if !USE_SYSTEM_CACAO
 	cd cacao/cacao && \
-	./configure \
+	$(ARCH_PREFIX) ./configure \
 	  --host=$(host_alias) \
 	  --build=$(build_alias) \
 	  --target=$(target_alias) \
@@ -3024,7 +3045,7 @@
 	  --with-java-runtime-library-prefix=$(abs_top_builddir)/openjdk \
 	  --with-java-runtime-library-classes=$(abs_top_builddir)/lib/rt \
 	  --enable-jre-layout $(CACAO_CONFIGURE_ARGS); \
-	make -j$(PARALLEL_JOBS) install
+	$(ARCH_PREFIX) $(MAKE) -j$(PARALLEL_JOBS) install
 endif
 endif
 	mkdir -p stamps
@@ -3154,6 +3175,114 @@
 
 # end of pulse-java
 
+# targets for additional VMs
+
+BUILD_JRE_ARCH_DIR = $(BUILD_OUTPUT_DIR)/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
+BUILD_DEBUG_JRE_ARCH_DIR = $(BUILD_OUTPUT_DIR)-debug/j2sdk-image/jre/lib/$(INSTALL_ARCH_DIR)
+
+stamps/add-cacao.stamp: stamps/icedtea.stamp stamps/cacao.stamp
+if ADD_CACAO_BUILD
+	mkdir -p $(BUILD_JRE_ARCH_DIR)/cacao
+	install -m 644 cacao/install/lib/libjvm.so \
+		$(BUILD_JRE_ARCH_DIR)/cacao/
+	install -m 644 cacao/install/jre/lib/$(INSTALL_ARCH_DIR)/server/libjsig.so \
+		$(BUILD_JRE_ARCH_DIR)/cacao/
+	install -m 644 cacao/install/jre/lib/$(INSTALL_ARCH_DIR)/server/Xusage.txt \
+		$(BUILD_JRE_ARCH_DIR)/cacao/
+	printf -- '-cacao KNOWN\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg
+else
+	printf -- '-cacao ERROR\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg
+endif
+	touch $@
+
+stamps/add-cacao-debug.stamp: stamps/icedtea-debug.stamp stamps/cacao.stamp
+if ADD_CACAO_BUILD
+	mkdir -p $(BUILD_DEBUG_JRE_ARCH_DIR)/cacao
+	install -m 644 cacao/install/lib/libjvm.so \
+		$(BUILD_DEBUG_JRE_ARCH_DIR)/cacao/
+	install -m 644 cacao/install/jre/lib/$(INSTALL_ARCH_DIR)/server/libjsig.so \
+		$(BUILD_DEBUG_JRE_ARCH_DIR)/cacao/
+	install -m 644 cacao/install/jre/lib/$(INSTALL_ARCH_DIR)/server/Xusage.txt \
+		$(BUILD_DEBUG_JRE_ARCH_DIR)/cacao/
+	printf -- '-cacao KNOWN\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg
+else
+	printf -- '-cacao ERROR\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg
+endif
+	touch $@
+
+
+# configure script arguments, quoted in single quotes
+CONFIGURE_ARGS = @CONFIGURE_ARGS@
+ADD_ZERO_CONFIGURE_ARGS = \
+	--with-openjdk \
+	--with-openjdk-home=$(abs_top_builddir)/$(BUILD_OUTPUT_DIR)/j2sdk-image \
+	--enable-zero
+if ADD_SHARK_BUILD
+ADD_ZERO_CONFIGURE_ARGS += \
+	--enable-shark
+endif
+ADD_ZERO_CONFIGURE_ARGS += \
+	--disable-docs \
+	$(filter-out '--with-gcj-home=% '--with-ecj=% \
+			'--with-java=% '--with-javah=% \
+			'--with-rmic=% '--with-additional-vms=% \
+			'--with-icedtea '--with-icedtea-home=% \
+			'--with-openjdk '--with-openjdk-home=% , \
+		$(CONFIGURE_ARGS))
+
+ADD_ZERO_EXTRA_BUILD_ENV = \
+	BUILD_LANGTOOLS=false ALT_LANGTOOLS_DIST=$(ICEDTEA_BUILD_DIR)/langtools/dist \
+	BUILD_JAXP=false      ALT_JAXP_DIST=$(ICEDTEA_BUILD_DIR)/jaxp/dist \
+	BUILD_JAXWS=false     ALT_JAXWS_DIST=$(ICEDTEA_BUILD_DIR)/jaxws/dist \
+	BUILD_CORBA=false     ALT_CORBA_DIST=$(ICEDTEA_BUILD_DIR)/corba/dist \
+	BUILD_JDK=false
+
+stamps/add-zero.stamp: stamps/icedtea.stamp
+if ADD_ZERO_BUILD
+	mkdir -p zerovm
+
+	for v in $(ICEDTEA_ENV); do case $$v in PATH=*) ;; *) unset $${v%%=*}; esac; done; \
+	cd zerovm && \
+	    $(ADD_ZERO_EXTRA_BUILD_ENV) \
+		$(ARCH_PREFIX) $(abs_top_srcdir)/configure $(ADD_ZERO_CONFIGURE_ARGS)
+
+	for v in $(ICEDTEA_ENV); do case $$v in PATH=*) ;; *) unset $${v%%=*}; esac; done; \
+	$(ADD_ZERO_EXTRA_BUILD_ENV) \
+		$(ARCH_PREFIX) $(MAKE) -C zerovm $(ICEDTEA_BUILD_TARGET)
+
+	mkdir -p $(BUILD_JRE_ARCH_DIR)/zero
+	cp -a zerovm/openjdk/build/$(OS_DIR)/hotspot/import/jre/lib/$(INSTALL_ARCH_DIR)/server/* \
+		$(BUILD_JRE_ARCH_DIR)/zero/
+	printf -- '-zero KNOWN\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg
+else
+	printf -- '-zero ERROR\n' >> $(BUILD_JRE_ARCH_DIR)/jvm.cfg
+endif
+	touch $@
+
+stamps/add-zero-debug.stamp: stamps/icedtea-debug.stamp
+if ADD_ZERO_BUILD
+	mkdir -p zerovm
+
+	for v in $(ICEDTEA_ENV); do case $$v in PATH=*) ;; *) unset $${v%%=*}; esac; done; \
+	cd zerovm && \
+	    $(ADD_ZERO_EXTRA_BUILD_ENV) \
+		$(ARCH_PREFIX) $(abs_top_srcdir)/configure $(ADD_ZERO_CONFIGURE_ARGS)
+
+	for v in $(ICEDTEA_ENV); do case $$v in PATH=*) ;; *) unset $${v%%=*}; esac; done; \
+	$(ADD_ZERO_EXTRA_BUILD_ENV) \
+		$(ARCH_PREFIX) $(MAKE) -C zerovm $(ICEDTEA_DEBUG_BUILD_TARGET)
+
+	mkdir -p $(BUILD_DEBUG_JRE_ARCH_DIR)/zero
+	cp -a zerovm/openjdk/build/$(OS_DIR)/hotspot/import/jre/lib/$(INSTALL_ARCH_DIR)/server/* \
+		$(BUILD_DEBUG_JRE_ARCH_DIR)/zero/
+	printf -- '-zero KNOWN\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg
+else
+	printf -- '-zero ERROR\n' >> $(BUILD_DEBUG_JRE_ARCH_DIR)/jvm.cfg
+endif
+	touch $@
+
+# end additional VMs
+
 # jtreg
 
 stamps/jtreg.stamp: stamps/icedtea.stamp
--- a/NEWS	Wed May 20 19:51:45 2009 +0100
+++ b/NEWS	Wed May 20 20:23:37 2009 +0100
@@ -6,6 +6,10 @@
   tapset that can be used to dynamically trace execution of java
   applications at runtime. See the tapset/hotspot.stp file for
   documentation of the various trace points and arguments available.
+- Allow building of other virtual machines besides the default VM. Additional
+  virtual machines on architectures where hotspot is available are cacao
+  and zero (or shark), and cacao, where zero (or shark) is available. It's
+  not possible to build cacao as the default VM, and zero as additional VM.
 
 New in release 1.9 (2009-03-20)
 
--- a/README	Wed May 20 19:51:45 2009 +0100
+++ b/README	Wed May 20 20:23:37 2009 +0100
@@ -183,3 +183,21 @@
 optionally the systemtap package at run time when the user want to use
 the tapset to trace java programs. The probes have zero overhead when
 not used and can safely be compiled in even when not used at runtime.
+
+Support for additional VMs
+==========================
+
+Although IcedTea can be built multiple times to use a different virtual
+machine, addtional VM's can be built without building the other components
+multiple times.
+
+On architectures where hotspot is available, use 
+   --with-additional-vms=cacao,zero  (or shark instead of zero)
+on architectures where only zero (or shark) is available, use
+   --with-additional-vms=cacao  
+to build the additional VM's.  It's not possible to build cacao as the 
+default VM, and zero as additional VM.
+
+If the build was configured with --with-additional-vms, the additional VM's
+are available by calling the java with the option `-cacao' or `-zero' (for
+shark as well), or by calling the java tools with `-J-<vm name>'.
--- a/configure.ac	Wed May 20 19:51:45 2009 +0100
+++ b/configure.ac	Wed May 20 20:23:37 2009 +0100
@@ -549,7 +549,39 @@
   fi
 fi
 
-if test "x${ZERO_BUILD_TRUE}" = x; then
+AC_MSG_CHECKING(for --with-additional-vms)
+AC_ARG_WITH(additional-vms,
+            AC_HELP_STRING([--with-additional-vms=vm1,vm2,...], [build additional virtual machines. Valid value is a colon separated string with the backend names `cacao', `zero' and `shark'.]),
+[
+if test x$with_additional_vms != x
+then
+  for vm in `echo $with_additional_vms | sed 's/,/ /g'`; do
+    case "x$vm" in
+      xcacao) add_vm_cacao=yes;;
+      xzero)  add_vm_zero=yes;;
+      xshark) add_vm_shark=yes;;
+      *) AC_MSG_ERROR([proper usage is --with-additional-vms=vm1,vm2,...])
+    esac
+  done
+fi])
+AC_MSG_RESULT($with_additional_vms)
+
+AM_CONDITIONAL(ADD_CACAO_BUILD, test x$add_vm_cacao != x)
+AM_CONDITIONAL(ADD_ZERO_BUILD,  test x$add_vm_zero  != x || test x$add_vm_shark != x)
+AM_CONDITIONAL(ADD_SHARK_BUILD, test x$add_vm_shark != x)
+AM_CONDITIONAL(BUILD_CACAO, test x$add_vm_cacao != x || test "x${WITH_CACAO}" = xyes)
+
+if test "x${WITH_CACAO}" = xyes && test "x${ADD_CACAO_BUILD_TRUE}" = x; then
+  AC_MSG_ERROR([additional vm is the default vm])
+fi
+if test "x${ZERO_BUILD_TRUE}" = x && test "x${ADD_ZERO_BUILD_TRUE}" = x; then
+  AC_MSG_ERROR([additional vm is the default vm])
+fi
+if test "x${USE_SYSTEM_CACAO_TRUE}" = x; then
+  AC_MSG_ERROR([cannot build with system cacao as additional vm])
+fi
+
+if test "x${ZERO_BUILD_TRUE}" = x || test "x${ADD_ZERO_BUILD_TRUE}" = x; then
   dnl Check for libffi headers and libraries.
   PKG_CHECK_MODULES(LIBFFI, libffi,[LIBFFI_FOUND=yes],[LIBFFI_FOUND=no])
   if test "x${LIBFFI_FOUND}" = xno
@@ -567,7 +599,7 @@
 AC_SUBST(LIBFFI_CFLAGS)
 AC_SUBST(LIBFFI_LIBS)
 
-if test "x${SHARK_BUILD_TRUE}" = x; then
+if test "x${SHARK_BUILD_TRUE}" = x || test "x${ADD_SHARK_BUILD_TRUE}" = x; then
   FIND_TOOL([LLVM_CONFIG], [llvm-config])
   llvm_components="engine nativecodegen"
   LLVM_CFLAGS=`$LLVM_CONFIG --cflags $llvm_components | \
@@ -581,4 +613,8 @@
 AC_SUBST(LLVM_LDFLAGS)
 AC_SUBST(LLVM_LIBS)
 
+# Arguments passed to configure.
+AC_SUBST(CONFIGURE_ARGS)
+CONFIGURE_ARGS="$ac_configure_args"
+
 AC_OUTPUT
--- a/patches/cacao/launcher.patch	Wed May 20 19:51:45 2009 +0100
+++ b/patches/cacao/launcher.patch	Wed May 20 20:23:37 2009 +0100
@@ -1,6 +1,6 @@
 diff -Nru openjdk.orig/jdk/make/docs/Makefile openjdk/jdk/make/docs/Makefile
---- openjdk.orig/jdk/make/docs/Makefile	2009-03-19 16:10:56.000000000 +0000
-+++ openjdk/jdk/make/docs/Makefile	2009-03-19 16:12:59.000000000 +0000
+--- openjdk.orig/jdk/make/docs/Makefile	2009-05-19 01:11:05.000000000 +0100
++++ openjdk/jdk/make/docs/Makefile	2009-05-20 20:17:49.000000000 +0100
 @@ -36,7 +36,7 @@
  ifeq ($(ARCH_DATA_MODEL),64)
    MAX_VM_MEMORY = 1024
@@ -11,15 +11,43 @@
  
  #
 diff -Nru openjdk.orig/jdk/src/share/bin/java.c openjdk/jdk/src/share/bin/java.c
---- openjdk.orig/jdk/src/share/bin/java.c	2009-03-19 16:10:56.000000000 +0000
-+++ openjdk/jdk/src/share/bin/java.c	2009-03-19 16:18:16.000000000 +0000
-@@ -1873,7 +1873,8 @@
+--- openjdk.orig/jdk/src/share/bin/java.c	2009-05-19 01:11:05.000000000 +0100
++++ openjdk/jdk/src/share/bin/java.c	2009-05-20 20:22:14.000000000 +0100
+@@ -175,6 +175,8 @@
+   InvocationFunctions ifn;
+ } JavaMainArgs;
+ 
++#define JNI_VERSION_CACAO 0xcaca0000
++
+ /*
+  * Entry point.
+  */
+@@ -1871,6 +1873,8 @@
+ 
+     { /* Create a new thread to create JVM and invoke main method */
+       JavaMainArgs args;
++      struct JDK1_1InitArgs cacao_args;
++      int jvm_init_rv;
+       int rslt;
+ 
+       args.argc = argc;
+@@ -1879,7 +1883,18 @@
        args.classname = classname;
        args.ifn = *ifn;
  
 -      rslt = ContinueInNewThread0(JavaMain, threadStackSize, (void*)&args);
-+      /*rslt = ContinueInNewThread0(JavaMain, threadStackSize, (void*)&args);*/
-+      rslt = JavaMain((void*)&args);
++      memset((void*)&cacao_args, 0, sizeof(cacao_args));
++      cacao_args.version = JNI_VERSION_CACAO;
++
++      jvm_init_rv = ifn.GetDefaultJavaVMInitArgs(&cacao_args);
++      if (_launcher_debug)
++          printf("using cacao as VM: %s\n", (jvm_init_rv == 0) ? "yes" : "no");
++
++      if (jvm_init_rv == 0)
++          return JavaMain((void*)&args);
++      else
++          return ContinueInNewThread0(JavaMain, threadStackSize, (void*)&args);
++
        /* If the caller has deemed there is an error we
         * simply return that, otherwise we return the value of
         * the callee