From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p5L5dWhm006169 for ; Tue, 21 Jun 2011 07:39:32 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqYBAB4uAE5KfVM2kWdsb2JhbAApFQEDEp5lAYcaYAgUAQEBAQkLCwcUBCGJGJ9KgkqMPIJHhFY5iGYBAQMGhiQEhxqKRIt4PINS X-IronPort-AV: E=Sophos;i="4.65,398,1304287200"; d="scan'208";a="101666371" Received: from mail-gw0-f54.google.com ([74.125.83.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Jun 2011 07:39:26 +0200 Received: by gwb15 with SMTP id 15so1414956gwb.27 for ; Mon, 20 Jun 2011 22:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=Y5iyiwdHpG+vrZSX/U23dsiklEEbO3Ps6vfu0vIQfek=; b=JGRMKmUsHwmgv8KrkYXvRyKAdw1GdEOmDbI1wqwhVtZbGXavPN13BfqXlkP4xE+XWA s/wLyoi5lzkUX+3VGvAAR6/uHkWzGtd2QwUfoWuC8Z0RKmy9GSMBasFC4ubzNLu4IrUi L06b0hgTqkmVffXqazMuRpFfqu0V6XHKnOIjk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ati1tbs66l208tlfcHYuBLd1SMVT9FlvVA0o+PYvLN/X8bvwxQao1B42JvebPAsZkx rk2UrkHC+BXQTdUisU50tZ+X2VA1hrOROoLOCo1OgXlrnSDR+S0g4iiXsJJ+CTORTwaJ sc6DxwwsR7pUj9AKZ03qMUWX1tTRgxClUicT0= MIME-Version: 1.0 Received: by 10.236.108.134 with SMTP id q6mr9416185yhg.343.1308634765090; Mon, 20 Jun 2011 22:39:25 -0700 (PDT) Received: by 10.236.47.135 with HTTP; Mon, 20 Jun 2011 22:39:25 -0700 (PDT) Date: Tue, 21 Jun 2011 09:39:25 +0400 Message-ID: From: SerP To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=90e6ba53a60250601904a6324671 Subject: [Caml-list] Ocaml on android and ios --90e6ba53a60250601904a6324671 Content-Type: text/plain; charset=ISO-8859-1 Hello! I have been developing a framwork on ocaml for mobile platforms. The main idea is to create a universal 2D framework for game development. I started with porting "sparrow" http://www.sparrow-framework.org framework from objc to ocaml. Repository https://github.com/serp256/Lightning. The repository does not include the entire project yet, I will commit the rest as soon as possible. I have successfully launched the project on iOS, and SDL version on macosx and linux. Now I'm trying to port it on android, and after that there will be an official release of the framework with the first game on it. However, I encountered an unclear issue. When I tried to launch it on android, I received an errorr sigsegv which always occurs on ocaml_startup in case objects are used in the code. To compile ocaml for android I'm using the patch from " http://www.itpl.co.jp/ocaml-nagoya/index.php?ocaml-android". I don't know very well arm assembler, but I'm trying to solve this problem. Can someone from the maillist help me === test_stub.c === #include #include jint JNI_OnLoad(JavaVM* vm, void* reserved) { __android_log_write(ANDROID_LOG_DEBUG,"LIGHTNING","JNI_OnLoad from stub"); char *argv[] = {"android"}; caml_startup(argv); __android_log_write(ANDROID_LOG_DEBUG,"LIGHTNING","caml initialized"); return JNI_VERSION_1_6; // Check this } ======= ==== test.ml === let a = 1 ==== ocamlfind -toolchain android ocamlopt -c test_stub.c ocamlfind -toolchain android ocamlopt -c test.ml ocamlfind -toolchain android ocamlopt -output-obj -o libtest.so test.cmx test_stub.o cp libtest.so ../libs/armeabi/ --- Here as usual compile android project, and it's ok! When I write in test.ml ==== let a _ = object method render () = () end It's SIGSEGV on ocaml_startup. It's magic for me! --90e6ba53a60250601904a6324671 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Hello! I=A0have been developing a framwork on ocaml for mobile platforms= .=A0The main idea is to create a universal 2D framework for game developmen= t.=A0I started with porting "sparrow"=A0http://www.sparrow-framework.org= =A0framework from objc to ocaml.

Repository=A0https://github.com/serp256/Lightning.=A0The repository does not= include the entire project yet, I will commit the rest as soon as possible= .=A0I have successfully launched the project on iOS, and SDL version on mac= osx and linux.

Now I'm trying to port it on android, and after that there will be a= n official release of the framework with the first game on it.=A0

However, I encountered an unclear issue.

When I tried to launch it on android, I received an errorr sigsegv which= always occurs on ocaml_startup in case objects are used in the code.

To compile ocaml for android I'm using the patch from "http://www.= itpl.co.jp/ocaml-nagoya/index.php?ocaml-android".=A0

I don't know very well arm assembler, but I'm trying to solve th= is problem. Can someone from the maillist help me


<= div>
=3D=3D=3D test_stub.c =3D=3D=3D
#include = <jni.h>
#include <android/log.h>


jint JNI_OnLoad(JavaVM* vm, void* reserved) {
=A0 __android_log_write(ANDROID_LOG_DEBUG,"LIGHTNING","= JNI_OnLoad from stub");
=A0 char *argv[] =3D {"android&= quot;};
=A0 caml_startup(argv);
=A0 __android_log_write= (ANDROID_LOG_DEBUG,"LIGHTNING","caml initialized");
=A0 return JNI_VERSION_1_6; // Check this
}
= =3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D test.ml =3D=3D=3D
let a =3D 1
=3D=3D= =3D=3D

ocamlfind -toolchain android ocamlopt -c te= st_stub.c
ocamlfind -toolchain android ocamlopt -c test.ml
ocamlfind -toolchain android ocamlopt= -output-obj -o libtest.so test.cmx test_stub.o
cp libtest.so ../= libs/armeabi/
--- Here as usual compile android project, and it's ok!
=
When I write in test.ml
=3D=3D=3D=3D
let a _ =3D object method ren= der () =3D () end

It's SIGSEGV on ocaml_startup. It's magic for me!

--90e6ba53a60250601904a6324671--