gcc/libgo/runtime
Ian Lance Taylor cb054b6341 runtime: Use a struct, not void, for an empty struct for libffi.
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
2015-01-16 02:54:13 +00:00
..
arch.h
array.h
chan.c
chan.goc runtime: Remove undefined references to runtime_race*. 2014-12-23 20:33:53 +00:00
chan.h
cpuprof.c
cpuprof.goc
defs.h
env_posix.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
getncpu-bsd.c
getncpu-irix.c
getncpu-linux.c runtime: Check for CPU_COUNT itself, don't check glibc version. 2014-10-03 05:04:59 +00:00
getncpu-none.c
getncpu-solaris.c
go-alloc.h
go-append.c
go-assert-interface.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
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 libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-cdiv.c
go-cgo.c
go-check-interface.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-construct-map.c
go-convert-interface.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-copy.c
go-defer.c re PR go/60406 (recover.go: test13reflect2 test failure) 2014-10-08 14:03:13 +00:00
go-defer.h
go-deferred-recover.c
go-eface-compare.c
go-eface-val-compare.c
go-ffi.c runtime: Use a struct, not void, for an empty struct for libffi. 2015-01-16 02:54:13 +00:00
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 libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-map-delete.c re PR go/61258 (gccgo: assertion failure go-map-delete.c:37 [GoSmith]) 2014-12-13 01:58:46 +00:00
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 compiler, runtime: Add type information to single object allocation. 2014-10-20 19:12:44 +00:00
go-nosys.c
go-now.c
go-panic.c
go-panic.h re PR go/60406 (recover.go: test13reflect2 test failure) 2014-10-08 14:03:13 +00:00
go-print.c
go-recover.c re PR go/60406 (recover.go: test13reflect2 test failure) 2014-10-08 14:03:13 +00:00
go-reflect-call.c
go-reflect-map.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
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 libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-typedesc-equal.c
go-unsafe-new.c
go-unsafe-newarray.c
go-unsafe-pointer.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-unsetenv.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
go-unwind.c
go-varargs.c
goc2c.c
heapdump.c
interface.h
lfstack.c
lfstack.goc
lock_futex.c
lock_sema.c
malloc.goc libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
malloc.h
map.goc
map.h
mcache.c
mcentral.c
mem_posix_memalign.c
mem.c
mfixalloc.c
mgc0.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
mgc0.h
mheap.c
mprof.goc
msize.c
netpoll_epoll.c
netpoll_kqueue.c
netpoll_select.c
netpoll_stub.c
netpoll.goc libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
panic.c re PR go/60406 (recover.go: test13reflect2 test failure) 2014-10-08 14:03:13 +00:00
parfor.c
print.c
proc.c re PR go/61871 (FAIL: regexp from libgo testsuite on non-split stack targets) 2015-01-05 16:13:06 +00:00
rdebug.goc
reflect.goc
rtems-task-variable-add.c
runtime1.goc libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
runtime.c libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
runtime.h libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
sema.goc
signal_unix.c
signal_unix.h
sigqueue.goc
string.goc runtime: Remove undefined references to runtime_race*. 2014-12-23 20:33:53 +00:00
thread-linux.c
thread-sema.c
thread.c
time.goc libgo, compiler: Upgrade libgo to Go 1.4, except for runtime. 2015-01-15 00:27:56 +00:00
yield.c