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

Re: [MirageOS-devel] Compiling gmp-xen with nixpkgs

On 15 June 2015 at 13:58, Tim Cuthbertson <tim@xxxxxxxxxxx> wrote:
> Hi all,
> After getting acquainted with some of the sample applications, I've
> been trying to get the server component of a relatively small project
> of mine[0] running under mirage.
> After refactoring the server code to use the mirage interfaces rather
> than Unix & friends directly, I've got it compiling to the xen
> backend.
> I've been using nix[1] to build my project, so while getting stuff
> working I have been using opam instead to maximise my chance of it
> working. But now that it does, I'd like to get it working under `nix`
> as well. Most of it is just grunt work, as the mirage libraries &
> dependencies seem to build without issue (yay!), but when it comes to
> linking stub libraries I'm having some trouble.
> As I understand it, some (most?) c stubs will need cross-compilation
> for a xen (minios?) target before they can be linked into a xen
> unikernel. You've made *-xen opam package variants for the libraries
> needed for nocrypto - zarith, gmp, etc.
> In trying to recreate these I feel like I'm doing just the same as the
> opam packages - based on the opam repo I'm applying the exact same
> patches, running the same build script (modulo $PKG_CONFIG_PATH), etc.
> But I still can't get gmp to build. It gets to the linking stage, and
> I get a screenful of undefined symbols, primarily "_ctype" and
> "printk". I've uploaded the full log[2]. if that helps.
> I can't really tell which side of the problem this is - should gmp not
> be referencing these symbols (maybe I'm missing some compile flags)?
> or should the symbols be found somewhere, and I'm failing to link in
> some important library?
> In either case it's hard to tell where to go from here, since I can't
> see anything too suspicious in the logs, and I'm trying my best to do
> the same thing as `opam` would. Any pointers?

Hi Tim,

I don't know much about the gmp build process, but if you have a good
(opam) build and a bad (nix) one, I guess you can just compare the two
environments. e.g. are the missing symbols present in the good build?
Does the nix one build if you point PKG_CONFIG_PATH at the opam
installation, etc?

Many of the errors are coming from libtests.a - should it even be
building the tests for a cross-compile (I don't know)?

> Cheers,
>  - Tim.
> [0]: https://github.com/gfxmonk/passe
> [1]: http://nixos.org/nix/
> [2]: https://gist.github.com/gfxmonk/e981bfb381328cb11af8
> _______________________________________________
> MirageOS-devel mailing list
> MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
> http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

MirageOS-devel mailing list



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