From nobody Mon May 30 19:09:48 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 52AB21B53776; Mon, 30 May 2022 19:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LBlMx1YjXz3N6F; Mon, 30 May 2022 19:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653937789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SSZ7b+RfGC5C8qT8MMFqiJ5wE4UxVD0iFnh819uznRo=; b=v65uTfPOevW3ywTJeFtJuEGMqTod3lPQbIxxX1r8KiZKdV73mV+3NrxL1jYbQQxX2CM+Cy P9761ykqq53xRLjkvVlDeYw8Dc1mUGyGwOxyZWywucPLGQj4+8U3/ZFEHWZ+x5V+79fP7C PnWhGBUI+36/fitZDxt8aQfqBKPn83SgpN/7uaTvpe7qHKojZdOC1FT2UalxD4oxk8xctc u5JKDp7e6+B1/Nv2vaYX4Tqq/RDRjMc/MvT733pPye2eUrsoWoe2+BzFWMIpq29S8cpG+t H/As2tllnpk6t+Ig+IBNE3i4t7xd2kq6KAIXd/oWeoSVHQsapg+CWTw5l2C1FA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1235C1CAB7; Mon, 30 May 2022 19:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24UJ9mUd030073; Mon, 30 May 2022 19:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24UJ9mGs030072; Mon, 30 May 2022 19:09:48 GMT (envelope-from git) Date: Mon, 30 May 2022 19:09:48 GMT Message-Id: <202205301909.24UJ9mGs030072@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gleb Popov Subject: git: 957f31fc718f - main - devel/libffi33: Add new port. List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 957f31fc718f2147718e24fb1103718edbab5a3e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653937789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SSZ7b+RfGC5C8qT8MMFqiJ5wE4UxVD0iFnh819uznRo=; b=vxG5k7oMbvyaP3f7CNE5EKzwZzj5AMfbUCiGxIg/53VXa9kfkpZrUSKT78P9wNVWPr/8LM 8nZCLACgCMIf5bDWvTnFIwrnrdP4Q7yP1fi8rKiQ28tQq/CNiOnpWF7dRoEvyZEWKjjX8U lY2mBHaGQdJqNUd9hrh+1JobIjGVgIfQ3/O+iDwzyAKzYJytbTUNcy/7jsZ8z+qVWYH105 5kXFPicQTxv0LxVsVMVC9J1yNYal+FRusP5rMFcTvde79DU+6HgR2aBNlgr2/HdNhQ/qEW zrs/Sf95BSQusDM1+G3scqodzP71k6n9HVpgRUSmJt6BMUFQkTAi05j/U2EmVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653937789; a=rsa-sha256; cv=none; b=NO0qisz3JfBywbUjIHiY0jpc7x5Xs4DFIEqst5CXduYkUP77LCCh2eiI6PRNvNTNJixLjn cB7cDTOELTExpwz2FBTjAP6e4hrCCUJS3DSmUtFgX+Tyb9EcRkAs/jCbkOfegVu8FTCs1T UlStgYSY9SxorQXxsyd5KtBFUTdRIeiZRkP2PQYJHLkqo2WTaTm6E9fGyJ+ioeLKbezkVN lfxt5zBkOQmf/Pf8I+TGvXJKlssjbvd60OYn6A8iJtUNZ5foVOGRibMOA1Ecohh8DzF0jT srwvtZdj+U67tgjNbTJSmbmSu/CqgJ3A+MPPEizksGgX0yDZQhhE9SPV2tzUEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=957f31fc718f2147718e24fb1103718edbab5a3e commit 957f31fc718f2147718e24fb1103718edbab5a3e Author: Gleb Popov AuthorDate: 2022-05-30 18:57:28 +0000 Commit: Gleb Popov CommitDate: 2022-05-30 19:09:38 +0000 devel/libffi33: Add new port. This is a compat port needed mainly for binaries downloaded by devel/stack. See the commit message for devel/libffi321 and the linked PR for detailed explanation. --- devel/Makefile | 1 + devel/libffi33/Makefile | 39 +++++++++++++++++++++++ devel/libffi33/distinfo | 5 +++ devel/libffi33/files/patch-Makefile.in | 16 ++++++++++ devel/libffi33/files/patch-configure | 23 +++++++++++++ devel/libffi33/files/patch-configure.host | 24 ++++++++++++++ devel/libffi33/files/patch-src__arm__ffi.c | 36 +++++++++++++++++++++ devel/libffi33/files/patch-src__mips__ffi.c | 29 +++++++++++++++++ devel/libffi33/files/patch-src__mips__ffitarget.h | 13 ++++++++ devel/libffi33/files/patch-src_riscv_ffi.c | 12 +++++++ devel/libffi33/pkg-descr | 6 ++++ devel/libffi33/pkg-plist | 10 ++++++ 12 files changed, 214 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 2a4c76f15698..e290ee930425 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -1241,6 +1241,7 @@ SUBDIR += libffcall SUBDIR += libffi SUBDIR += libffi321 + SUBDIR += libffi33 SUBDIR += libfirm SUBDIR += libfixposix SUBDIR += libflatarray diff --git a/devel/libffi33/Makefile b/devel/libffi33/Makefile new file mode 100644 index 000000000000..c4ee0edc6ca9 --- /dev/null +++ b/devel/libffi33/Makefile @@ -0,0 +1,39 @@ +# Created by: Horance Chou + +PORTNAME= libffi +PORTVERSION= 3.3 +PORTREVISION= 1 +CATEGORIES= devel +MASTER_SITES= SOURCEWARE/${PORTNAME} +PKGNAMESUFFIX= 33 + +PATCH_SITES= https://github.com/${PORTNAME}/${PORTNAME}/commit/ +PATCHFILES+= 01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff:-p1 +# This patch is for configure.ac. +# A local patch against configure has been created in files/patch-configure. +#PATCHFILES+= 8c50837f0b58ba5b2bcb1b424a2a4bfa01559fb2.diff:-p1 + +MAINTAINER= ports@FreeBSD.org +COMMENT= Foreign Function Interface (stripped down compat version) + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +TEST_DEPENDS= runtest:misc/dejagnu + +USES= compiler:c11 cpe libtool pathfix +USE_LDCONFIG= ${PREFIX}/lib/compat +GNU_CONFIGURE= yes +CPE_VENDOR= libffi_project + +CONFIGURE_ARGS= --disable-multi-os-directory --disable-static \ + --libdir=${PREFIX}/lib/compat +INSTALL_TARGET= install-strip +INFO= libffi +TEST_TARGET= check + +post-patch: + @${REINPLACE_CMD} -e 's| -Wno-psabi||g' \ + ${WRKSRC}/testsuite/lib/libffi.exp + +.include diff --git a/devel/libffi33/distinfo b/devel/libffi33/distinfo new file mode 100644 index 000000000000..fb8ce67abd43 --- /dev/null +++ b/devel/libffi33/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1651590393 +SHA256 (libffi-3.3.tar.gz) = 72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056 +SIZE (libffi-3.3.tar.gz) = 1305466 +SHA256 (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff) = 79935f5836624a9b38d0d40541a9d7510f4ecff14f6a7881f483b158cf13d335 +SIZE (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff) = 414 diff --git a/devel/libffi33/files/patch-Makefile.in b/devel/libffi33/files/patch-Makefile.in new file mode 100644 index 000000000000..731e61881f65 --- /dev/null +++ b/devel/libffi33/files/patch-Makefile.in @@ -0,0 +1,16 @@ +This patch is based on the following upstream patch +From 0027b072627aa9d3ada71c4374561966064ecd5a Mon Sep 17 00:00:00 2001 +From: "M. Herdiansyah" +Date: Thu, 11 Jun 2020 19:40:24 +0700 +Subject: [PATCH] Makefile: increase compatibility with bmake (#551) +--- Makefile.in.orig 2020-07-04 16:53:39 UTC ++++ Makefile.in +@@ -2012,7 +2012,7 @@ uninstall-am: uninstall-pkgconfigDATA uninstall-toolex + @LIBFFI_BUILD_VERSIONED_SHLIB_SUN_TRUE@@LIBFFI_BUILD_VERSIONED_SHLIB_TRUE@ > $@ || (rm -f $@ ; exit 1) + + libffi.map: $(top_srcdir)/libffi.map.in +- $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $< ++ $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $(top_srcdir)/libffi.map.in + + dist-hook: + d=`(cd $(distdir); pwd)`; (cd doc; make pdf; cp *.pdf $$d/doc) diff --git a/devel/libffi33/files/patch-configure b/devel/libffi33/files/patch-configure new file mode 100644 index 000000000000..2ea2ea9dcb96 --- /dev/null +++ b/devel/libffi33/files/patch-configure @@ -0,0 +1,23 @@ +--- configure.orig 2020-08-20 10:54:03 UTC ++++ configure +@@ -18545,17 +18545,11 @@ if ${libffi_cv_ro_eh_frame+:} false; then : + $as_echo_n "(cached) " >&6 + else + +- libffi_cv_ro_eh_frame=no ++ libffi_cv_ro_eh_frame=yes + echo 'extern void foo (void); void bar (void) { foo (); foo (); }' > conftest.c + if $CC $CFLAGS -c -fpic -fexceptions -o conftest.o conftest.c > /dev/null 2>&1; then +- objdump -h conftest.o > conftest.dump 2>&1 +- libffi_eh_frame_line=`grep -n eh_frame conftest.dump | cut -d: -f 1` +- if test "x$libffi_eh_frame_line" != "x"; then +- libffi_test_line=`expr $libffi_eh_frame_line + 1`p +- sed -n $libffi_test_line conftest.dump > conftest.line +- if grep READONLY conftest.line > /dev/null; then +- libffi_cv_ro_eh_frame=yes +- fi ++ if readelf -WS conftest.o | grep -q -n 'eh_frame .* WA'; then ++ libffi_cv_ro_eh_frame=no + fi + fi + rm -f conftest.* diff --git a/devel/libffi33/files/patch-configure.host b/devel/libffi33/files/patch-configure.host new file mode 100644 index 000000000000..f2e70f9cd244 --- /dev/null +++ b/devel/libffi33/files/patch-configure.host @@ -0,0 +1,24 @@ +--- configure.host.orig 2019-11-22 17:55:36.000000000 -0600 ++++ configure.host 2020-08-28 12:48:23.259024000 -0500 +@@ -167,7 +167,7 @@ case "${host}" in + mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*) + TARGET=MIPS; TARGETDIR=mips + ;; +- mips*-*linux* | mips*-*-openbsd*) ++ mips*-*linux* | mips*-*-openbsd* | mips*-*-freebsd*) + # Support 128-bit long double for NewABI. + HAVE_LONG_DOUBLE='defined(__mips64)' + TARGET=MIPS; TARGETDIR=mips +@@ -203,7 +203,11 @@ case "${host}" in + TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc + HAVE_LONG_DOUBLE_VARIANT=1 + ;; +- powerpc64-*-freebsd*) ++ powerpcspe-*-freebsd*) ++ TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc ++ CFLAGS="$CFLAGS -D__NO_FPRS__" ++ ;; ++ powerpc64-*-freebsd* | powerpc64le-*-freebsd*) + TARGET=POWERPC; TARGETDIR=powerpc + ;; + powerpc*-*-rtems*) diff --git a/devel/libffi33/files/patch-src__arm__ffi.c b/devel/libffi33/files/patch-src__arm__ffi.c new file mode 100644 index 000000000000..02141745c36c --- /dev/null +++ b/devel/libffi33/files/patch-src__arm__ffi.c @@ -0,0 +1,36 @@ +# Description: Fix abort() on ARM related to __clear_cache(). This is an issue +# for anything !apple that is using the libcompiler_rt provided by clang on ARM +# PR: ports/149167 ports/184517 +# Patch by: cognet@ (to be upstreamed @ LLVM) + +--- src/arm/ffi.c.orig 2019-10-31 14:49:54 UTC ++++ src/arm/ffi.c +@@ -55,6 +55,11 @@ extern unsigned int ffi_arm_trampoline[3] FFI_HIDDEN; + #endif + #endif + ++#if defined(__FreeBSD__) && defined(__arm__) ++#include ++#include ++#endif ++ + /* Forward declares. */ + static int vfp_type_p (const ffi_type *); + static void layout_vfp_args (ffi_cif *); +@@ -568,6 +573,16 @@ void ffi_go_closure_SYSV (void) FFI_HIDDEN; + void ffi_go_closure_VFP (void) FFI_HIDDEN; + + /* the cif must already be prep'ed */ ++ ++#if defined(__FreeBSD__) && defined(__arm__) ++#define __clear_cache(start, end) do { \ ++ struct arm_sync_icache_args ua; \ ++ \ ++ ua.addr = (uintptr_t)(start); \ ++ ua.len = (char *)(end) - (char *)start; \ ++ sysarch(ARM_SYNC_ICACHE, &ua); \ ++ } while (0); ++#endif + + ffi_status + ffi_prep_closure_loc (ffi_closure * closure, diff --git a/devel/libffi33/files/patch-src__mips__ffi.c b/devel/libffi33/files/patch-src__mips__ffi.c new file mode 100644 index 000000000000..d93f373760b1 --- /dev/null +++ b/devel/libffi33/files/patch-src__mips__ffi.c @@ -0,0 +1,29 @@ +diff --git ./src/mips/ffi.c.orig ./src/mips/ffi.c +index 03121e3..8b7881f 100644 +--- ./src/mips/ffi.c.orig ++++ ./src/mips/ffi.c +@@ -38,7 +38,9 @@ + #endif + + #ifndef USE__BUILTIN___CLEAR_CACHE +-# if defined(__OpenBSD__) ++# if defined(__FreeBSD__) ++# include ++# elif defined(__OpenBSD__) + # include + # else + # include +@@ -729,11 +731,13 @@ ffi_prep_closure_loc (ffi_closure *closure, + closure->fun = fun; + closure->user_data = user_data; + ++#if !defined(__FreeBSD__) + #ifdef USE__BUILTIN___CLEAR_CACHE + __builtin___clear_cache(clear_location, clear_location + FFI_TRAMPOLINE_SIZE); + #else + cacheflush (clear_location, FFI_TRAMPOLINE_SIZE, ICACHE); + #endif ++#endif /* ! __FreeBSD__ */ + return FFI_OK; + } + diff --git a/devel/libffi33/files/patch-src__mips__ffitarget.h b/devel/libffi33/files/patch-src__mips__ffitarget.h new file mode 100644 index 000000000000..4c52e32667c3 --- /dev/null +++ b/devel/libffi33/files/patch-src__mips__ffitarget.h @@ -0,0 +1,13 @@ +diff --git ./src/mips/ffitarget.h.orig ./src/mips/ffitarget.h +index 717d659..5a0c2b1 100644 +--- ./src/mips/ffitarget.h.orig ++++ ./src/mips/ffitarget.h +@@ -41,7 +41,7 @@ + #define _MIPS_SIM_ABI32 1 + #define _MIPS_SIM_NABI32 2 + #define _MIPS_SIM_ABI64 3 +-#elif !defined(__OpenBSD__) ++#elif !defined(__OpenBSD__) && !defined(__FreeBSD__) + # include + #endif + diff --git a/devel/libffi33/files/patch-src_riscv_ffi.c b/devel/libffi33/files/patch-src_riscv_ffi.c new file mode 100644 index 000000000000..fc3e729e8e45 --- /dev/null +++ b/devel/libffi33/files/patch-src_riscv_ffi.c @@ -0,0 +1,12 @@ +--- src/riscv/ffi.c.orig 2019-10-31 14:49:54 UTC ++++ src/riscv/ffi.c +@@ -417,7 +417,9 @@ ffi_status ffi_prep_closure_loc(ffi_clos + closure->fun = fun; + closure->user_data = user_data; + ++#if !defined(__FreeBSD__) + __builtin___clear_cache(codeloc, codeloc + FFI_TRAMPOLINE_SIZE); ++#endif + + return FFI_OK; + } diff --git a/devel/libffi33/pkg-descr b/devel/libffi33/pkg-descr new file mode 100644 index 000000000000..db7bfcd2a6fe --- /dev/null +++ b/devel/libffi33/pkg-descr @@ -0,0 +1,6 @@ +The libffi library provides a portable, high level programming +interface to various calling conventions. This allows a programmer to +call any function specified by a call interface description at run +time. + +WWW: https://sourceware.org/libffi/ diff --git a/devel/libffi33/pkg-plist b/devel/libffi33/pkg-plist new file mode 100644 index 000000000000..db2c3d3721d1 --- /dev/null +++ b/devel/libffi33/pkg-plist @@ -0,0 +1,10 @@ +lib/compat/libffi.so +lib/compat/libffi.so.7 +lib/compat/libffi.so.7.1.0 +@comment include/ffi.h +@comment include/ffitarget.h +@comment libdata/pkgconfig/libffi.pc +@comment man/man3/ffi.3.gz +@comment man/man3/ffi_call.3.gz +@comment man/man3/ffi_prep_cif.3.gz +@comment man/man3/ffi_prep_cif_var.3.gz