Dera Nicolas,

Thank you for your suggestion!

Actually I already posted the same question with code on the github:
https://github.com/intel/linux-sgx/issues/315


Best,
Ivana


On Thu, Oct 11, 2018 at 1:42 PM Nicolás Ojeda Bär <nicolas.ojeda.bar@lexifi.com> wrote:
Dear Ivana,

You may get more people willing to help if you put up the simple
example somewhere publicly accessible, such as github.

Best wishes,
Nicolás
On Tue, Oct 9, 2018 at 6:23 PM Ivana Vukotic <ivanatodvuk@gmail.com> wrote:
>
> Hi,
>
> We are trying to run some OCaml code within an Intel SGX enclave.
>
> This OCaml code is called by a C wrapper using the method described
> here:  https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html
>
> Because Intel SGX doesn't support the entire standard C library, we had
> to create ocalls for the functions that are used by ocamlrun but not
> supported by SGX.  Using the functionalities provided by Intel SGX, we
> managed to create an .so library containing our OCaml code along with
> the C wrapper.  This .so library is what is meant to run in an SGX
> enclave (we so far only implemented the ocalls that we needed, and not
> all missing functionalities from ocamlrun).
>
> Our problem is now that when we call caml_startup from within our C
> wrapper (in order to start the OCaml code), the code seem to simply call
> 'exit' and stop there.  Does anyone know why this call to caml_startup
> would call 'exit'?
>
> We managed to create a simple example, which I can forward to anyone interested
> to take a look (unfortunately mailing list has a limited attachment and I can not
>  send it).
>
> Please note that we use ocaml 4.06.1 and gcc 7.3.0
>
> Best,
>
> Ivana