From owner-svn-ports-head@freebsd.org Thu Aug 20 11:34:30 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D63A93BB4A5; Thu, 20 Aug 2020 11:34:30 +0000 (UTC) (envelope-from zeising@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BXMxf5MgVz4L2Y; Thu, 20 Aug 2020 11:34:30 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CDA613D80; Thu, 20 Aug 2020 11:34:30 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07KBYUjt098694; Thu, 20 Aug 2020 11:34:30 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07KBYSKa098683; Thu, 20 Aug 2020 11:34:28 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202008201134.07KBYSKa098683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Thu, 20 Aug 2020 11:34:28 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r545530 - in head/devel: libffi libffi/files libffi321 libffi321/files X-SVN-Group: ports-head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in head/devel: libffi libffi/files libffi321 libffi321/files X-SVN-Commit-Revision: 545530 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2020 11:34:30 -0000 Author: zeising Date: Thu Aug 20 11:34:28 2020 New Revision: 545530 URL: https://svnweb.freebsd.org/changeset/ports/545530 Log: devel/libffi: Fix build on i386 without objdump FreeBSD 13 does not have any objdump in the default installation, which causes issues with libffi on i386 with the recent update to llvm 11. Add a patch originally from upstream, to use readelf instead of objdump. The patch is for configure.ac originally. I've applied it and rerun autoreconf and committed the result, instead of adding a dependency on autoreconf. Fix devel/libffi321 in the same way. While here, fix the fuzz on a few other patches, which made it much easier to sort out the configure patch. Thanks to dim@ for helping me figure out the issue. MFH: 2020Q3 Added: head/devel/libffi/files/patch-configure (contents, props changed) Modified: head/devel/libffi/Makefile head/devel/libffi/distinfo head/devel/libffi321/Makefile head/devel/libffi321/files/patch-configure head/devel/libffi321/files/patch-src__arm__ffi.c head/devel/libffi321/files/patch-src__mips__ffi.c head/devel/libffi321/files/patch-src__mips__ffitarget.h Modified: head/devel/libffi/Makefile ============================================================================== --- head/devel/libffi/Makefile Thu Aug 20 11:17:34 2020 (r545529) +++ head/devel/libffi/Makefile Thu Aug 20 11:34:28 2020 (r545530) @@ -3,11 +3,15 @@ PORTNAME= libffi PORTVERSION= 3.3 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= SOURCEWARE/${PORTNAME} PATCH_SITES= https://github.com/${PORTNAME}/${PORTNAME}/commit/ -PATCHFILES= 01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.patch:-p1 +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= zeising@FreeBSD.org COMMENT= Foreign Function Interface Modified: head/devel/libffi/distinfo ============================================================================== --- head/devel/libffi/distinfo Thu Aug 20 11:17:34 2020 (r545529) +++ head/devel/libffi/distinfo Thu Aug 20 11:34:28 2020 (r545530) @@ -1,5 +1,5 @@ -TIMESTAMP = 1595286570 +TIMESTAMP = 1597921173 SHA256 (libffi-3.3.tar.gz) = 72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056 SIZE (libffi-3.3.tar.gz) = 1305466 -SHA256 (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.patch) = 13299479bc5259456912afaf6d6d8fb97ed8e42938ff42902d4d7bcffe7d9660 -SIZE (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.patch) = 1234 +SHA256 (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff) = 627aac849e93debaa21cd85feb82b1a28cf481687a14717cf522eaec2a2b19aa +SIZE (01a75ed76ea7e57f1b7a5c183e2b1e890e6aa0fd.diff) = 412 Added: head/devel/libffi/files/patch-configure ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/libffi/files/patch-configure Thu Aug 20 11:34:28 2020 (r545530) @@ -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.* Modified: head/devel/libffi321/Makefile ============================================================================== --- head/devel/libffi321/Makefile Thu Aug 20 11:17:34 2020 (r545529) +++ head/devel/libffi321/Makefile Thu Aug 20 11:34:28 2020 (r545530) @@ -3,7 +3,7 @@ PORTNAME= libffi PORTVERSION= 3.2.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= SOURCEWARE/${PORTNAME} PKGNAMESUFFIX= 321 Modified: head/devel/libffi321/files/patch-configure ============================================================================== --- head/devel/libffi321/files/patch-configure Thu Aug 20 11:17:34 2020 (r545529) +++ head/devel/libffi321/files/patch-configure Thu Aug 20 11:34:28 2020 (r545530) @@ -42,11 +42,13 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler supports pc related relocs" >&5 $as_echo_n "checking assembler supports pc related relocs... " >&6; } if ${libffi_cv_as_x86_pcrel+:} false; then : -@@ -18386,77 +18391,8 @@ $as_echo "$libffi_cv_as_x86_pcrel" >&6; } +@@ -18386,78 +18391,9 @@ $as_echo "$libffi_cv_as_x86_pcrel" >&6; } $as_echo "#define HAVE_AS_X86_PCREL 1" >>confdefs.h fi -- ++ ;; ++esac + - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .ascii pseudo-op support" >&5 -$as_echo_n "checking assembler .ascii pseudo-op support... " >&6; } -if ${libffi_cv_as_ascii_pseudo_op+:} false; then : @@ -117,8 +119,28 @@ - - fi -fi -+ ;; -+esac - +- # On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. # Check whether --enable-pax_emutramp was given. + if test "${enable_pax_emutramp+set}" = set; then : +@@ -18592,16 +18528,12 @@ 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` +- 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.* + Modified: head/devel/libffi321/files/patch-src__arm__ffi.c ============================================================================== --- head/devel/libffi321/files/patch-src__arm__ffi.c Thu Aug 20 11:17:34 2020 (r545529) +++ head/devel/libffi321/files/patch-src__arm__ffi.c Thu Aug 20 11:34:28 2020 (r545530) @@ -3,8 +3,8 @@ # PR: ports/149167 ports/184517 # Patch by: cognet@ (to be upstreamed @ LLVM) ---- ./src/arm/ffi.c.orig 2013-03-16 22:19:39.000000000 +1100 -+++ ./src/arm/ffi.c 2013-12-03 19:30:58.440924300 +1100 +--- src/arm/ffi.c.orig 2014-11-08 12:47:24 UTC ++++ src/arm/ffi.c @@ -33,6 +33,11 @@ #include @@ -17,10 +17,11 @@ /* Forward declares. */ static int vfp_type_p (ffi_type *); static void layout_vfp_args (ffi_cif *); -@@ -582,6 +587,16 @@ +@@ -750,6 +755,16 @@ ffi_closure_free (void *ptr) + } #else - ++ +#if defined(__FreeBSD__) && defined(__arm__) +#define __clear_cache(start, end) do { \ + struct arm_sync_icache_args ua; \ @@ -30,7 +31,6 @@ + sysarch(ARM_SYNC_ICACHE, &ua); \ + } while (0); +#endif -+ + #define FFI_INIT_TRAMPOLINE(TRAMP,FUN,CTX) \ ({ unsigned char *__tramp = (unsigned char*)(TRAMP); \ - unsigned int __fun = (unsigned int)(FUN); \ Modified: head/devel/libffi321/files/patch-src__mips__ffi.c ============================================================================== --- head/devel/libffi321/files/patch-src__mips__ffi.c Thu Aug 20 11:17:34 2020 (r545529) +++ head/devel/libffi321/files/patch-src__mips__ffi.c Thu Aug 20 11:34:28 2020 (r545530) @@ -1,7 +1,5 @@ -diff --git ./src/mips/ffi.c.orig ./src/mips/ffi.c -index 03121e3..8b7881f 100644 ---- ./src/mips/ffi.c.orig -+++ ./src/mips/ffi.c +--- src/mips/ffi.c.orig 2014-11-08 12:47:24 UTC ++++ src/mips/ffi.c @@ -38,7 +38,9 @@ #endif @@ -13,7 +11,7 @@ index 03121e3..8b7881f 100644 # include # else # include -@@ -729,11 +731,13 @@ ffi_prep_closure_loc (ffi_closure *closure, +@@ -736,11 +738,13 @@ ffi_prep_closure_loc (ffi_closure *closure, closure->fun = fun; closure->user_data = user_data; Modified: head/devel/libffi321/files/patch-src__mips__ffitarget.h ============================================================================== --- head/devel/libffi321/files/patch-src__mips__ffitarget.h Thu Aug 20 11:17:34 2020 (r545529) +++ head/devel/libffi321/files/patch-src__mips__ffitarget.h Thu Aug 20 11:34:28 2020 (r545530) @@ -1,7 +1,5 @@ -diff --git ./src/mips/ffitarget.h.orig ./src/mips/ffitarget.h -index 717d659..5a0c2b1 100644 ---- ./src/mips/ffitarget.h.orig -+++ ./src/mips/ffitarget.h +--- src/mips/ffitarget.h.orig 2014-11-08 12:47:24 UTC ++++ src/mips/ffitarget.h @@ -41,7 +41,7 @@ #define _MIPS_SIM_ABI32 1 #define _MIPS_SIM_NABI32 2