This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Tidy powerpc*-linux support


On Wed, 20 Nov 2013 18:08:25 +1030
Alan Modra <amodra@gmail.com> wrote:

> As threatened.
> 
> This separates the 32-bit sysv/linux/bsd code from the 64-bit linux
> code, and makes it possible to link code compiled with different
> options to those used to compile libffi.  For example, a
> -mlong-double-128 libffi can be used with -mlong-double-64 code.
> 
> Tested powerpc-linux, powerpc64-linux, powerpc64le-linux, and the
> hacky powerpc-freebsd simulated setup I used earlier.  I've tried a
> few combinations of ABI variations; -mlong-double-64/-mlong-double-128
> and -msvr4-struct-return/-maix-struct-return pass the testuite with 
> flying colours.  Testing -msoft-float ran into lack of soft-float
> multilibs on my system, but I looked at some testcases under gdb and
> they seemed to do the right thing.
> 
> 	* Makefile.am (EXTRA_DIST): Add new src/powerpc files.
> 	(nodist_libffi_la_SOURCES <POWERPC, POWERPC_FREEBSD>): Likewise.
> 	* configure.ac (HAVE_LONG_DOUBLE_VARIANT): Define for powerpc.
> 	* include/ffi.h.in (ffi_prep_types): Declare.
> 	* src/prep_cif.c (ffi_prep_cif_core): Call ffi_prep_types.
> 	* src/types.c (FFI_NONCONST_TYPEDEF): Define and use for
> 	HAVE_LONG_DOUBLE_VARIANT.
> 	* src/powerpc/ffi_powerpc.h: New file.
> 	* src/powerpc/ffi.c: Split into..
> 	* src/powerpc/ffi_sysv.c: ..new file, and..
> 	* src/powerpc/ffi_linux64.c: ..new file, rewriting parts.
> 	* src/powerpc/ffitarget.h (enum ffi_abi): Rewrite powerpc ABI
> 	selection as bits controlling features.
> 	* src/powerpc/linux64.S: For consistency, use POWERPC64 rather
> 	than __powerpc64__.
> 	* src/powerpc/linux64_closure.S: Likewise.
> 	* src/powerpc/ppc_closure.S: Likewise.  Move .note.FNU-stack
> 	inside guard.
> 	* src/powerpc/sysv.S: Likewise.
> 	* configure: Regenerate.
> 	* fficonfig.h.in: Regenerate.
> 	* Makefile.in: Regenerate.

[...] 

> --- a/include/ffi.h.in
> +++ b/include/ffi.h.in
> @@ -221,6 +221,11 @@ typedef struct {
>  #endif
>  } ffi_cif;
>  
> +#if HAVE_LONG_DOUBLE_VARIANT
> +/* Used to adjust size/alignment of ffi types.  */
> +void ffi_prep_types (ffi_abi abi);
> +# endif
> +
>  /* Used internally, but overridden by some architectures */
>  ffi_status ffi_prep_cif_core(ffi_cif *cif,
>  			     ffi_abi abi,

This is an installed header and including it now causes a warning:

  In file included from ./include/parrot/parrot.h:94:0,
                   from src/string/api.c:27:
  /usr/lib64/libffi-3.1/include/ffi.h:224:5: error: "HAVE_LONG_DOUBLE_VARIANT"
  is not defined [-Werror=undef] #if HAVE_LONG_DOUBLE_VARIANT
                                     ^
  cc1: some warnings being treated as errors

Did you mean to use @HAVE_LONG_DOUBLE_VARIANT@?


-- 
Ryan Hill                        psn: dirtyepic_sk
   gcc-porting/toolchain/wxwidgets @ gentoo.org

47C3 6D62 4864 0E49 8E9E  7F92 ED38 BD49 957A 8463

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]