Commit 248d745a by Eric Botcazou Committed by Eric Botcazou

re PR libffi/60073 (64-bit libffi.call/cls_double_va.c FAILs after recent modification)

	PR libffi/60073
	* src/sparc/v8.S: Assemble only if !SPARC64.
	* src/sparc/v9.S: Remove obsolete comment.
	* src/sparc/ffitarget.h (enum ffi_abi): Add FFI_COMPAT_V9.
	(V8_ABI_P): New macro.
	(V9_ABI_P): Likewise.
	(FFI_EXTRA_CIF_FIELDS): Define only if SPARC64.
	* src/sparc/ffi.c (ffi_prep_args_v8): Compile only if !SPARC64.
	(ffi_prep_args_v9): Compile only if SPARC64.
	(ffi_prep_cif_machdep_core): Use V9_ABI_P predicate.
	(ffi_prep_cif_machdep): Guard access to nfixedargs field.
	(ffi_prep_cif_machdep_var): Likewise.
	(ffi_v9_layout_struct): Compile only if SPARC64.
	(ffi_call): Deal with FFI_V8PLUS and FFI_COMPAT_V9 and fix warnings.
	(ffi_prep_closure_loc): Use V9_ABI_P and V8_ABI_P predicates.
	(ffi_closure_sparc_inner_v8): Compile only if !SPARC64.
	(ffi_closure_sparc_inner_v9): Compile only if SPARC64.  Guard access
	to nfixedargs field.

From-SVN: r207822
parent 583a9919
2014-02-17 Eric Botcazou <ebotcazou@adacore.com>
PR libffi/60073
* src/sparc/v8.S: Assemble only if !SPARC64.
* src/sparc/v9.S: Remove obsolete comment.
* src/sparc/ffitarget.h (enum ffi_abi): Add FFI_COMPAT_V9.
(V8_ABI_P): New macro.
(V9_ABI_P): Likewise.
(FFI_EXTRA_CIF_FIELDS): Define only if SPARC64.
* src/sparc/ffi.c (ffi_prep_args_v8): Compile only if !SPARC64.
(ffi_prep_args_v9): Compile only if SPARC64.
(ffi_prep_cif_machdep_core): Use V9_ABI_P predicate.
(ffi_prep_cif_machdep): Guard access to nfixedargs field.
(ffi_prep_cif_machdep_var): Likewise.
(ffi_v9_layout_struct): Compile only if SPARC64.
(ffi_call): Deal with FFI_V8PLUS and FFI_COMPAT_V9 and fix warnings.
(ffi_prep_closure_loc): Use V9_ABI_P and V8_ABI_P predicates.
(ffi_closure_sparc_inner_v8): Compile only if !SPARC64.
(ffi_closure_sparc_inner_v9): Compile only if SPARC64. Guard access
to nfixedargs field.
2014-02-13 Eric Botcazou <ebotcazou@adacore.com>
PR libffi/60073
......
......@@ -48,6 +48,8 @@ typedef enum ffi_abi {
FFI_FIRST_ABI = 0,
FFI_V8,
FFI_V8PLUS,
/* See below for the COMPAT_V9 rationale. */
FFI_COMPAT_V9,
FFI_V9,
FFI_LAST_ABI,
#ifdef SPARC64
......@@ -58,8 +60,19 @@ typedef enum ffi_abi {
} ffi_abi;
#endif
#define V8_ABI_P(abi) ((abi) == FFI_V8 || (abi) == FFI_V8PLUS)
#define V9_ABI_P(abi) ((abi) == FFI_COMPAT_V9 || (abi) == FFI_V9)
#define FFI_TARGET_SPECIFIC_VARIADIC 1
/* The support of variadic functions was broken in the original implementation
of the FFI_V9 ABI. This has been fixed by adding one extra field to the
CIF structure (nfixedargs field), which means that the ABI of libffi itself
has changed. In order to support applications using the original ABI, we
have renamed FFI_V9 into FFI_COMPAT_V9 and defined a new FFI_V9 value. */
#ifdef SPARC64
#define FFI_EXTRA_CIF_FIELDS unsigned int nfixedargs
#endif
/* ---- Definitions for closures ----------------------------------------- */
......
/* -----------------------------------------------------------------------
v8.S - Copyright (c) 1996, 1997, 2003, 2004, 2008 Red Hat, Inc.
SPARC Foreign Function Interface
Permission is hereby granted, free of charge, to any person obtaining
......@@ -28,6 +28,8 @@
#include <fficonfig.h>
#include <ffi.h>
#ifndef SPARC64
#define STACKFRAME 96 /* Minimum stack framesize for SPARC */
#define ARGS (64+4) /* Offset of register area in frame */
......@@ -307,6 +309,7 @@ done2:
.byte 0x1f ! uleb128 0x1f
.align WS
.LLEFDE2:
#endif
#if defined __ELF__ && defined __linux__
.section .note.GNU-stack,"",@progbits
......
/* -----------------------------------------------------------------------
v9.S - Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc.
SPARC 64-bit Foreign Function Interface
Permission is hereby granted, free of charge, to any person obtaining
......@@ -29,8 +29,6 @@
#include <ffi.h>
#ifdef SPARC64
/* Only compile this in for 64bit builds, because otherwise the object file
will have inproper architecture due to used instructions. */
#define STACKFRAME 176 /* Minimum stack framesize for SPARC 64-bit */
#define STACK_BIAS 2047
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment