[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MirageOS-devel] Some issues building mirage with virtio
- To: mirageos-devel@xxxxxxxxxxxxxxxxxxxx
- From: Hannes Mehnert <hannes@xxxxxxxxxxx>
- Date: Sat, 19 May 2018 11:45:32 +0200
- Autocrypt: addr=hannes@xxxxxxxxxxx; prefer-encrypt=mutual; keydata= xsFLBEIw1AoBEADAtXwEV8F1DBpE9lnBTbHDNeZwDVp84MhxxIT5GUexGgbOWGSEWHhC3rYe FfGRUxF4M9P4fwxpxCS5YCvxoijWHeEf8nG5IkztVv5cw63E443XWHcCMc80YAwglZ2cSP4U GTNeKb9rqVPckk/PL348BYRawhzvZK+Bc+bUvbtPCfUXT1BWIxAR1dzsfpAQVNZ4bA06xOoP QJYVNgl/lWOmQgnSgb0dE2zsgddKTOj05ru7Q7LobB7WAUTRJVkZcXnrvI1SOt/WbPTyqF8l RBh94xCqFhv4SlqZVOTXxo9gw3LpDv/cYXRl/m7+/7Wljl3ziQ9cawA6O1mbw8nm7Sfa+TZl qo+5lXEenXG+MCbH0XnnL2I4BO6HSGDtKX6htTG2xs6w4r9mVxTGJuJcGrC0dxuz5j4jylt/ KOVn9IaRKzhj8ga7kWffMp+JYdrn43732weoFFJxm78mD2ij4UbJtNkQIIcTv8IBJajHy2P3 h1NuBIwwb7RmBav4oo0CKWoasIHFwjMSBpCzJ8QOHeO/F3TY3DZp7FTwViUgSXVJoewO9yFG ctX7MC27/F1IonU9/SJW0j+F3Vz32SfxUBrDnLYpO7/vwA8w+xmWLnl0iJN/8injz5+CigsP e7O66t4MtC9BVCuLu7a/ikH5nW0q6RyTW8of9eZIsuEyqF1ZPwAGKc0lSGFubmVzIE1laG5l cnQgPGhhbm5lc0BiZXJsaW4uY2NjLmRlPsLBdAQTAQIAHgUCQjDUoQIbAwYLCQgHAwIDFQID AxYCAQIeAQIXgAAKCRC8iWWI33wo7haFEACN2n3PxdtAE/FpsWPFg/KTlJHUknUHcEDZQcr7 aR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S9BX1pviTskIs65glNN31pgPquQhNkhWEByxH8VBk2BU68ZOPq0CY3Kffzm8zPS nhss47LlPQIowsrPNLhG3heC3O8fbENdId8+ypL+3/lYWQ75ouBw8AuV1YZA+BG7kM2gIuv3 z2AIa7m+Z3hfAxEG38uYkYjS/QTKkvd5GaUZpTDmTo3WFK27gQRPN2KQDNc/kpO6WgRer9xp h5Sz9IhvnOJdULUhJbQIjCPkBNsyHwMwbiymVcKxqO2cmOwokBMFkhZXheg2q2BX6lCfVKGZ bfqdR9UarNcBD72L8z4IKTEGtvzkGTwjUIDWcEc2TlJCoRHjRVGnq9ya7G8gEaLq3x0NawND areR3hGOMNmRiNKJ7vXvptv23kx9QaMD1ZyQe7KL6+PLf6wL+dHMHKFd/7yJmw7aejfFZmQZ RYjwXaGGnNZWxeq8Lbstm8mTnd8lum5K543xrskp9so8OqgNKxFoS1wzuKDjvm2oD9kLO/qZ 2qERXlu6gu5ylbtSBjOM1BBd5hnKAZZzsVNXd2ouYXUxjb5GXJ1BtQONyPUIn5SYrLGCgvJ/ uu7SzOevtOkrhYOdV4l1ZfWaqhK6kX+7ks43W+nOHc4iXk00C5Xrwdvk6f8AsL4PAVc=
- Delivery-date: Sat, 19 May 2018 09:46:13 +0000
- List-id: Developer list for MirageOS <mirageos-devel.lists.xenproject.org>
- Openpgp: id=11B5464249B5BD858FFF6328BC896588DF7C28EE
Dear Nick,
On 18/05/2018 20:21, Nicholas Robison wrote:
> I’ve been working on a small project to port my personal website over to a
> Mirage Unikernel. So far, it’s been a lot of fun and the project continues to
> amaze me!
great to hear this!
> My app is largely a fork of the mirage-www project, with a few tweaks. While
> I’ve been able to get everything working under MacOS and Unix, I’m having
> some issues building the final image for deployment on GCE using virtio.
>
> Using Travis under Ubuntu 14.04, I’m getting the following build error, which
> shows up regardless of what OCaml version I use (tested on 4.04.2 through
> 4.06.1). I can also replicate the issue on an Ubuntu 16.04 local VM.
>
> ocamlfind ocamlopt -g -dontlink unix -dontlink str -dontlink num -dontlink
> threads -linkpkg -output-obj -package tcpip.udp -package tcpip.tcp -package
> tcpip.stack-direct -package tcpip.icmpv4 -package tcpip.ethif -package
> tcpip.arpv4 -package tcpip -package sexplib -package re -package ptime
> -package nocrypto.mirage -package nocrypto -package mirage-types-lwt -package
> mirage-types -package mirage-solo5 -package mirage-runtime -package
> mirage-random -package mirage-net-solo5 -package mirage-logs -package
> mirage-conduit -package mirage-clock-freestanding -package
> mirage-bootvar-solo5 -package lwt -package io-page -package functoria-runtime
> -package ezjsonm -package duration -package cowabloga -package cow -package
> core_kernel -package cohttp-mirage -package charrua-client-mirage -package
> astring -predicates mirage_solo5 site_config.cmx pages.cmx blog.cmx data.cmx
> key_gen.cmx dispatch.cmx static1.cmx static2.cmx main.cmx -o main.native.o
> <>_build/main.native.o: In function `camlBase__Import0__entry':
>
> <>/home/travis/.opam/4.06.1/build/base.v0.10.0/_build/default/src/import0.ml:249:
> undefined reference to `Base_am_testing'
> [...]
> It seems related to using the Base library, which I pulled via
core_kernel for a couple of list functions that I need. When running
‘make depends’ I can see the following output, which shows that base is
being downgraded, but only to the prior release, so seems odd it would
be missing symbols. Unless I’m miss-reading the error?
The issue originates from your linker when linking the static binary
(virtual machine image) - it complains that some symbols are missing.
The underlying issue is that the base library uses some functions
implemented in C which do not work on MirageOS (which does (a) run in
ring0, and thus C code needs to be compiled with -no-red-zone and other
flags and (b) does not include a full C library, only a tiny set of
symbols required for the OCaml runtime (such as memcmp, memcpy,
memmove). It works with the Unix target since there the libc is available.
If you avoid using Base and Core_kernel (and instead use the OCaml
stdlib), your website will work with virtio. If you need some help,
please let us know and provide a link to your repository.
Have a nice day,
hannes
_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/mirageos-devel
|