Message ID | CAFULd4bVaZ+P2n+W8aBCckPvGQPXf18ceRt+eCZ5Y8aqEEMcYQ@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 01/19/2015 10:11 AM, Uros Bizjak wrote: > Attached is a more conservative v2 patch that conditionally enables > fixup code when FFI_TARGET_HAS_COMPLEX_TYPE is not defined. > > Tested on x86_64-linux-gnu {-m32} without regressions. I don't think this version should be required. For x86, FFI_TARGET_HAS_COMPLEX_TYPE is only false for Darwin, which isn't supported by libgo at all. There are many many other things which would need to be fixed in order to get libgo working there. r~
On Mon, Jan 19, 2015 at 7:14 PM, Richard Henderson <rth@redhat.com> wrote: >> Attached is a more conservative v2 patch that conditionally enables >> fixup code when FFI_TARGET_HAS_COMPLEX_TYPE is not defined. >> >> Tested on x86_64-linux-gnu {-m32} without regressions. > > I don't think this version should be required. > > For x86, FFI_TARGET_HAS_COMPLEX_TYPE is only false for Darwin, which > isn't supported by libgo at all. There are many many other things > which would need to be fixed in order to get libgo working there. Thanks! Then v1 patch that removes the now unneeded code is the way to go. Uros.
Index: runtime/go-ffi.c =================================================================== --- runtime/go-ffi.c (revision 219832) +++ runtime/go-ffi.c (working copy) @@ -290,8 +290,8 @@ go_func_return_ffi (const struct __go_func_type *f if (count == 1) { - -#if defined (__i386__) && !defined (__x86_64__) +#ifndef FFI_TARGET_HAS_COMPLEX_TYPE +# if defined (__i386__) && !defined (__x86_64__) /* FFI does not support complex types. On 32-bit x86, a complex64 will be returned in %eax/%edx. We normally tell FFI that a complex64 is a struct of two floats. On 32-bit @@ -300,6 +300,7 @@ go_func_return_ffi (const struct __go_func_type *f by pretending that complex64 is int64. */ if ((types[0]->__code & GO_CODE_MASK) == GO_COMPLEX64) return &ffi_type_sint64; +# endif #endif return go_type_to_ffi (types[0]);