Index: head/devel/libffi/Makefile =================================================================== --- head/devel/libffi/Makefile (revision 545529) +++ head/devel/libffi/Makefile (revision 545530) @@ -1,33 +1,37 @@ # Created by: Horance Chou # $FreeBSD$ 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 LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE TEST_DEPENDS= runtest:misc/dejagnu USES= compiler:c11 libtool pathfix USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-multi-os-directory INSTALL_TARGET= install-strip INFO= libffi TEST_TARGET= check post-patch: @${REINPLACE_CMD} -e 's| -Wno-psabi||g' \ ${WRKSRC}/testsuite/lib/libffi.exp .include Index: head/devel/libffi/distinfo =================================================================== --- head/devel/libffi/distinfo (revision 545529) +++ head/devel/libffi/distinfo (revision 545530) @@ -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 Index: head/devel/libffi/files/patch-configure =================================================================== --- head/devel/libffi/files/patch-configure (nonexistent) +++ head/devel/libffi/files/patch-configure (revision 545530) @@ -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.* Property changes on: head/devel/libffi/files/patch-configure ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/libffi321/Makefile =================================================================== --- head/devel/libffi321/Makefile (revision 545529) +++ head/devel/libffi321/Makefile (revision 545530) @@ -1,25 +1,25 @@ # Created by: Horance Chou # $FreeBSD$ PORTNAME= libffi PORTVERSION= 3.2.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= SOURCEWARE/${PORTNAME} PKGNAMESUFFIX= 321 MAINTAINER= zeising@FreeBSD.org COMMENT= Foreign Function Interface (stripped down compat version) LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE USES= libtool USE_LDCONFIG= ${PREFIX}/lib/compat GNU_CONFIGURE= yes CONFIGURE_ARGS= --libdir=${PREFIX}/lib/compat \ --disable-static INSTALL_TARGET= install-strip .include Index: head/devel/libffi321/files/patch-configure =================================================================== --- head/devel/libffi321/files/patch-configure (revision 545529) +++ head/devel/libffi321/files/patch-configure (revision 545530) @@ -1,124 +1,146 @@ --- configure.orig 2014-11-12 11:59:57 UTC +++ configure @@ -17221,7 +17221,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 @@ -17255,6 +17255,10 @@ case "$host" in TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc HAVE_LONG_DOUBLE_VARIANT=1 ;; + powerpcspe-*-freebsd*) + TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc + CFLAGS="$CFLAGS -D__NO_FPRS__" + ;; powerpc64-*-freebsd*) TARGET=POWERPC; TARGETDIR=powerpc ;; @@ -18289,7 +18293,8 @@ $as_echo "#define HAVE_AS_CFI_PSEUDO_OP 1" >>confdefs. fi -if test x$TARGET = xSPARC; then +case "$TARGET" in + SPARC) { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler and linker support unaligned pc related relocs" >&5 $as_echo_n "checking assembler and linker support unaligned pc related relocs... " >&6; } if ${libffi_cv_as_sparc_ua_pcrel+:} false; then : @@ -18363,9 +18368,9 @@ $as_echo "$libffi_cv_as_register_pseudo_op" >&6; } $as_echo "#define HAVE_AS_REGISTER_PSEUDO_OP 1" >>confdefs.h fi -fi + ;; -if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then + X86*) { $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 : - $as_echo_n "(cached) " >&6 -else - - libffi_cv_as_ascii_pseudo_op=unknown - # Check if we have .ascii - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -asm (".ascii \\"string\\""); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - libffi_cv_as_ascii_pseudo_op=yes -else - libffi_cv_as_ascii_pseudo_op=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_ascii_pseudo_op" >&5 -$as_echo "$libffi_cv_as_ascii_pseudo_op" >&6; } - if test "x$libffi_cv_as_ascii_pseudo_op" = xyes; then - -$as_echo "#define HAVE_AS_ASCII_PSEUDO_OP 1" >>confdefs.h - - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler .string pseudo-op support" >&5 -$as_echo_n "checking assembler .string pseudo-op support... " >&6; } -if ${libffi_cv_as_string_pseudo_op+:} false; then : - $as_echo_n "(cached) " >&6 -else - - libffi_cv_as_string_pseudo_op=unknown - # Check if we have .string - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -asm (".string \\"string\\""); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - libffi_cv_as_string_pseudo_op=yes -else - libffi_cv_as_string_pseudo_op=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_string_pseudo_op" >&5 -$as_echo "$libffi_cv_as_string_pseudo_op" >&6; } - if test "x$libffi_cv_as_string_pseudo_op" = xyes; then - -$as_echo "#define HAVE_AS_STRING_PSEUDO_OP 1" >>confdefs.h - - 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.* + Index: head/devel/libffi321/files/patch-src__arm__ffi.c =================================================================== --- head/devel/libffi321/files/patch-src__arm__ffi.c (revision 545529) +++ head/devel/libffi321/files/patch-src__arm__ffi.c (revision 545530) @@ -1,36 +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 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 +#if defined(__FreeBSD__) && defined(__arm__) +#include +#include +#endif + /* 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; \ + \ + ua.addr = (uintptr_t)(start); \ + ua.len = (char *)(end) - (char *)start; \ + 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); \ Index: head/devel/libffi321/files/patch-src__mips__ffi.c =================================================================== --- head/devel/libffi321/files/patch-src__mips__ffi.c (revision 545529) +++ head/devel/libffi321/files/patch-src__mips__ffi.c (revision 545530) @@ -1,29 +1,27 @@ -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 #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, +@@ -736,11 +738,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; } Index: head/devel/libffi321/files/patch-src__mips__ffitarget.h =================================================================== --- head/devel/libffi321/files/patch-src__mips__ffitarget.h (revision 545529) +++ head/devel/libffi321/files/patch-src__mips__ffitarget.h (revision 545530) @@ -1,13 +1,11 @@ -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 #define _MIPS_SIM_ABI64 3 -#elif !defined(__OpenBSD__) +#elif !defined(__OpenBSD__) && !defined(__FreeBSD__) # include #endif