Date: Sun, 2 Dec 2012 12:20:01 GMT From: Kubilay Kocak <koobs.freebsd@gmail.com> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/171768: [UPDATE] devel/libffi: update to 3.0.11 Message-ID: <201212021220.qB2CK1Zd055047@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/171768; it has been noted by GNATS. From: Kubilay Kocak <koobs.freebsd@gmail.com> To: bug-followup@FreeBSD.org Cc: takefu@airport.fm, rakuco@FreeBSD.org Subject: Re: ports/171768: [UPDATE] devel/libffi: update to 3.0.11 Date: Sun, 02 Dec 2012 23:11:49 +1100 This is a multi-part message in MIME format. --------------070507020908060602020704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I was working on fixing ctypes extension compilation for python on FreeBSD with clang when I came across this PR as it was related to libffi. I couldn't apply the original patches here cleanly, so instead used them as the foundation for the one attached to this follow-up, with lots of additional changes and testing. I'll be submitting the included patch-configure upstream to python-core to re-enable the _ctypes extension on my FreeBSD python buildbots. My patch includes: - Update to 3.0.11 - Update pkg-plist (SHLIB) - Update MAN3 - Add TESTS optionNG - Add TEST_DEPENDS and regression-test: target - Add backup MASTER_SITES mirror - Remove unnecessary patches - Update configure patch (CLANG build, see References section) - Trim Makefile header Changes: https://github.com/atgreen/libffi/blob/v3.0.11/ChangeLog ====[QA]==== portlint: looks fine. testport: Poudriere ------------------------ 8.3-RELEASE amd64 OK 8.3-RELEASE i386 OK 9.0-RELEASE amd64 OK (clang) 9.0-RELEASE amd64 OK (gcc) 9.0-RELEASE i386 OK (clang) 9.0-RELEASE i386 OK (gcc) 9.1-RC3 amd64 OK unittest: (9.0-RELEASE amd64 CC=clang) # of expected passes 1659 # of unsupported tests 55 ============= References (for updated configure patch) - http://www.cygwin.com/ml/libffi-discuss/2011/msg00024.html - https://bugzilla.mozilla.org/show_bug.cgi?id=631928 - https://github.com/atgreen/libffi/issues/21 - https://bugs.gentoo.org/show_bug.cgi?id=417179 ============= --------------070507020908060602020704 Content-Type: text/plain; charset=windows-1252; name="libffi-3.0.11.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libffi-3.0.11.patch" ===> Generating patch ===> Viewing diff with more diff -ruN --exclude=CVS /usr/ports/devel/libffi/Makefile ./Makefile --- /usr/ports/devel/libffi/Makefile 2012-11-17 16:55:54.000000000 +1100 +++ ./Makefile 2012-12-02 22:50:57.317404658 +1100 @@ -1,29 +1,39 @@ -# New ports collection makefile for: libffi -# Date created: 14, June, 1998 -# Whom: Horance Chou <horance@freedom.ie.cycu.edu.tw> -# +# Created by: Horance Chou <horance@freedom.ie.cycu.edu.tw> # $FreeBSD: ports/devel/libffi/Makefile,v 1.33 2012/11/17 05:55:54 svnexp Exp $ -# PORTNAME= libffi -PORTVERSION= 3.0.9 +PORTVERSION= 3.0.11 CATEGORIES= devel -MASTER_SITES= ftp://sourceware.org/pub/libffi/ +MASTER_SITES= ftp://sourceware.org/pub/libffi/ \ + http://www.mirrorservice.org/sites/sourceware.org/pub/libffi/ MAINTAINER= bkoenig@alpha-tierchen.de COMMENT= Foreign Function Interface +TEST_DEPENDS= runtest:${PORTSDIR}/misc/dejagnu + +OPTIONS_DEFINE= TESTS +TESTS_DESC= Install tools for test suite + +.include <bsd.port.options.mk> + +.if ${PORT_OPTIONS:MTESTS} +BUILD_DEPENDS:= ${TEST_DEPENDS} +.endif + GNU_CONFIGURE= yes USE_LDCONFIG= yes USE_GNOME= gnomehack pkgconfig PLIST_SUB= PORTVERSION=${PORTVERSION} INFO= libffi - -MAN3= ffi.3 ffi_call.3 ffi_prep_cif.3 +MAN3= ffi.3 ffi_call.3 ffi_prep_cif.3 ffi_prep_cif_var.3 post-install: @${LN} -sf ../lib/libffi-${PORTVERSION}/include/ffi.h ${PREFIX}/include/ @${LN} -sf ../lib/libffi-${PORTVERSION}/include/ffitarget.h ${PREFIX}/include/ +regression-test: build + @cd ${WRKSRC} && ${GMAKE} check + .include <bsd.port.mk> diff -ruN --exclude=CVS /usr/ports/devel/libffi/distinfo ./distinfo --- /usr/ports/devel/libffi/distinfo 2011-07-04 00:56:07.000000000 +1000 +++ ./distinfo 2012-12-02 20:28:40.998349642 +1100 @@ -1,2 +1,2 @@ -SHA256 (libffi-3.0.9.tar.gz) = 589d25152318bc780cd8919b14670793f4971d9838dab46ed38c32b3ee92c452 -SIZE (libffi-3.0.9.tar.gz) = 731719 +SHA256 (libffi-3.0.11.tar.gz) = 70bfb01356360089aa97d3e71e3edf05d195599fd822e922e50d46a0055a6283 +SIZE (libffi-3.0.11.tar.gz) = 794220 diff -ruN --exclude=CVS /usr/ports/devel/libffi/files/patch-configure ./files/patch-configure --- /usr/ports/devel/libffi/files/patch-configure 2010-12-15 06:33:15.000000000 +1100 +++ ./files/patch-configure 2012-12-02 21:46:23.867613595 +1100 @@ -1,21 +1,16 @@ ---- configure.orig 2010-11-22 12:53:14.000000000 +0100 -+++ configure 2010-11-22 12:53:26.000000000 +0100 -@@ -12231,6 +12231,9 @@ - powerpc-*-freebsd*) - TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc - ;; -+ powerpc64-*-freebsd*) -+ TARGET=POWERPC; TARGETDIR=powerpc -+ ;; - powerpc*-*-rtems*) - TARGET=POWERPC; TARGETDIR=powerpc - ;; -@@ -14484,7 +14487,7 @@ +--- ./configure.orig 2012-12-02 21:43:15.567853289 +1100 ++++ ./configure 2012-12-02 21:46:19.500106089 +1100 +@@ -14252,10 +14252,10 @@ + $as_echo_n "(cached) " >&6 + else - libffi_cv_as_x86_pcrel=yes +- libffi_cv_as_x86_pcrel=yes ++ libffi_cv_as_x86_pcrel=no echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s -- if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then -+ if $CC -c conftest.s 2>&1 | grep -i warning > /dev/null; then - libffi_cv_as_x86_pcrel=no +- if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then +- libffi_cv_as_x86_pcrel=no ++ if $CC $CFLAGS -c conftest.s > /dev/null; then ++ libffi_cv_as_x86_pcrel=yes fi + fi diff -ruN --exclude=CVS /usr/ports/devel/libffi/files/patch-configure.ac ./files/patch-configure.ac --- /usr/ports/devel/libffi/files/patch-configure.ac 1970-01-01 10:00:00.000000000 +1000 +++ ./files/patch-configure.ac 2012-12-02 21:46:23.858120792 +1100 @@ -0,0 +1,16 @@ +--- ./configure.ac.orig 2012-12-02 21:44:22.533085658 +1100 ++++ ./configure.ac 2012-12-02 21:45:17.670216535 +1100 +@@ -297,10 +297,10 @@ + if test x$TARGET = xX86 || test x$TARGET = xX86_WIN32 || test x$TARGET = xX86_64; then + AC_CACHE_CHECK([assembler supports pc related relocs], + libffi_cv_as_x86_pcrel, [ +- libffi_cv_as_x86_pcrel=yes ++ libffi_cv_as_x86_pcrel=no + echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s +- if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then +- libffi_cv_as_x86_pcrel=no ++ if $CC $CFLAGS -c conftest.s > /dev/null; then ++ libffi_cv_as_x86_pcrel=yes + fi + ]) + if test "x$libffi_cv_as_x86_pcrel" = xyes; then diff -ruN --exclude=CVS /usr/ports/devel/libffi/files/patch-src_arm_sysv.S ./files/patch-src_arm_sysv.S --- /usr/ports/devel/libffi/files/patch-src_arm_sysv.S 2008-04-04 23:59:12.000000000 +1100 +++ ./files/patch-src_arm_sysv.S 1970-01-01 10:00:00.000000000 +1000 @@ -1,73 +0,0 @@ ---- src/arm/sysv.S.orig 2008-02-15 02:15:41.000000000 +0100 -+++ src/arm/sysv.S 2008-04-01 13:25:02.000000000 +0200 -@@ -83,14 +83,6 @@ - # define call_reg(x) mov lr, pc ; mov pc, x - #endif - --/* Conditionally compile unwinder directives. */ --#ifdef __ARM_EABI__ --#define UNWIND --#else --#define UNWIND @ --#endif -- -- - #if defined(__thumb__) && !defined(__THUMB_INTERWORK__) - .macro ARM_FUNC_START name - .text -@@ -101,7 +93,6 @@ - bx pc - nop - .arm -- UNWIND .fnstart - /* A hook to tell gdb that we've switched to ARM mode. Also used to call - directly from other local arm routines. */ - _L__\name: -@@ -112,7 +103,6 @@ - .align 0 - .arm - ENTRY(\name) -- UNWIND .fnstart - .endm - #endif - -@@ -145,11 +135,8 @@ - ARM_FUNC_START ffi_call_SYSV - @ Save registers - stmfd sp!, {r0-r3, fp, lr} -- UNWIND .save {r0-r3, fp, lr} - mov fp, sp - -- UNWIND .setfp fp, sp -- - @ Make room for all of the new args. - sub sp, fp, r2 - -@@ -219,7 +206,6 @@ - RETLDM "r0-r3,fp" - - .ffi_call_SYSV_end: -- UNWIND .fnend - .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) - - /* -@@ -231,12 +217,9 @@ - */ - - ARM_FUNC_START ffi_closure_SYSV -- UNWIND .pad #16 - add ip, sp, #16 - stmfd sp!, {ip, lr} -- UNWIND .save {r0, lr} - add r2, sp, #8 -- .pad #16 - sub sp, sp, #16 - str sp, [sp, #8] - add r1, sp, #8 -@@ -291,6 +274,5 @@ - #endif - - .ffi_closure_SYSV_end: -- UNWIND .fnend - .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) - diff -ruN --exclude=CVS /usr/ports/devel/libffi/libffi-3.0.11.patch ./libffi-3.0.11.patch --- /usr/ports/devel/libffi/libffi-3.0.11.patch 1970-01-01 10:00:00.000000000 +1000 +++ ./libffi-3.0.11.patch 2012-12-02 22:59:05.575958821 +1100 @@ -0,0 +1 @@ +===> Generating patch diff -ruN --exclude=CVS /usr/ports/devel/libffi/pkg-plist ./pkg-plist --- /usr/ports/devel/libffi/pkg-plist 2008-10-22 18:31:06.000000000 +1100 +++ ./pkg-plist 2012-12-02 20:28:28.147338109 +1100 @@ -5,7 +5,7 @@ lib/libffi.a lib/libffi.la lib/libffi.so -lib/libffi.so.5 +lib/libffi.so.6 libdata/pkgconfig/libffi.pc @dirrm lib/libffi-%%PORTVERSION%%/include @dirrm lib/libffi-%%PORTVERSION%% ===> Done --------------070507020908060602020704--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212021220.qB2CK1Zd055047>