Skip to content

Commit

Permalink
angleproject: try to fix the build with clangarm64
Browse files Browse the repository at this point in the history
mingw-w64 doesn't have _ReadStatusReg, so use inline asm
  • Loading branch information
lazka committed Jul 13, 2023
1 parent 8ea1db2 commit 93c4ac3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions mingw-w64-angleproject/008-arm64-mingw-intrinsic.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- SwiftShader/src/System/Timer.cpp.orig 2023-07-13 18:12:10.770133700 +0200
+++ SwiftShader/src/System/Timer.cpp 2023-07-13 18:16:31.000139000 +0200
@@ -60,7 +60,13 @@
{
#if defined(_WIN32)
# if defined(_M_ARM64)
+# if defined(__MINGW32__)
+ int64_t value;
+ __asm__ volatile("mrs %x0, PMCCNTR_EL0" : "=r" (value));
+ return value;
+# else
return _ReadStatusReg(ARM64_PMCCNTR_EL0);
+# endif
# else
return __rdtsc();
# endif
5 changes: 4 additions & 1 deletion mingw-w64-angleproject/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ _realname=angleproject
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.1.r21358.2e285bb5
pkgrel=1
pkgrel=2
pkgdesc='A conformant OpenGL ES implementation for Windows, Mac, Linux, iOS and Android (mingw-w64)'
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
Expand Down Expand Up @@ -47,6 +47,7 @@ source=("${_realname}::git+https://chromium.googlesource.com/angle/angle.git#com
005-vulkan-memory-allocator-updates.patch
006-spirv-updates.patch
007-vulkan-loader-updates.patch
008-arm64-mingw-intrinsic.patch
jpeg.gn
jsoncpp.gn
png.gn
Expand All @@ -72,6 +73,7 @@ sha256sums=('SKIP'
'ced98a61919f7fdb10dbff26dfbd4ea11b034eaaeb3433f0fa5c4c998519e171'
'276799dbae43ab2577547dcc7912353619ade2ba878b28947ddef545f48afffa'
'7fc7f35aedc101fe325c161c42d2966f974ec789025750705ceb0caf259fc1f6'
'6d5c3d7888a671059d378e955c86d297dede5e6eee0d6aa0aeb12eb84c9e8ca1'
'bf878de3203a62e2a7f81bd4cd79237adc74804b4b692d9277da005ed56d4f2a'
'86013781c2700219d4f64d7ac34ad16c40fcca9a641371385f67f642e23c643b'
'f0fb05348bf2de599eff35e2d35e3336b9720b6bd2799af9d186c05ff45d34f0'
Expand Down Expand Up @@ -111,6 +113,7 @@ prepare() {
echo ":: Patching SwiftShader directory"
cd ${srcdir}/SwiftShader
patch -p1 -i ${srcdir}/004-swiftshader-updates.patch
patch -p1 -i ${srcdir}/008-arm64-mingw-intrinsic.patch
ln -sf ${srcdir}/SwiftShader ${srcdir}/${_realname}/third_party

echo ":: Patching vulkan_memory_allocator directory"
Expand Down

0 comments on commit 93c4ac3

Please sign in to comment.