From 2426d4bf8d5a4149ec70b638c8d5d4b3755d80dd Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sat, 25 Nov 2023 21:49:20 +0100 Subject: [PATCH] mruby: use setjmp instead of __builtin_setjmp might fix the arm64 build --- mingw-w64-mruby/0001-use-setjmp-for-clang.patch | 11 +++++++++++ mingw-w64-mruby/PKGBUILD | 12 ++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 mingw-w64-mruby/0001-use-setjmp-for-clang.patch diff --git a/mingw-w64-mruby/0001-use-setjmp-for-clang.patch b/mingw-w64-mruby/0001-use-setjmp-for-clang.patch new file mode 100644 index 0000000000..6a6b3d71fd --- /dev/null +++ b/mingw-w64-mruby/0001-use-setjmp-for-clang.patch @@ -0,0 +1,11 @@ +--- mruby-3.2.0/include/mruby/throw.h.orig 2023-02-24 11:51:12.000000000 +0100 ++++ mruby-3.2.0/include/mruby/throw.h 2023-11-25 21:46:27.352438200 +0100 +@@ -33,7 +33,7 @@ + #if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + #define MRB_SETJMP _setjmp + #define MRB_LONGJMP _longjmp +-#elif defined(__MINGW64__) && defined(__GNUC__) && __GNUC__ >= 4 ++#elif defined(__MINGW64__) && defined(__GNUC__) && __GNUC__ >= 4 && !defined(__clang__) + #define MRB_SETJMP __builtin_setjmp + #define MRB_LONGJMP __builtin_longjmp + #else diff --git a/mingw-w64-mruby/PKGBUILD b/mingw-w64-mruby/PKGBUILD index 54bf5836a9..f79aea3848 100644 --- a/mingw-w64-mruby/PKGBUILD +++ b/mingw-w64-mruby/PKGBUILD @@ -4,21 +4,25 @@ _realname=mruby pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=3.2.0 -pkgrel=1 +pkgrel=2 pkgdesc="mruby is the lightweight implementation of the Ruby language (mingw-w64)" arch=('any') -mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') url="https://github.com/mruby" license=('spdx:MIT') makedepends=("${MINGW_PACKAGE_PREFIX}-ruby" "${MINGW_PACKAGE_PREFIX}-cc" "bison") -source=(${_realname}-${pkgver}.zip::"https://github.com/${_realname}/${_realname}/archive/${pkgver}.zip") -sha256sums=('64a0dd8b65825f2e7cdac6699e818648dc73bfdfc68aa1bfd58417a35315e5cc') +source=(${_realname}-${pkgver}.zip::"https://github.com/${_realname}/${_realname}/archive/${pkgver}.zip" + "0001-use-setjmp-for-clang.patch") +sha256sums=('64a0dd8b65825f2e7cdac6699e818648dc73bfdfc68aa1bfd58417a35315e5cc' + 'a24c5551c32132ad37839cba5cf03f6c9a26cc9ea8e30dc18747a236fb287c8f') prepare() { cd "${srcdir}/${_realname}-${pkgver}" + # https://github.com/msys2/MINGW-packages/commit/538dc50fcb3d8730a12091c50671b0a668c526c2#commitcomment-133486249 + patch -Np1 -i "${srcdir}/0001-use-setjmp-for-clang.patch" } build() {