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

Re: [MirageOS-devel] Mirage and piñata numbers

On 05/07/2015 16:00, Thomas Gazagnaire wrote:
>>> Someone pointed me to this discution.
>>> I have some prototype to eliminate dead code at link time. This is far
>>> from ready yet (some segfault happens), but this already prove to
>>> provide interesting improvements.
>>> The prototype is there:
>>> https://github.com/chambart/ocaml-1/tree/flambda+function_section
>>> With that I managed to get a hello world of ~40kB
>> That's seems great! I have created 
>> https://github.com/ocaml/opam-repository/pull/4383 to be able to test it a 
>> bit more easily. I suspect some libraries will not work fine with 4.03 so it 
>> will be difficult to test mirage-www with the compiler, but I'll try anyway.
> Right, not a great success so far: the compilation is broken on OSX and I got 
> segfaults when compiling camlp4, cmdliner and cppo on x86 :-) 
> Is there anything more useful to report to help you fix the issues? and where 
> should I report such issues? the bug tracker on your fork is not available.
> Best,
> Thomas
Don't bother reporting that yet. I have plenty of segfaulting examples.
I don't have time to work on that yet, so don't really consider it for
This was really a proof of concept to show that it is doable with OCaml
was far from obvious when I started hacking). Currently this rely on
specific behaviours and wasn't tested at all on anything else than my debian
laptop. If you want to spend some time to track the bug. It is probably
to the change in the frame-descriptors representation or to the changes of
https://github.com/ocaml/ocaml/pull/177 (also included in the branch).

By the way if you are interested, one of the remaining questions is how
to do
that in a compatible way. The main difficulty being the representation
of frame
descriptors: to be able to reference them, yet not force them alive in
the binary
and have them alive if and only if the function they reference is alive.
to do that
I use a combination of trick: every frame descriptor and function is in
its own
section, the functions and associated frame descriptors sections are in
the same
section group and I add a symbol before the frame descriptor sections and
another one after (that are not in the same sections as the frame

The part that is probably not portable are:
* section groups is probably a (almost undocumented...) feature of
  (I didn't verify that it exists elsewhere).
* -gc-sections option may be a gnu-ld only feature
* I rely on the order in which section ends up in the binary. There is a
way to
  enforce that with gnu-ld (per object file linker scripts), but i'm not
certain it
  exists elsewhere (and gnu-ld seems not to handle it on windows either).

If you happen to know how this works outside the gnu world this would
my (future) search.


MirageOS-devel mailing list



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