cb054b6341
A recent libffi upgrade caused the reflect test to fail on 386. The problem case is a function that returns an empty struct--a struct with no fields. The libffi library does not recognize the existence of empty structs, presumably since they can't happen in C. To work around this, the Go interface to the libffi library changes an empty struct to void. This normally works fine, but with the new libffi upgrade it fails for a function that returns an empty struct. On 386 a function that returns a struct is expected to pop the hidden pointer when it returns. So when we convert an empty struct to void, libffi is calling a function that pops the hidden pointer but does not expect that to happen. In the older version of libffi, this didn't matter, because the libffi code for 386 used a frame pointer, so the fact that the stack pointer was wonky when the function returned was ignored as the stack pointer was immediately replaced by the saved frame pointer. In the newer version of libffi, the 386 code is more efficient and does not use a frame pointer, and therefore it matters whether libffi expects the function to pop the hidden pointer or not. This patch changes libgo to convert an empty to a struct with a single field of type void. This seems to be enough to get the test cases working again. Of course the real fix would be to change libffi to handle empty types, but as libffi uses size == 0 as a marker for an uninitialized type, that would be a non-trivial change. From-SVN: r219701 |
||
---|---|---|
.. | ||
arch.h | ||
array.h | ||
chan.c | ||
chan.goc | ||
chan.h | ||
cpuprof.c | ||
cpuprof.goc | ||
defs.h | ||
env_posix.c | ||
getncpu-bsd.c | ||
getncpu-irix.c | ||
getncpu-linux.c | ||
getncpu-none.c | ||
getncpu-solaris.c | ||
go-alloc.h | ||
go-append.c | ||
go-assert-interface.c | ||
go-assert.c | ||
go-assert.h | ||
go-breakpoint.c | ||
go-byte-array-to-string.c | ||
go-caller.c | ||
go-callers.c | ||
go-can-convert-interface.c | ||
go-cdiv.c | ||
go-cgo.c | ||
go-check-interface.c | ||
go-construct-map.c | ||
go-convert-interface.c | ||
go-copy.c | ||
go-defer.c | ||
go-defer.h | ||
go-deferred-recover.c | ||
go-eface-compare.c | ||
go-eface-val-compare.c | ||
go-ffi.c | ||
go-ffi.h | ||
go-fieldtrack.c | ||
go-iface.goc | ||
go-int-array-to-string.c | ||
go-int-to-string.c | ||
go-interface-compare.c | ||
go-interface-eface-compare.c | ||
go-interface-val-compare.c | ||
go-main.c | ||
go-make-slice.c | ||
go-map-delete.c | ||
go-map-index.c | ||
go-map-len.c | ||
go-map-range.c | ||
go-matherr.c | ||
go-memcmp.c | ||
go-nanotime.c | ||
go-new-map.c | ||
go-new.c | ||
go-nosys.c | ||
go-now.c | ||
go-panic.c | ||
go-panic.h | ||
go-print.c | ||
go-recover.c | ||
go-reflect-call.c | ||
go-reflect-map.c | ||
go-rune.c | ||
go-runtime-error.c | ||
go-setenv.c | ||
go-signal.c | ||
go-strcmp.c | ||
go-string-to-byte-array.c | ||
go-string-to-int-array.c | ||
go-string.h | ||
go-strplus.c | ||
go-strslice.c | ||
go-traceback.c | ||
go-trampoline.c | ||
go-type-complex.c | ||
go-type-eface.c | ||
go-type-error.c | ||
go-type-float.c | ||
go-type-identity.c | ||
go-type-interface.c | ||
go-type-string.c | ||
go-type.h | ||
go-typedesc-equal.c | ||
go-unsafe-new.c | ||
go-unsafe-newarray.c | ||
go-unsafe-pointer.c | ||
go-unsetenv.c | ||
go-unwind.c | ||
go-varargs.c | ||
goc2c.c | ||
heapdump.c | ||
interface.h | ||
lfstack.c | ||
lfstack.goc | ||
lock_futex.c | ||
lock_sema.c | ||
malloc.goc | ||
malloc.h | ||
map.goc | ||
map.h | ||
mcache.c | ||
mcentral.c | ||
mem_posix_memalign.c | ||
mem.c | ||
mfixalloc.c | ||
mgc0.c | ||
mgc0.h | ||
mheap.c | ||
mprof.goc | ||
msize.c | ||
netpoll_epoll.c | ||
netpoll_kqueue.c | ||
netpoll_select.c | ||
netpoll_stub.c | ||
netpoll.goc | ||
panic.c | ||
parfor.c | ||
print.c | ||
proc.c | ||
rdebug.goc | ||
reflect.goc | ||
rtems-task-variable-add.c | ||
runtime1.goc | ||
runtime.c | ||
runtime.h | ||
sema.goc | ||
signal_unix.c | ||
signal_unix.h | ||
sigqueue.goc | ||
string.goc | ||
thread-linux.c | ||
thread-sema.c | ||
thread.c | ||
time.goc | ||
yield.c |