Update to libffi-3.4.4.

survived a bulk (+ runtime on amd64)
ok jasper@ (maintainer)
tested on riscv64 and no objection from jca@
This commit is contained in:
ajacoutot 2022-12-05 08:59:32 +00:00
parent 28fc8fbe0e
commit 7483f47ecd
7 changed files with 39 additions and 25 deletions

View File

@ -1,8 +1,8 @@
COMMENT= Foreign Function Interface
V= 3.4.2
V= 3.4.4
DISTNAME= libffi-$V
SHARED_LIBS += ffi 2.0 # 9.0
SHARED_LIBS += ffi 2.0 # 9.2
CATEGORIES= devel
MAINTAINER= Jasper Lievisse Adriaanse <jasper@openbsd.org>
@ -17,14 +17,18 @@ PERMIT_PACKAGE= Yes
WANTLIB += c++abi
.endif
MASTER_SITES= https://github.com/libffi/libffi/releases/download/v$V/
MASTER_SITES= https://github.com/libffi/libffi/releases/download/v$V/
DEBUG_PACKAGES = ${BUILD_PACKAGES}
DEBUG_PACKAGES= ${BUILD_PACKAGES}
USE_GMAKE= Yes
TEST_DEPENDS= devel/dejagnu
CONFIGURE_STYLE= gnu
FAKE_FLAGS+= includesdir="${PREFIX}/include"
CONFIGURE_ARGS= --disable-multi-os-directory
FAKE_FLAGS= includesdir="${PREFIX}/include"
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (libffi-3.4.2.tar.gz) = VA+3IWGaaro73u99lA2Ong5tLBk1lbwkMkG3f/npNiA=
SIZE (libffi-3.4.2.tar.gz) = 1351355
SHA256 (libffi-3.4.4.tar.gz) = 1mxWrSWags8qnfxAizK/XaUjcVALhHRff7i2RXEt9nY=
SIZE (libffi-3.4.4.tar.gz) = 1362394

View File

@ -1,18 +1,28 @@
- Use our own libtool
- Link with libc++abi on arm (to access unwind symbols)
Index: configure
--- configure.orig
+++ configure
@@ -18650,6 +18650,12 @@ $as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h
@@ -9940,7 +9940,7 @@ esac
LIBTOOL_DEPS=$ltmain
# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+#LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -19725,6 +19725,12 @@ if test "x$sys_symbol_underscore" = xyes; then
printf "%s\n" "#define SYMBOL_UNDERSCORE 1" >>confdefs.h
fi
+
+case "$target" in
+ arm-*-openbsd*)
+ LDFLAGS="-lc++abi $LDFLAGS"
+ ;;
+esac
+
FFI_EXEC_TRAMPOLINE_TABLE=0
case "$target" in
*arm*-apple-* | aarch64-apple-*)

View File

@ -1,7 +1,7 @@
Index: configure.host
--- configure.host.orig
+++ configure.host
@@ -216,7 +216,7 @@ case "${host}" in
@@ -223,7 +223,7 @@ case "${host}" in
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
CFLAGS="$CFLAGS -D__NO_FPRS__"
;;

View File

@ -3,8 +3,8 @@ https://svnweb.freebsd.org/ports/head/devel/libffi/files/patch-src__arm__ffi.c?r
Index: src/arm/ffi.c
--- src/arm/ffi.c.orig
+++ src/arm/ffi.c
@@ -64,6 +64,11 @@ extern unsigned char ffi_arm_trampoline[12] FFI_HIDDEN
#include <machine/sysarch.h>
@@ -68,6 +68,11 @@ extern unsigned char ffi_arm_trampoline[12] FFI_HIDDEN
#include <sys/mman.h>
#endif
+#ifdef __arm__
@ -15,7 +15,7 @@ Index: src/arm/ffi.c
/* Forward declares. */
static int vfp_type_p (const ffi_type *);
static void layout_vfp_args (ffi_cif *);
@@ -621,6 +626,16 @@ ffi_prep_closure_loc (ffi_closure * closure,
@@ -625,6 +630,16 @@ ffi_prep_closure_loc (ffi_closure * closure,
config[0] = closure;
config[1] = closure_func;
#else
@ -30,5 +30,5 @@ Index: src/arm/ffi.c
+ } while (0);
+#endif
#if defined(FFI_EXEC_STATIC_TRAMP)
# if defined(FFI_EXEC_STATIC_TRAMP)
if (ffi_tramp_is_present(closure))

View File

@ -1,19 +1,19 @@
Index: src/closures.c
--- src/closures.c.orig
+++ src/closures.c
@@ -878,6 +878,7 @@ dlmmap (void *start, size_t length, int prot,
@@ -904,6 +904,7 @@ dlmmap (void *start, size_t length, int prot,
return ptr;
}
+#if 0
if (execfd == -1 && is_emutramp_enabled ())
{
ptr = mmap (start, length, prot & ~PROT_EXEC, flags, fd, offset);
@@ -896,6 +897,7 @@ dlmmap (void *start, size_t length, int prot,
/* -1 != execfd hints that we already decided to use dlmmap_locked
last time. */
if (execfd == -1 && is_mprotect_enabled ())
@@ -932,6 +933,7 @@ dlmmap (void *start, size_t length, int prot,
with ((prot & ~PROT_WRITE) | PROT_EXEC) and mremap with
MREMAP_DUP and prot at this point. */
}
+#endif
if (execsize == 0 || execfd == -1)
{
pthread_mutex_lock (&open_temp_exec_file_mutex);
ptr = dlmmap_locked (start, length, prot, flags, offset);

View File

@ -3,7 +3,7 @@ cc1: error: unrecognized command line option "-Wno-psabi"
Index: testsuite/lib/libffi.exp
--- testsuite/lib/libffi.exp.orig
+++ testsuite/lib/libffi.exp
@@ -491,7 +491,7 @@ proc run-many-tests { testcases extra_flags } {
@@ -500,7 +500,7 @@ proc run-many-tests { testcases extra_flags } {
}
}
"gnu" {
@ -11,4 +11,4 @@ Index: testsuite/lib/libffi.exp
+ set common "-W -Wall"
if [info exists env(LIBFFI_TEST_OPTIMIZATION)] {
set optimizations [ list $env(LIBFFI_TEST_OPTIMIZATION) ]
} else {
} else {