[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MirageOS-devel] How to import ocaml-lz4 into a MirageOS unikernel (Xen)?



Hi everyone,

I'm trying to include into my Xen configured unikernel the ocaml-lz4 library. At the beginning I've tried using the latest version of Mirage but I faced a problem related to the dependency between ctypes and Str that leads inevitably to the following error:

Error: No implementations provided for the following modules:
         Str referenced from /home/cozzolin/.opam/4.04.0/lib/ctypes/ctypes.cmxa(Ctypes_path),
           /home/cozzolin/.opam/4.04.0/lib/ctypes/cstubs.cmxa(Cstubs_structs)

I suppose the reason is that Mirage 3.0 dropped Str from the Ocaml runtime?

Therefore, I tried with Mirage 2.9.1 but then I have another problem related to undefined reference:

build/main.native.o: In function `.L102':
:(.text+0x8a10): undefined reference to `caml__4_LZ4_decompress_safe'
_build/main.native.o: In function `.L105':
:(.text+0x8a28): undefined reference to `caml__2_LZ4_compress_limitedOutput'
_build/main.native.o: In function `.L108':
/home/mirage/.opam/4.02.3/build/lz4.1.1.1/_build/lib/LZ4_generated.ml:40: undefined reference to `caml__5_LZ4_decompress_safe'
_build/main.native.o: In function `.L111':
/home/mirage/.opam/4.02.3/build/lz4.1.1.1/_build/lib/LZ4_generated.ml:58: undefined reference to `caml__3_LZ4_compress_limitedOutput'
_build/main.native.o: In function `.L114':
/home/mirage/.opam/4.02.3/build/lz4.1.1.1/_build/lib/LZ4_generated.ml:58: undefined reference to `caml__1_LZ4_compressBound'
_build/main.native.o: In function `camlLZ4_generated__9':
:(.data+0x7e6c): undefined reference to `caml__5_LZ4_decompress_safe'
:(.data+0x7e70): undefined reference to `caml__4_LZ4_decompress_safe'
:(.data+0x7e74): undefined reference to `caml__3_LZ4_compress_limitedOutput'
:(.data+0x7e78): undefined reference to `caml__2_LZ4_compress_limitedOutput'
:(.data+0x7e7c): undefined reference to `caml__1_LZ4_compressBound'
make: *** [build] Error 1

I guess this error comes from the lack of relative Xen C stubs to map this functions when compiling against Xen?

My questions are: what should I do to make this library (or any other library having the same issue) work inside a MirageOS unikernel running on Xen? Where can I find a comprehensive example of the steps to be taken?

I'm eager to learn how to solve this problem because I've faced it already multiple times.

Thanks much,
Vittorio

-- 
Vittorio Cozzolino, M.Eng.
Technische Universität München - Institut für Informatik
Office 01.05.041
Boltzmannstr. 3, 85748 Garching, Germany
Tel: +49 89 289-17356
http://www.cm.in.tum.de/en/research-group/vittorio-cozzolino

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.