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

Re: [MirageOS-devel] how to link c stubs to xen unikernels ?

Hi Nicolas,

I just noticed the uint dependency in the IPv6 stack too.  The C
linking is being progressively introduced in a series of commits
in recent releases of Mirage (mostly by Thomas Leonard):

- Mirage v2.1.1: Do not reuse the Unix linker options when building 
  Xen unikernels. Instead, get the linker options from the ocamlfind 
  xen_linkopts variables (#332). 

This release stopped just using the Unix linker flags with Xen
compilation and introduces the special `xen_linkopts` ocamlfind
variable that specifies CFLAGS for Xen unikernels.

- TCP/IP v2.1.0: uses the new `xen_linkopts` flag for compiling the
  checksum stubs.  mirage-xen v2.1.1 removed its local copies, so
  we now now have an external library (tcpip) providing external
  Xen stubs.

See also the recent thread about TLS status, which is doing the
next step: how to compile C stubs from libraries that we don't
directly control (and hence can't add xen_linkopts for in their
ocamlfind libraries).

One way to do this in the short term is to follow what Thomas has
done in https://github.com/mirage/mirage-dev/pull/49 and add a
forked version of uint with the xen_cflags support.

In the medium term, we'll need some mechanism to provide a Xen variant
of an existing library like Zarith or uint, possibly using the opam
depexts facility to query these packages at `mirage configure` time.


> On 19 Dec 2014, at 11:41, Nicolas Ojeda Bar <no263@xxxxxxxxxxxxxxx> wrote:
> Hi list,
> I have a unikernel that uses the `uint` package (which is implemented
> in C).  I can compile and run fine on Unix, but when compiling for Xen
> I get linking errors because the uint C stubs are not getting linked
> to the unikernel...
> It would be great if someone could explain what is involved in getting
> C stubs linked to Xen unikernels, whether it is a reasonable thing to
> do, the standard way to do it, etc...
> Thanks!
> Best wishes,
> Nicolas
> _______________________________________________
> MirageOS-devel mailing list
> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

MirageOS-devel mailing list



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