diff --git a/_service b/_service
index eef58b8..1c7e09e 100644
--- a/_service
+++ b/_service
@@ -4,8 +4,8 @@
https://github.com/libffi/libffi
master
libffi
- v3.2.1
- 3.2.1.git@TAG_OFFSET@
+ v3.3
+ 3.3.git@TAG_OFFSET@
*.tar
diff --git a/aarch64.patch b/aarch64.patch
index 7a83568..8add6bc 100644
--- a/aarch64.patch
+++ b/aarch64.patch
@@ -11,15 +11,4 @@ diff -purN libffi-3.2.1.git505.orig/src/aarch64/ffi.c libffi-3.2.1.git505/src/aa
#endif
closure->cif = cif;
-diff -purN libffi-3.2.1.git505.orig/src/closures.c libffi-3.2.1.git505/src/closures.c
---- libffi-3.2.1.git505.orig/src/closures.c 2019-08-07 20:57:45.000000000 +0200
-+++ libffi-3.2.1.git505/src/closures.c 2019-10-11 08:43:59.265151289 +0200
-@@ -925,6 +925,8 @@ void *
- ffi_data_to_code_pointer (void *data)
- {
- msegmentptr seg = segment_holding (gm, data);
-+ if (seg == NULL)
-+ return NULL;
- return add_segment_exec_offset (data, seg);
- }
-
+
diff --git a/baselibs.conf b/baselibs.conf
index 74588ac..9dcc2e1 100644
--- a/baselibs.conf
+++ b/baselibs.conf
@@ -1,3 +1,3 @@
-libffi7
+libffi8
libffi-devel
- requires "libffi7- = "
+ requires "libffi8- = "
diff --git a/gccbug.patch b/gccbug.patch
deleted file mode 100644
index 290b655..0000000
--- a/gccbug.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Index: libffi-3.2.1.git505/testsuite/lib/libffi.exp
-===================================================================
---- libffi-3.2.1.git505.orig/testsuite/lib/libffi.exp
-+++ libffi-3.2.1.git505/testsuite/lib/libffi.exp
-@@ -526,12 +526,8 @@ proc run-many-tests { testcases extra_fl
- set has_gccbug false;
- if { [string match $compiler_vendor "gnu"] \
- && [string match "*MSABI*" $abi] \
-- && ( ( [string match "*DGTEST=57 *" $common] \
-- && [string match "*call.c*" $testname] ) \
-- || ( [string match "*DGTEST=54 *" $common] \
-- && [string match "*callback*" $testname] ) \
-- || [string match "*DGTEST=55 *" $common] \
-- || [string match "*DGTEST=56 *" $common] ) } then {
-+ && [string match {*DGTEST=5[456] *} $common] \
-+ && [string match "*callback*" $testname] } then {
- set has_gccbug true;
- }
- verbose "Testing $testname, $options" 1
diff --git a/libffi-3.2.1.git505.tar.xz b/libffi-3.2.1.git505.tar.xz
deleted file mode 100644
index f5d8bae..0000000
--- a/libffi-3.2.1.git505.tar.xz
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:a36c0811dd2457696abfa59097444ac5b52c1bcf90eebae5055cfc5bb7f10c09
-size 377884
diff --git a/libffi-3.3.git30.tar.xz b/libffi-3.3.git30.tar.xz
new file mode 100644
index 0000000..0583bba
--- /dev/null
+++ b/libffi-3.3.git30.tar.xz
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7fe63972a44c8024d69959f1db11e3198d44721209cc1afd98b60da1ea7335e4
+size 383940
diff --git a/libffi.changes b/libffi.changes
index 1e61423..28dfbf6 100644
--- a/libffi.changes
+++ b/libffi.changes
@@ -1,3 +1,27 @@
+-------------------------------------------------------------------
+Tue Mar 10 09:57:24 UTC 2020 - Richard Biener
+
+- Update to commit b844a9c7f1ca based on libffi 3.3 with the
+ following changes:
+
+ Add RISC-V support.
+ New API in support of GO closures.
+ Add IEEE754 binary128 long double support for 64-bit Power
+ Default to Microsoft's 64 bit long double ABI with Visual C++.
+ GNU compiler uses 80 bits (128 in memory) FFI_GNUW64 ABI.
+ Add Windows on ARM64 (WOA) support.
+ Add Windows 32-bit ARM support.
+ Raw java (gcj) API deprecated.
+ Add pre-built PDF documentation to source distribution.
+ Many new test cases and bug fixes.
+
+- SONAME change to libffi.so.8
+- stdcall.patch is now upstream
+- Adjust baselibs.conf for SONAME change
+- Adjust aarch64.patch for upstream changes
+- Drop gccbug.patch XFAILing testcases that now PASS with fixed
+ GCC 9.3
+
-------------------------------------------------------------------
Fri Oct 11 07:27:45 UTC 2019 - Guillaume GARDET
diff --git a/libffi.spec b/libffi.spec
index 368ef66..e647f1a 100644
--- a/libffi.spec
+++ b/libffi.spec
@@ -1,7 +1,7 @@
#
# spec file for package libffi
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,19 +16,17 @@
#
-%define libffi_sover 7
+%define libffi_sover 8
Name: libffi
-Version: 3.2.1.git505
+Version: 3.3.git30
Release: 0
Summary: Foreign Function Interface Library
License: MIT
Group: Development/Languages/C and C++
-Url: https://github.com/libffi/
+URL: https://github.com/libffi/
Source: %name-%version.tar.xz
Source99: baselibs.conf
-Patch1: gccbug.patch
-Patch2: stdcall.patch
# Workaround from https://github.com/libffi/libffi/issues/498
Patch3: aarch64.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -82,8 +80,6 @@ time.
%prep
%setup -q
-%patch1 -p1
-%patch2 -p1
%patch3 -p1
%build
diff --git a/stdcall.patch b/stdcall.patch
deleted file mode 100644
index 0c3e7c1..0000000
--- a/stdcall.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-Index: libffi-3.2.1.git505/src/x86/ffi.c
-===================================================================
---- libffi-3.2.1.git505.orig/src/x86/ffi.c
-+++ libffi-3.2.1.git505/src/x86/ffi.c
-@@ -51,6 +51,13 @@
- # define __declspec(x) __attribute__((x))
- #endif
-
-+#if defined(_MSC_VER) && defined(_M_IX86)
-+/* Stack is not 16-byte aligned on Windows. */
-+#define STACK_ALIGN(bytes) (bytes)
-+#else
-+#define STACK_ALIGN(bytes) FFI_ALIGN (bytes, 16)
-+#endif
-+
- /* Perform machine dependent cif processing. */
- ffi_status FFI_HIDDEN
- ffi_prep_cif_machdep(ffi_cif *cif)
-@@ -177,12 +184,7 @@ ffi_prep_cif_machdep(ffi_cif *cif)
- bytes = FFI_ALIGN (bytes, t->alignment);
- bytes += FFI_ALIGN (t->size, FFI_SIZEOF_ARG);
- }
--#if defined(_MSC_VER) && defined(_M_IX86)
-- // stack is not 16-bit aligned on Windows
- cif->bytes = bytes;
--#else
-- cif->bytes = FFI_ALIGN (bytes, 16);
--#endif
-
- return FFI_OK;
- }
-@@ -290,7 +292,7 @@ ffi_call_int (ffi_cif *cif, void (*fn)(v
- }
- }
-
-- bytes = cif->bytes;
-+ bytes = STACK_ALIGN (cif->bytes);
- stack = alloca(bytes + sizeof(*frame) + rsize);
- argp = (dir < 0 ? stack + bytes : stack);
- frame = (struct call_frame *)(stack + bytes);
-@@ -434,7 +436,7 @@ ffi_closure_inner (struct closure_frame
- rvalue = frame->rettemp;
- pabi = &abi_params[cabi];
- dir = pabi->dir;
-- argp = (dir < 0 ? stack + cif->bytes : stack);
-+ argp = (dir < 0 ? stack + STACK_ALIGN (cif->bytes) : stack);
-
- switch (flags)
- {
-@@ -698,7 +700,7 @@ ffi_raw_call(ffi_cif *cif, void (*fn)(vo
- }
- }
-
-- bytes = cif->bytes;
-+ bytes = STACK_ALIGN (cif->bytes);
- argp = stack =
- (void *)((uintptr_t)alloca(bytes + sizeof(*frame) + rsize + 15) & ~16);
- frame = (struct call_frame *)(stack + bytes);