commit: e72c7d5cbdafc763d4cfffcdeb3e06f7c69b0ce7
parent d7b16acf48c679b669638a4e8fc9d6affbe8ffa1
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 13 Aug 2019 15:30:56 -0700
libffi: Some portability fixes
Diffstat:
5 files changed, 105 insertions(+), 1 deletion(-)
diff --git a/.gitmodules b/.gitmodules
@@ -106,6 +106,7 @@
[submodule "pkg/libffi/src"]
path = pkg/libffi/src
url = https://github.com/libffi/libffi
+ ignore = all
[submodule "pkg/libinput/src"]
path = pkg/libinput/src
url = https://github.com/oasislinux/libinput
diff --git a/pkg/libffi/patch/0001-Use-fixed-type-integer-types-when-available.patch b/pkg/libffi/patch/0001-Use-fixed-type-integer-types-when-available.patch
@@ -0,0 +1,36 @@
+From 8aee4bf7573a7d52c0e3a84e03a964222e13f4c2 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Tue, 13 Aug 2019 22:20:39 +0000
+Subject: [PATCH] Use fixed-type integer types when available
+
+This avoids the use of gcc attributes to select the integer width.
+---
+ include/ffi_common.h | 12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/include/ffi_common.h b/include/ffi_common.h
+index 37f5a9e..56145f4 100644
+--- a/include/ffi_common.h
++++ b/include/ffi_common.h
+@@ -91,7 +91,17 @@ typedef struct
+ } extended_cif;
+
+ /* Terse sized type definitions. */
+-#if defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C)
++#if __STDC_VERSION__ >= 199901L
++# include <inttypes.h>
++typedef uint8_t UINT8;
++typedef int8_t SINT8;
++typedef uint16_t UINT16;
++typedef int16_t SINT16;
++typedef uint32_t UINT32;
++typedef int32_t SINT32;
++typedef uint64_t UINT64;
++typedef int64_t SINT64;
++#elif defined(_MSC_VER) || defined(__sgi) || defined(__SUNPRO_C)
+ typedef unsigned char UINT8;
+ typedef signed char SINT8;
+ typedef unsigned short UINT16;
+--
+2.22.0
+
diff --git a/pkg/libffi/patch/0002-Use-generic-padding-instead-of-128-bit-integers.patch b/pkg/libffi/patch/0002-Use-generic-padding-instead-of-128-bit-integers.patch
@@ -0,0 +1,41 @@
+From 0e209181497d1bd3db35c390fdf05ae58e3d81eb Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Tue, 13 Aug 2019 22:27:49 +0000
+Subject: [PATCH] Use generic padding instead of 128-bit integers
+
+---
+ src/x86/ffi64.c | 14 +-------------
+ 1 file changed, 1 insertion(+), 13 deletions(-)
+
+diff --git a/src/x86/ffi64.c b/src/x86/ffi64.c
+index 5a5e043..fb9ab13 100644
+--- a/src/x86/ffi64.c
++++ b/src/x86/ffi64.c
+@@ -38,23 +38,11 @@
+ #define MAX_GPR_REGS 6
+ #define MAX_SSE_REGS 8
+
+-#if defined(__INTEL_COMPILER)
+-#include "xmmintrin.h"
+-#define UINT128 __m128
+-#else
+-#if defined(__SUNPRO_C)
+-#include <sunmedia_types.h>
+-#define UINT128 __m128i
+-#else
+-#define UINT128 __int128_t
+-#endif
+-#endif
+-
+ union big_int_union
+ {
+ UINT32 i32;
+ UINT64 i64;
+- UINT128 i128;
++ char pad[16];
+ };
+
+ struct register_args
+--
+2.22.0
+
diff --git a/pkg/libffi/patch/0003-Don-t-use-complex-types-if-they-are-not-supported.patch b/pkg/libffi/patch/0003-Don-t-use-complex-types-if-they-are-not-supported.patch
@@ -0,0 +1,26 @@
+From 11d46eaa4293840e7a4c1dde18f75453bfaca54e Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Tue, 13 Aug 2019 22:28:49 +0000
+Subject: [PATCH] Don't use complex types if they are not supported
+
+---
+ src/x86/ffitarget.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/x86/ffitarget.h b/src/x86/ffitarget.h
+index a236677..709140d 100644
+--- a/src/x86/ffitarget.h
++++ b/src/x86/ffitarget.h
+@@ -50,7 +50,9 @@
+ #endif
+
+ #define FFI_TARGET_SPECIFIC_STACK_SPACE_ALLOCATION
++#ifndef __STDC_NO_COMPLEX__
+ #define FFI_TARGET_HAS_COMPLEX_TYPE
++#endif
+
+ /* ---- Generic type definitions ----------------------------------------- */
+
+--
+2.22.0
+
diff --git a/pkg/libffi/ver b/pkg/libffi/ver
@@ -1 +1 @@
-3.2.1 r0
+3.2.1 r1