[OpenWrt-Devel] [PATCH] [RFC] toolchain: add OCaml compiler

Stefan Hellermann stefan at the2masters.de
Fri Sep 18 02:51:51 EDT 2015


A few ideas about the large binaries compiled with OCaml:

- Currently each OCaml binary contains the OCaml bytecode and the full
OCaml interpreter. This is okay if there is only one binary (in my case
unison), but wasteful in case of multiple binaries on the target. It should
be possible to create a package ocaml-runtime for the target. This would
allow to strip the binaries, which removes the interpreter but leaves the
bytecode.

- There is a patch in debian to allow stipping of OCaml binaries with
included OCaml interpreter:
http://patches.osdyson.org/patch/series/view/ocaml/4.01.0-3+dyson1/0008-Embed-bytecode-in-C-object-when-using-custom.patch
Sadly I haven't got it to work on openwrt.

- OCaml allows native code compilation to get more performance and smaller
binaries. But this is only supported on a few archs (x86, arm, powerpc and
sparc) so I haven't implemented it.

Stefan

2015-09-17 22:40 GMT+02:00 Bastian Bittorf <bittorf at bluebottle.com>:

> * Stefan Hellermann <stefan at the2masters.de> [17.09.2015 20:00]:
> > Tested with Unison File Synchronizer on ar71xx and x86_64. Beware:
> > Stripping unison won't work!
> > Better solutions and comments are appreciated!
> >
> > Signed-off-by: Stefan Hellermann <stefan at the2masters.de>
>
> thank you!
>
> tested and works for me on ar71xx.
> the resulting unison-binary is a little
> bit fat (~2mb gzipped) but thats not your fault 8-)
>
> bye, bastian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20150918/585adf36/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list