Update libffi in Fedora 35 from libffi 3.1 to libffi 3.4 (released June 28 2021), and provide a libffi3.1 compatibility package to handle the library SONAME transition.
- Name: Carlos O'Donell
- Email: firstname.lastname@example.org
- Targeted release: Fedora 35
- Last updated: 2021-07-21
- FESCo issue: #2650
- Tracker bug: <will be assigned by the Wrangler>
- Release notes tracker: <will be assigned by the Wrangler>
Libffi 3.4 was released in June 28 2021 after a long period of upstream testing supported directly by Fedora (DJ Delorie). Intel Control-flow Enforcement Technology support has been added, which is a desirable feature for Fedora. Fedora is currently using libffi 3.1, released in 2014.
This change will require a SONAME bump due to ABI changes. A libffi3.1 package has been prepared, and tested in a side-tag along with libffi 3.4, and supports a smooth transition between existing binaries and binaries using the new library. No package needs to be rebuilt, old packages will require and install the compat libffi3.1 package.
The libffi3.1 package would enter the distribution first, followed by libffi updated to version 3.4. Again, no packages need to be rebuilt for the transition to happen.
Benefit to Fedora
Stay up to date with upstream libffi, including bug fixes et al.
Stay compatible with other distros which have updated already.
Add support for Intel CET and Power10.
- Proposal owners: Update to libffi 3.4
- Other developers: Packages which link against libffi do not need be rebuilt. Depending on your API usage, some code changes might be required after the update, but existing builds will continue to work.
- Release engineering: Releng 10213
- Policies and guidelines: The policies and guidelines do not need to be updated.
- Trademark approval: N/A (not needed for this Change)
- Alignment with Objectives: None
Packages built on the previous version of libffi will have an auto-requires on the old SONAME and will cause dnf to install libffi3.1 (compat package with runtime). When packages are rebuilt against libffi 3.4 they will automatically switch to using the new SONAME.
libffi's latest static trampolines feature has been disabled because it has an impact on gobject-introspection (https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/283) and ghc (https://gitlab.haskell.org/ghc/ghc/-/issues/20051).
How To Test
libffi includes its own testsuite. A side-tag rebuild has been carried out to rebuild dependent packages and verify their correct operation, this includes:
Correct operation of these packages was verified by reviewing testsuite results.
The new version of libffi, aside from the usual internal bugfixes and tweaks, introduces support for Intel CET and Power10.
The key dependencies for libffi are python and dnf. Correct operation of python and dnf during the transition requires the libffi3.1 compat package to allow a smooth rebuild path from one SONAME to the next. Verification of this was carried out in a side-tag in Fedora Rawhide.
- Contingency mechanism: Revert to libffi 3.1 (dropping libffi3.1 and the libffi 3.4 update)
- Contingency deadline: 2021-08-24
- Blocks release? No
- Blocks product? N/A
libffi includes its own documentation. No additional documentation work is required.
The libffi 3.4 release notes:
* Add static trampoline support for Linux on x86_64 and ARM64. * Add support for Alibaba's CSKY architecture. * Add support for Kalray's KVX architecture. * Add support for Intel Control-flow Enforcement Technology (CET). * Add support for ARM Pointer Authentication (PA). * Fix 32-bit PPC regression. * Fix MIPS soft-float problem. * Enable tmpdir override with the $LIBFFI_TMPDIR environment variable. * Enable compatibility with MSVC runtime stack checking. * Reject float and small integer argument in ffi_prep_cif_var(). * Callers must promote these types themselves.
Additional important changes for Fedora users (from libffi 3.1 to libffi 3.4):
* 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.