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

[MirageOS-devel] Compiling C components for mirage-xen



I'd like to use `Bcrypt` from the `safepass` opam module in passe[0].
There is sadly no `safepass-xen` package, and trying to just use
`safepass` results in link errors:


<...>/lib/safepass/libsafepass_stubs.a(crypt_blowfish.o): In function
`BF_crypt':
(.text+0x1b97): undefined reference to `__errno_location'
<...>/lib/safepass/libsafepass_stubs.a(crypt_blowfish.o): In function
`BF_crypt':
(.text+0x2112): undefined reference to `__errno_location'
<...>/lib/safepass/libsafepass_stubs.a(crypt_blowfish.o): In function
`_crypt_blowfish_rn':
(.text+0x21ea): undefined reference to `__errno_location'
<...>/lib/safepass/libsafepass_stubs.a(crypt_blowfish.o): In function
`_crypt_gensalt_blowfish_rn':
(.text+0x2575): undefined reference to `__errno_location'
<...>/lib/safepass/libsafepass_stubs.a(crypt_blowfish.o): In function
`_crypt_gensalt_blowfish_rn':
(.text+0x25a6): undefined reference to `__errno_location'
<...>/lib/safepass/libsafepass_stubs.a(crypt_blowfish.o):(.text+0x25b7):
more undefined references to `__errno_location' follow


I'm assuming I'd need to customise the build process tp produce an
appropriate C library as with `gmp-xen`, `zarith-xen` etc. The trouble
is twofold:

 - I don't really know what the thing I'm doing is. Is mirage-xen a
different architecture? A different ABI? Do C libraries need to be
cross-compiled, or just compiled with particular flags so that they'll
work on xen-minios instead of gnu/linux?

 - The existing scripts seem to be pretty ad-hoc - zarith gets away
mainly with particular CFLAGS
(https://github.com/ocaml/opam-repository/blob/master/packages/zarith-xen/zarith-xen.1.4/files/mirage-install.sh),
while gmp looks like a full cross-compilation using `--target` (and
then does some other sneaky things).

safepass uses OASIS for its build system, which doesn't seem to have
any cross-compilation functionality built in as far as I could tell.
Can anyone give me pointers on what I'd need to do to safepass' build
scripts to get this working in mirage-xen, or at the least some
clarification on why it doesn't work as-is and how cross compilation
works for C libraries used in mirage-xen?

[0]: https://github.com/timbertson/passe

Thanks,
- Tim.

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://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®.