Fri Feb 28 22:37:24 2020 UTC ()
libffi: kludge for aarch64. Bump rev.

Disable i-cache flushing. This is wrong but the previous version of
libffi didn't do it either and that worked in practice.


(tnn)
diff -r1.38 -r1.39 pkgsrc/devel/libffi/Makefile
diff -r1.49 -r1.50 pkgsrc/devel/libffi/distinfo
diff -r0 -r1.1 pkgsrc/devel/libffi/patches/patch-src_aarch64_ffi.c

cvs diff -r1.38 -r1.39 pkgsrc/devel/libffi/Makefile (expand / switch to unified diff)

--- pkgsrc/devel/libffi/Makefile 2020/02/28 13:20:10 1.38
+++ pkgsrc/devel/libffi/Makefile 2020/02/28 22:37:24 1.39
@@ -1,16 +1,17 @@ @@ -1,16 +1,17 @@
1# $NetBSD: Makefile,v 1.38 2020/02/28 13:20:10 jperkin Exp $ 1# $NetBSD: Makefile,v 1.39 2020/02/28 22:37:24 tnn Exp $
2 2
3DISTNAME= libffi-3.3 3DISTNAME= libffi-3.3
 4PKGREVISION= 1
4CATEGORIES= devel 5CATEGORIES= devel
5MASTER_SITES= ftp://sourceware.org/pub/libffi/ 6MASTER_SITES= ftp://sourceware.org/pub/libffi/
6 7
7MAINTAINER= asau@inbox.ru 8MAINTAINER= asau@inbox.ru
8HOMEPAGE= https://www.sourceware.org/libffi/ 9HOMEPAGE= https://www.sourceware.org/libffi/
9COMMENT= Foreign function interface 10COMMENT= Foreign function interface
10LICENSE= mit 11LICENSE= mit
11 12
12USE_LANGUAGES= c c++ 13USE_LANGUAGES= c c++
13USE_LIBTOOL= yes 14USE_LIBTOOL= yes
14USE_TOOLS+= gmake pkg-config 15USE_TOOLS+= gmake pkg-config
15USE_TOOLS.SunOS+= perl 16USE_TOOLS.SunOS+= perl
16GNU_CONFIGURE= yes 17GNU_CONFIGURE= yes

cvs diff -r1.49 -r1.50 pkgsrc/devel/libffi/distinfo (expand / switch to unified diff)

--- pkgsrc/devel/libffi/distinfo 2020/02/28 18:14:28 1.49
+++ pkgsrc/devel/libffi/distinfo 2020/02/28 22:37:24 1.50
@@ -1,13 +1,14 @@ @@ -1,13 +1,14 @@
1$NetBSD: distinfo,v 1.49 2020/02/28 18:14:28 tnn Exp $ 1$NetBSD: distinfo,v 1.50 2020/02/28 22:37:24 tnn Exp $
2 2
3SHA1 (libffi-3.3.tar.gz) = 8df6cb570c8d6596a67d1c0773bf00650154f7aa 3SHA1 (libffi-3.3.tar.gz) = 8df6cb570c8d6596a67d1c0773bf00650154f7aa
4RMD160 (libffi-3.3.tar.gz) = 2cd43b66d792f1bad76df2e19a8411beacfcb8e0 4RMD160 (libffi-3.3.tar.gz) = 2cd43b66d792f1bad76df2e19a8411beacfcb8e0
5SHA512 (libffi-3.3.tar.gz) = 61513801a156f11420f541d325de697131846487122d6bdcf5491b18b4da788589f5c0bb07e88e396495d3be5830d74e9135595e2b8ddbfe95c448d8597fbd6f 5SHA512 (libffi-3.3.tar.gz) = 61513801a156f11420f541d325de697131846487122d6bdcf5491b18b4da788589f5c0bb07e88e396495d3be5830d74e9135595e2b8ddbfe95c448d8597fbd6f
6Size (libffi-3.3.tar.gz) = 1305466 bytes 6Size (libffi-3.3.tar.gz) = 1305466 bytes
7SHA1 (patch-configure) = 81f1f2bee39a40f2a34b3a6cea0b210d13037482 7SHA1 (patch-configure) = 81f1f2bee39a40f2a34b3a6cea0b210d13037482
 8SHA1 (patch-src_aarch64_ffi.c) = c5bd73abcb7445b073eb3e61feda212ee3396246
8SHA1 (patch-src_closures.c) = f818bd0384f146a17964e2320df1321d8b83ec73 9SHA1 (patch-src_closures.c) = f818bd0384f146a17964e2320df1321d8b83ec73
9SHA1 (patch-src_m68k_ffi.c) = 5179cfd150bc7de15eb1c5ee0a327016c2c32b3e 10SHA1 (patch-src_m68k_ffi.c) = 5179cfd150bc7de15eb1c5ee0a327016c2c32b3e
10SHA1 (patch-src_m88k_elfbsd.S) = 6572c7fa39c00096cb4a80bb88993ff1b4aaa8cc 11SHA1 (patch-src_m88k_elfbsd.S) = 6572c7fa39c00096cb4a80bb88993ff1b4aaa8cc
11SHA1 (patch-src_mips_ffi.c) = 7353f68f73917af6bff0b90393ac3404ea54fb99 12SHA1 (patch-src_mips_ffi.c) = 7353f68f73917af6bff0b90393ac3404ea54fb99
12SHA1 (patch-src_mips_ffitarget.h) = 7fe62634803ccb5a168e76d597409c9af809c448 13SHA1 (patch-src_mips_ffitarget.h) = 7fe62634803ccb5a168e76d597409c9af809c448
13SHA1 (patch-testsuite_libffi.call_float2.c) = 2a42a428b0cc55065968c7f0748026da12b70b9d 14SHA1 (patch-testsuite_libffi.call_float2.c) = 2a42a428b0cc55065968c7f0748026da12b70b9d

File Added: pkgsrc/devel/libffi/patches/patch-src_aarch64_ffi.c
$NetBSD: patch-src_aarch64_ffi.c,v 1.1 2020/02/28 22:37:24 tnn Exp $

For closures, aarch64 needs explicit invalidation of the code segments
i-cache after data is written through the data mapping.
But we don't have any way to look up the address of the code segment
right now so for now skip doing the cache flush.

--- src/aarch64/ffi.c.orig	2019-10-31 14:49:54.000000000 +0000
+++ src/aarch64/ffi.c
@@ -808,7 +808,8 @@ ffi_prep_closure_loc (ffi_closure *closu
   ffi_clear_cache(tramp, tramp + FFI_TRAMPOLINE_SIZE);
 
   /* Also flush the cache for code mapping.  */
-#ifdef _M_ARM64
+#if defined(_M_ARM64) || defined(__NetBSD__)
+  // ffi_data_to_code_pointer is broken on NetBSD
   // Not using dlmalloc.c for Windows ARM64 builds
   // so calling ffi_data_to_code_pointer() isn't necessary
   unsigned char *tramp_code = tramp;