View | Details | Raw Unified | Return to bug 196408 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-8 / +8 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	libffi
4
PORTNAME=	libffi
5
PORTVERSION=	3.0.13
5
PORTVERSION=	3.2.1
6
PORTREVISION=	3
7
CATEGORIES=	devel
6
CATEGORIES=	devel
8
MASTER_SITES=	SOURCEWARE
7
MASTER_SITES=	SOURCEWARE
9
MASTER_SITE_SUBDIR=	${PORTNAME}
8
MASTER_SITE_SUBDIR=	${PORTNAME}
Lines 12-17 Link Here
12
COMMENT=	Foreign Function Interface
11
COMMENT=	Foreign Function Interface
13
12
14
LICENSE=	MIT
13
LICENSE=	MIT
14
LICENSE_FILE=	${WRKSRC}/LICENSE
15
15
16
TEST_DEPENDS=	runtest:${PORTSDIR}/misc/dejagnu
16
TEST_DEPENDS=	runtest:${PORTSDIR}/misc/dejagnu
17
17
Lines 20-37 Link Here
20
GNU_CONFIGURE=	yes
20
GNU_CONFIGURE=	yes
21
21
22
OPTIONS_DEFINE=	TESTS
22
OPTIONS_DEFINE=	TESTS
23
TESTS_DESC=	Include tools for test suite
24
23
25
.include <bsd.port.options.mk>
24
TESTS_DESC=		Include tools for test suite
25
TESTS_BUILD_DEPENDS=	${TEST_DEPENDS}
26
26
27
.if ${PORT_OPTIONS:MTESTS}
28
BUILD_DEPENDS:=	${TEST_DEPENDS}
29
.endif
30
31
INSTALL_TARGET=	install-strip
27
INSTALL_TARGET=	install-strip
32
INFO=		libffi
28
INFO=		libffi
33
PLIST_SUB=	PORTVERSION=${PORTVERSION}
29
PLIST_SUB=	PORTVERSION=${PORTVERSION}
34
30
31
post-patch:
32
	@${REINPLACE_CMD} -e 's| -Wno-psabi||g' \
33
		${WRKSRC}/testsuite/lib/libffi.exp
34
35
post-install:
35
post-install:
36
	@${LN} -sf ../lib/libffi-${PORTVERSION}/include/ffi.h \
36
	@${LN} -sf ../lib/libffi-${PORTVERSION}/include/ffi.h \
37
	    ${STAGEDIR}${PREFIX}/include/
37
	    ${STAGEDIR}${PREFIX}/include/
(-)distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (libffi-3.0.13.tar.gz) = 1dddde1400c3bcb7749d398071af88c3e4754058d2d4c0b3696c2f82dc5cf11c
1
SHA256 (libffi-3.2.1.tar.gz) = d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37
2
SIZE (libffi-3.0.13.tar.gz) = 845747
2
SIZE (libffi-3.2.1.tar.gz) = 940837
(-)files/patch-b5ade2 (+112 lines)
Line 0 Link Here
1
# Clang doesn't like the -Wno-psabi argument that we want to pass to GCC.
2
# Since clang is detected as GCC via __GNUC__, use ax_cv_c_compiler_vendor.
3
# https://github.com/atgreen/libffi/commit/b5ade2fb5d9ba06519484677a5474e5dad48c2e3
4
5
diff --git a/testsuite/lib/libffi.exp b/testsuite/lib/libffi.exp
6
index 5051d31..0e92bb0 100644
7
--- testsuite/lib/libffi.exp
8
+++ testsuite/lib/libffi.exp
9
@@ -100,46 +100,39 @@ proc libffi-init { args } {
10
     global libffi_link_flags
11
     global tool_root_dir
12
     global ld_library_path
13
-
14
-    global using_gcc
15
+    global compiler_vendor
16
 
17
     set blddirffi [pwd]/.. 
18
     verbose "libffi $blddirffi"
19
 
20
-    # Are we building with GCC?
21
-    set tmp [grep ../config.status "GCC='yes'"]
22
-    if { [string match $tmp "GCC='yes'"] } {
23
-
24
-      set using_gcc "yes"
25
+    # Which compiler are we building with?
26
+    set tmp [grep ../config.log "^ax_cv_c_compiler_vendor.*$"]
27
+    regexp -- {^[^=]*=(.*)$} $tmp nil compiler_vendor
28
 
29
-    set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
30
-    if {$gccdir != ""} {
31
-	set gccdir [file dirname $gccdir]
32
-    }
33
-    verbose "gccdir $gccdir"
34
-
35
-    set ld_library_path "."
36
-    append ld_library_path ":${gccdir}"
37
-
38
-    set compiler "${gccdir}/xgcc"
39
-    if { [is_remote host] == 0 && [which $compiler] != 0 } {
40
-	foreach i "[exec $compiler --print-multi-lib]" {
41
-	    set mldir ""
42
-	    regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
43
-	    set mldir [string trimright $mldir "\;@"]
44
-	    if { "$mldir" == "." } {
45
-		continue
46
-	    }
47
-	    if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
48
-		append ld_library_path ":${gccdir}/${mldir}"
49
+    if { [string match $compiler_vendor "gnu"] } {
50
+        set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
51
+        if {$gccdir != ""} {
52
+	    set gccdir [file dirname $gccdir]
53
+        }
54
+        verbose "gccdir $gccdir"
55
+
56
+        set ld_library_path "."
57
+        append ld_library_path ":${gccdir}"
58
+
59
+        set compiler "${gccdir}/xgcc"
60
+        if { [is_remote host] == 0 && [which $compiler] != 0 } {
61
+	    foreach i "[exec $compiler --print-multi-lib]" {
62
+	        set mldir ""
63
+	        regexp -- "\[a-z0-9=_/\.-\]*;" $i mldir
64
+	        set mldir [string trimright $mldir "\;@"]
65
+	        if { "$mldir" == "." } {
66
+		    continue
67
+	        }
68
+	        if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] >= 1 } {
69
+		    append ld_library_path ":${gccdir}/${mldir}"
70
+	        }
71
 	    }
72
-	}
73
-    }
74
- 
75
-    } else {
76
-
77
-      set using_gcc "no"
78
-
79
+        }
80
     }
81
 
82
     # add the library path for libffi.
83
@@ -278,18 +271,25 @@ proc libffi-dg-runtest { testcases default-extra-flags } {
84
 }
85
 
86
 proc run-many-tests { testcases extra_flags } {
87
-    global using_gcc
88
-    if { [string match $using_gcc "yes"] } {
89
+    global compiler_vendor
90
+    switch $compiler_vendor {
91
+      "clang" {
92
+	set common "-W -Wall"
93
+	set optimizations { "-O0" "-O1" "-O2" "-O3" "-Os" }
94
+      }
95
+      "gnu" {
96
         set common "-W -Wall -Wno-psabi"
97
         set optimizations { "-O0" "-O2" "-O3" "-Os" "-O2 -fomit-frame-pointer" }
98
-    } else {
99
+      }
100
+      default {
101
         # Assume we are using the vendor compiler.
102
         set common ""
103
         set optimizations { "" }
104
+      }
105
     }
106
 
107
     set targetabis { "" }
108
-    if [string match $using_gcc "yes"] {
109
+    if [string match $compiler_vendor "gnu"] {
110
         if [istarget "i?86-*-*"] {
111
             set targetabis {
112
                 ""
(-)files/patch-configure (-7 / +5 lines)
Lines 1-13 Link Here
1
diff --git ./configure.orig ./configure
1
--- configure.orig	2015-01-01 10:56:10 UTC
2
index 4b04db7..0d94fbd 100755
2
+++ configure
3
--- ./configure.orig
3
@@ -17221,7 +17221,7 @@ case "$host" in
4
+++ ./configure
5
@@ -13428,7 +13428,7 @@ case "$host" in
6
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
4
   mips-sgi-irix5.* | mips-sgi-irix6.* | mips*-*-rtems*)
7
 	TARGET=MIPS; TARGETDIR=mips
5
 	TARGET=MIPS; TARGETDIR=mips
8
 	;;
6
 	;;
9
-  mips*-*-linux* | mips*-*-openbsd*)
7
-  mips*-*linux* | mips*-*-openbsd*)
10
+  mips*-*-linux* | mips*-*-openbsd* | mips*-*-freebsd*)
8
+  mips*-*linux* | mips*-*-openbsd* | mips*-*-freebsd*)
11
 	# Support 128-bit long double for NewABI.
9
 	# Support 128-bit long double for NewABI.
12
 	HAVE_LONG_DOUBLE='defined(__mips64)'
10
 	HAVE_LONG_DOUBLE='defined(__mips64)'
13
 	TARGET=MIPS; TARGETDIR=mips
11
 	TARGET=MIPS; TARGETDIR=mips
(-)files/patch-src_arm_sysv.S (+15 lines)
Line 0 Link Here
1
# Description: 3.2.1 fails to build with clang 3.5.0 on arm
2
# Issue ID: https://github.com/atgreen/libffi/issues/162
3
# Submitted by: sbruno
4
5
--- src/arm/sysv.S.orig	2015-01-01 10:47:51 UTC
6
+++ src/arm/sysv.S
7
@@ -396,7 +396,7 @@ LSYM(Lbase_args):
8
 	beq	LSYM(Lepilogue_vfp)
9
 
10
 	cmp	r3, #FFI_TYPE_SINT64
11
-	stmeqia	r2, {r0, r1}
12
+	stmiaeq	r2, {r0, r1}
13
 	beq	LSYM(Lepilogue_vfp)
14
 
15
 	cmp	r3, #FFI_TYPE_FLOAT
(-)pkg-plist (-1 / +1 lines)
Lines 5-11 Link Here
5
lib/libffi.a
5
lib/libffi.a
6
lib/libffi.so
6
lib/libffi.so
7
lib/libffi.so.6
7
lib/libffi.so.6
8
lib/libffi.so.6.0.1
8
lib/libffi.so.6.0.4
9
libdata/pkgconfig/libffi.pc
9
libdata/pkgconfig/libffi.pc
10
man/man3/ffi.3.gz
10
man/man3/ffi.3.gz
11
man/man3/ffi_call.3.gz
11
man/man3/ffi_call.3.gz

Return to bug 196408