Ian Lance Taylor <i...@google.com> writes: > On Mon, Sep 30, 2013 at 6:07 AM, Rainer Orth > <r...@cebitec.uni-bielefeld.de> wrote: >> Ian Lance Taylor <i...@google.com> writes: >> >>> Following up on my earlier patch, this patch implements the >>> reflect.MakeFunc function for 386. >>> >>> Tom Tromey pointed out to me that the libffi closure support can >>> probably be used for this. I was not aware of that support. It >>> supports a lot more processors, and I should probably start using it. >>> The approach I am using does have a couple of advantages: it's more >>> efficient, and it doesn't require any type of writable executable >>> memory. I can get away with that because indirect calls in Go always >>> pass a closure value. So even when and if I do change to using libffi, >>> I might still keep this code for amd64 and 386. >> >> Unfortunately, this patch (and undoubtedly the corresponding amd64 one) >> break Solaris/x86 libgo bootstrap with native as: > > Unfortunately I think I'll have to somehow disable this functionality > on systems with assemblers that do not understand the .cfi directives, > as otherwise calling panic in a function created with MakeFunc will > not work.
Alternatively, one could hand-craft the .eh_frame section for such systems along the lines of libffi/src/x86/sysv.S: ugly, but doable. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University