1
# DP: Apply #660525 fix to in-tree libffi
3
--- a/src/libffi/src/m68k/sysv.S
4
+++ b/src/libffi/src/m68k/sysv.S
7
sysv.S - Copyright (c) 2012 Alan Hourihane
8
Copyright (c) 1998, 2012 Andreas Schwab
9
- Copyright (c) 2008 Red Hat, Inc.
11
- m68k Foreign Function Interface
12
+ Copyright (c) 2008 Red Hat, Inc.
13
+ Copyright (c) 2012 Thorsten Glaser
15
+ m68k Foreign Function Interface
17
Permission is hereby granted, free of charge, to any person obtaining
18
a copy of this software and associated documentation files (the
19
@@ -168,8 +169,28 @@ retstruct1:
31
+ | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
32
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
49
@@ -201,8 +222,10 @@ CALLFUNC(ffi_closure_SYSV):
60
@@ -210,6 +233,7 @@ CALLFUNC(ffi_closure_SYSV):
68
@@ -224,6 +248,7 @@ CALLFUNC(ffi_closure_SYSV):
73
#if defined(__MC68881__) || defined(__HAVE_68881__)
76
@@ -242,17 +267,37 @@ CALLFUNC(ffi_closure_SYSV):
80
- jne .Lcls_ret_struct2
100
+ | NOTE: On the mc68000, extb is not supported. 8->16, then 16->32.
101
+#if !defined(__mc68020__) && !defined(__mc68030__) && !defined(__mc68040__) && !defined(__mc68060__) && !defined(__mcoldfire__)
115
.size CALLFUNC(ffi_closure_SYSV),.-CALLFUNC(ffi_closure_SYSV)
116
--- a/src/libffi/src/m68k/ffi.c
117
+++ b/src/libffi/src/m68k/ffi.c
118
@@ -123,6 +123,8 @@ ffi_prep_args (void *stack, extended_cif
119
#define CIF_FLAGS_POINTER 32
120
#define CIF_FLAGS_STRUCT1 64
121
#define CIF_FLAGS_STRUCT2 128
122
+#define CIF_FLAGS_SINT8 256
123
+#define CIF_FLAGS_SINT16 512
125
/* Perform machine dependent cif processing */
127
@@ -200,6 +202,14 @@ ffi_prep_cif_machdep (ffi_cif *cif)
128
cif->flags = CIF_FLAGS_DINT;
131
+ case FFI_TYPE_SINT16:
132
+ cif->flags = CIF_FLAGS_SINT16;
135
+ case FFI_TYPE_SINT8:
136
+ cif->flags = CIF_FLAGS_SINT8;
140
cif->flags = CIF_FLAGS_INT;