Skip to content

Commit

Permalink
7zip: try to fix the clangarm64 build
Browse files Browse the repository at this point in the history
There is some __try/__except in there that's not guarded.
  • Loading branch information
lazka committed Nov 30, 2024
1 parent 6693256 commit 3d104df
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
25 changes: 25 additions & 0 deletions mingw-w64-7zip/002-guard-msvc-code.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- a/C/Sha512.c 2024-11-09 11:00:00.000000000 +0100
+++ b/C/Sha512.c 2024-12-01 00:36:20.615532600 +0100
@@ -514,7 +514,9 @@
#ifdef __clang_major__
#pragma GCC diagnostic ignored "-Wlanguage-extension-token"
#endif
+#ifdef _MSC_VER
__try
+#endif
{
#if 0 // 1 : for debug (reduced version to detect sha512)
const uint64x2_t a = vdupq_n_u64(1);
@@ -540,10 +542,12 @@
#endif
#endif
}
+#ifdef _MSC_VER
__except (EXCEPTION_EXECUTE_HANDLER)
{
// printf("\n==== CPU_IsSupported_SHA512 EXCEPTION_EXECUTE_HANDLER\n");
}
+#endif
}
return False;
#else
11 changes: 8 additions & 3 deletions mingw-w64-7zip/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _realname=7zip
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=24.09
pkgrel=1
pkgrel=2
pkgdesc="A file archiver with a high compression ratio (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
Expand All @@ -17,15 +17,20 @@ license=('spdx:LGPL-2.1-or-later AND BSD-3-Clause')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
source=("$url/a/7z${pkgver//./}-src.tar.xz"
001-disable-static.patch)
001-disable-static.patch
002-guard-msvc-code.patch)
sha256sums=('49c05169f49572c1128453579af1632a952409ced028259381dac30726b6133a'
'80678c664cefb38e6402c83fc0878911c142e471ce42665291bb313d8c8e5185')
'80678c664cefb38e6402c83fc0878911c142e471ce42665291bb313d8c8e5185'
'6e2898dd658d760cf82b591d90031cd06cf670714e611a9d5b662bb25f426ded')

prepare () {
if [[ ${CC} == clang ]] ; then
sed -i 's/-Werror/ -Wno-missing-exception-spec -Wno-unused-but-set-variable -Wno-unknown-attributes/' */*.mak */*/*.mak
fi
patch -p1 -i ${srcdir}/001-disable-static.patch

# https://sourceforge.net/p/sevenzip/bugs/2530/
patch -p1 -i ${srcdir}/002-guard-msvc-code.patch
}

build() {
Expand Down

0 comments on commit 3d104df

Please sign in to comment.