Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: SerP <serp256@gmail.com>
To: caml-list@inria.fr
Subject: [Caml-list] Re: Ocaml on android and ios
Date: Tue, 21 Jun 2011 19:12:44 +0400	[thread overview]
Message-ID: <BANLkTimtyk7tR4nnCGuh6X=DievhWMyr-Q@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikU4BX6=T_xeA_vBGA5b2-Y7pRzhA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]

Problem was fixed. argv - must be NULL terminated :-)

On Tue, Jun 21, 2011 at 9:39 AM, SerP <serp256@gmail.com> wrote:

> 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 <jni.h>
> #include <android/log.h>
>
>
> 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!
>
>

[-- Attachment #2: Type: text/html, Size: 3132 bytes --]

      reply	other threads:[~2011-06-21 15:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21  5:39 [Caml-list] " SerP
2011-06-21 15:12 ` SerP [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTimtyk7tR4nnCGuh6X=DievhWMyr-Q@mail.gmail.com' \
    --to=serp256@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox