From 4719ffad87bb52fe170470a2ffc70ae028fa94ce Mon Sep 17 00:00:00 2001 From: Jeremy Drake Date: Sat, 23 Jan 2021 12:49:29 -0800 Subject: [PATCH] python-cffi: use gcc-style barrier on Windows. The existing logic excluded this on i386, x86_64, and WIN32, presumably because they assumed WIN32 was i386 or x86_64. This patch enables gcc-style __sync_synchronize(), if it compiles, on WIN32 if not i386 or x86_64. --- mingw-w64-python-cffi/PKGBUILD | 10 +++++++--- mingw-w64-python-cffi/mingw-non-x86.patch | 11 +++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 mingw-w64-python-cffi/mingw-non-x86.patch diff --git a/mingw-w64-python-cffi/PKGBUILD b/mingw-w64-python-cffi/PKGBUILD index 6b48f58dbe..f0762b69fb 100644 --- a/mingw-w64-python-cffi/PKGBUILD +++ b/mingw-w64-python-cffi/PKGBUILD @@ -7,7 +7,7 @@ provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") pkgver=1.14.5 -pkgrel=1 +pkgrel=2 pkgdesc="Foreign Function Interface for Python calling C code (mingw-w64)" url='https://cffi.readthedocs.io/' license=('MIT') @@ -17,12 +17,16 @@ depends=("${MINGW_PACKAGE_PREFIX}-libffi" "${MINGW_PACKAGE_PREFIX}-python-pycparser") makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools") checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest-runner") -source=("https://foss.heptapod.net/pypy/cffi/-/archive/v${pkgver}/${_realname}-v${pkgver}.tar.bz2") -sha256sums=('d99690c6fe2efa7b60d0abb3ea6f30fd544d15ee01909328ea2d1991939d4162') +source=("https://foss.heptapod.net/pypy/cffi/-/archive/v${pkgver}/${_realname}-v${pkgver}.tar.bz2" + "mingw-non-x86.patch") +sha256sums=('d99690c6fe2efa7b60d0abb3ea6f30fd544d15ee01909328ea2d1991939d4162' + 'c8a8ea2d65932ea0b62eae56dbc8afd6baacaadc7cb284ca0e4edf7ed1460c52') prepare() { cd "${srcdir}" cp -r "${_realname}-v${pkgver}" "python-build-${CARCH}" + cd "python-build-${CARCH}" + patch -Np1 -i "${srcdir}"/mingw-non-x86.patch } build() { diff --git a/mingw-w64-python-cffi/mingw-non-x86.patch b/mingw-w64-python-cffi/mingw-non-x86.patch new file mode 100644 index 0000000000..e77c4efd3d --- /dev/null +++ b/mingw-w64-python-cffi/mingw-non-x86.patch @@ -0,0 +1,11 @@ +--- cffi-v1.14.4/setup.py.orig 2021-01-22 18:37:13.453727900 -0800 ++++ cffi-v1.14.4/setup.py 2021-01-22 18:38:01.125798300 -0800 +@@ -90,7 +89,7 @@ + _safe_to_ignore() + + def ask_supports_sync_synchronize(): +- if sys.platform == 'win32' or no_compiler_found: ++ if no_compiler_found: + return + config = get_config() + ok = config.try_link('int main(void) { __sync_synchronize(); return 0; }')