summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSchala2016-08-18 23:03:10 -0700
committerSchala2016-08-18 23:03:10 -0700
commit20b13b8b4b5d1f630c6391de72d7be2464fc478d (patch)
treebc804f2bb6a244678eb07c3753eaa60e9aba337f
parent3b7794913e06446bfb29cadaa7e5f1687e302175 (diff)
downloadaur-20b13b8b4b5d1f630c6391de72d7be2464fc478d.tar.gz
fix return size
-rw-r--r--.SRCINFO6
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD21
-rw-r--r--fix_return_size.patch50
4 files changed, 73 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 237f7f69ad8..ba0b8067e69 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,9 @@
+# Generated by mksrcinfo v8
+# Fri Aug 19 06:02:51 UTC 2016
pkgbase = mingw-w64-libffi
pkgdesc = Portable foreign function interface library (mingw-w64)
pkgver = 3.2.1
- pkgrel = 1
+ pkgrel = 2
url = http://sourceware.org/libffi
arch = any
license = MIT
@@ -11,7 +13,9 @@ pkgbase = mingw-w64-libffi
options = !buildflags
options = !strip
source = ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz
+ source = fix_return_size.patch
sha1sums = 280c265b789e041c02e5c97815793dfc283fb1e6
+ sha1sums = 812beef0a2dc35a834acbeb2fb4bdc04d7abfda0
pkgname = mingw-w64-libffi
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..f356947551c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg/
+src/
+*.gz
+*.tar
diff --git a/PKGBUILD b/PKGBUILD
index bd7ca93eebd..b34b9a83ff5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
pkgname=mingw-w64-libffi
pkgver=3.2.1
-pkgrel=1
+pkgrel=2
pkgdesc="Portable foreign function interface library (mingw-w64)"
arch=(any)
depends=(mingw-w64-crt)
@@ -8,11 +8,18 @@ makedepends=(mingw-w64-configure)
options=(staticlibs !buildflags !strip)
license=(MIT)
url="http://sourceware.org/libffi"
-source=("ftp://sourceware.org/pub/libffi/libffi-${pkgver}.tar.gz")
-sha1sums=('280c265b789e041c02e5c97815793dfc283fb1e6')
+source=("ftp://sourceware.org/pub/libffi/libffi-${pkgver}.tar.gz"
+"fix_return_size.patch")
+sha1sums=('280c265b789e041c02e5c97815793dfc283fb1e6'
+ '812beef0a2dc35a834acbeb2fb4bdc04d7abfda0')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+prepare() {
+ cd "${srcdir}/libffi-${pkgver}"
+ patch -p2 -i ../fix_return_size.patch
+}
+
build() {
cd "${srcdir}/libffi-${pkgver}"
unset LDFLAGS
@@ -30,10 +37,10 @@ package() {
for _arch in ${_architectures}; do
cd "${srcdir}/libffi-${pkgver}/build-${_arch}"
make DESTDIR="${pkgdir}" install
- rm -rf "$pkgdir/usr/${_arch}/share"
- find "$pkgdir/usr/${_arch}" -name '*.exe' -o -name '*.bat' -o -name '*.def' -o -name '*.exp' | xargs -rtl1 rm
- find "$pkgdir/usr/${_arch}" -name '*.dll' | xargs -rtl1 ${_arch}-strip --strip-unneeded
- find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs -rtl1 ${_arch}-strip -g
+ rm "$pkgdir/usr/${_arch}/share/info/dir"
+ find "$pkgdir/usr/${_arch}" -name '*.exe' -exec ${_arch}-strip {} \;
+ find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
+ find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
done
}
diff --git a/fix_return_size.patch b/fix_return_size.patch
new file mode 100644
index 00000000000..37a51ba7a46
--- /dev/null
+++ b/fix_return_size.patch
@@ -0,0 +1,50 @@
+--- src/libffi-3.2.1/src/x86/ffi.c.orig 2016-07-20 21:24:49.000771900 +0100
++++ src/libffi-3.2.1/src/x86/ffi.c 2016-07-20 21:25:09.918786700 +0100
+@@ -65,7 +65,8 @@
+ if ((ecif->cif->flags == FFI_TYPE_STRUCT
+ || ecif->cif->flags == FFI_TYPE_MS_STRUCT)
+ #ifdef X86_WIN64
+- && ((ecif->cif->rtype->size & (1 | 2 | 4 | 8)) == 0)
++ && (ecif->cif->rtype->size != 1 && ecif->cif->rtype->size != 2
++ && ecif->cif->rtype->size != 4 && ecif->cif->rtype->size != 8)
+ #endif
+ )
+ {
+@@ -108,7 +109,7 @@
+ #ifdef X86_WIN64
+ if (z > FFI_SIZEOF_ARG
+ || ((*p_arg)->type == FFI_TYPE_STRUCT
+- && (z & (1 | 2 | 4 | 8)) == 0)
++ && (z != 1 && z != 2 && z != 4 && z != 8))
+ #if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
+ || ((*p_arg)->type == FFI_TYPE_LONGDOUBLE)
+ #endif
+@@ -360,7 +361,8 @@
+ #ifdef X86_WIN64
+ if (rvalue == NULL
+ && cif->flags == FFI_TYPE_STRUCT
+- && ((cif->rtype->size & (1 | 2 | 4 | 8)) == 0))
++ && cif->rtype->size != 1 && cif->rtype->size != 2
++ && cif->rtype->size != 4 && cif->rtype->size != 8)
+ {
+ ecif.rvalue = alloca((cif->rtype->size + 0xF) & ~0xF);
+ }
+@@ -545,7 +547,8 @@
+ if ((cif->flags == FFI_TYPE_STRUCT
+ || cif->flags == FFI_TYPE_MS_STRUCT)
+ #ifdef X86_WIN64
+- && ((cif->rtype->size & (1 | 2 | 4 | 8)) == 0)
++ && ((cif->rtype->size != 1 && cif->rtype->size != 2
++ && cif->rtype->size != 4 && cif->rtype->size != 8))
+ #endif
+ )
+ {
+@@ -608,7 +611,7 @@
+ #ifdef X86_WIN64
+ if (z > FFI_SIZEOF_ARG
+ || ((*p_arg)->type == FFI_TYPE_STRUCT
+- && (z & (1 | 2 | 4 | 8)) == 0)
++ && (z != 1 && z != 2 && z != 4 && z != 8))
+ #if FFI_TYPE_DOUBLE != FFI_TYPE_LONGDOUBLE
+ || ((*p_arg)->type == FFI_TYPE_LONGDOUBLE)
+ #endif