On 09/19/2011 02:17 PM, Graydon Hoare wrote:
Can you do a bit of a what-you-know dump about the stack growth code to
a wiki page and/or mailing list post? It's a bug that blocks any sort of
public release, we need to have it working on at least *some* platforms.

Sure. Probably the best high level description is the original proposal:

http://pastebin.com/e9JMZNCE

From what is described, the LTO pass and varargs have not been implemented yet. On the other hand, draggonegg has been patched to support Go.

An executive summary of what is done:

*) LLVM is able to produce code that uses the API provided by newer libgcc versions:

*) On entering a function, a check for available stack space is done and if that fails __morestack is used to allocate more. *) Calls to alloca are lowered in a similar way, but if the check fails the function called is __morestack_allocate_stack_space.

The lowering is done in a way that is compatible with the pattern matching gold does for interfacing code with and without segmented stacks, but I don't think we currently mark the files. In any case, for rust some other way must be implemented to not depend on gold. Adding attributes to the functions is probably reasonable.

I *think* the libgcc functions release any allocated memory on return, but I am not sure.

So probably the smallest effort option is to try to build a current libgcc in the 3 platforms and use it. A quick hack to calling external functions might be to go back to a trampoline written in assembly, but this time it calls __morestack instead of swapping stacks as we did before.

Thanks,

-Graydon

Cheers,
Rafael
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to