summaryrefslogtreecommitdiff
path: root/src/prep_cif.c
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2013-10-15 15:33:59 -0400
committerAnthony Green <green@moxielogic.com>2013-10-15 15:33:59 -0400
commit16b93a211bcfbe4bd0efdcf94de225a71aa0ee02 (patch)
tree92fb3b3b12a817619d24fdaf5b4fba27bcee082d /src/prep_cif.c
parent2f5626ce02fce8267ab48ceb6d7d0ed7d672a75e (diff)
downloadlibffi-16b93a211bcfbe4bd0efdcf94de225a71aa0ee02.tar.gz
Add nios2 port.
Diffstat (limited to 'src/prep_cif.c')
-rw-r--r--src/prep_cif.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/prep_cif.c b/src/prep_cif.c
index e8ec5cf..e373cbd 100644
--- a/src/prep_cif.c
+++ b/src/prep_cif.c
@@ -76,6 +76,13 @@ static ffi_status initialize_aggregate(ffi_type *arg)
total size of 3*sizeof(long). */
arg->size = ALIGN (arg->size, arg->alignment);
+ /* On some targets, the ABI defines that structures have an additional
+ alignment beyond the "natural" one based on their elements. */
+#ifdef FFI_AGGREGATE_ALIGNMENT
+ if (FFI_AGGREGATE_ALIGNMENT > arg->alignment)
+ arg->alignment = FFI_AGGREGATE_ALIGNMENT;
+#endif
+
if (arg->size == 0)
return FFI_BAD_TYPEDEF;
else
@@ -146,7 +153,9 @@ ffi_status FFI_HIDDEN ffi_prep_cif_core(ffi_cif *cif, ffi_abi abi,
#ifdef XTENSA
&& (cif->rtype->size > 16)
#endif
-
+#ifdef NIOS2
+ && (cif->rtype->size > 8)
+#endif
)
bytes = STACK_ARG_SIZE(sizeof(void*));
#endif