Merge pull request #11033 from driver1998/wxwidgets-clangarm64

wxWidgets: enable clangarm64 build
This commit is contained in:
jeremyd2019
2022-03-19 21:01:40 -07:00
committed by GitHub
4 changed files with 201 additions and 5 deletions

View File

@@ -0,0 +1,53 @@
From 004c1ec167b7a3061214a22ff29848530213f7c7 Mon Sep 17 00:00:00 2001
From: GH Cao <driver1998.ms@outlook.com>
Date: Fri, 18 Mar 2022 00:12:08 +0800
Subject: [PATCH 1/2] Introduce MSW ARM64 support
This is a preliminary ARM64 platform support for wxWidgets at "it
compiles" stage. This will allow building and testing wxWidgets based
apps for oncoming Windows 10 ARM64.
Backports from f69dbaa1aebd72652dfb6246bdeaffce4d83933d,
with MSVC-specific changes stripped.
---
include/wx/msw/debughlp.h | 2 +-
src/msw/stackwalk.cpp | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/include/wx/msw/debughlp.h b/include/wx/msw/debughlp.h
index d0d289e..1ecfc92 100644
--- a/include/wx/msw/debughlp.h
+++ b/include/wx/msw/debughlp.h
@@ -185,7 +185,7 @@ public:
// suffix in some cases. These 2 helper macros call the macro with the
// correct arguments in both cases.
#define wxSYM_CALL(what, name) what(name, name)
-#if defined(_M_AMD64)
+#if defined(_M_AMD64) || defined(_M_ARM64)
#define wxSYM_CALL_64(what, name) what(name, name ## 64)
// Also undo all the "helpful" definitions done by imagehlp.h that map 32
diff --git a/src/msw/stackwalk.cpp b/src/msw/stackwalk.cpp
index f9c8ca9..e510552 100644
--- a/src/msw/stackwalk.cpp
+++ b/src/msw/stackwalk.cpp
@@ -261,6 +261,16 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip, size_t maxDepth)
sf.AddrFrame.Mode = AddrModeFlat;
dwMachineType = IMAGE_FILE_MACHINE_AMD64;
+#elif defined(_M_ARM64)
+ // TODO: Verify this code once Windows 10 for ARM64 is commercially available
+ sf.AddrPC.Offset = ctx.Pc;
+ sf.AddrPC.Mode = AddrModeFlat;
+ sf.AddrStack.Offset = ctx.Sp;
+ sf.AddrStack.Mode = AddrModeFlat;
+ sf.AddrFrame.Offset = ctx.Fp;
+ sf.AddrFrame.Mode = AddrModeFlat;
+
+ dwMachineType = IMAGE_FILE_MACHINE_ARM64;
#elif defined(_M_IX86)
sf.AddrPC.Offset = ctx.Eip;
sf.AddrPC.Mode = AddrModeFlat;
--
2.35.1

View File

@@ -0,0 +1,129 @@
From ac3ac83b335d40fc84c3d1edd144134efaa25d4a Mon Sep 17 00:00:00 2001
From: GH Cao <driver1998.ms@outlook.com>
Date: Fri, 18 Mar 2022 00:00:17 +0800
Subject: [PATCH 2/2] Add MSW manifests for ARM and ARM64 platforms
Backported from c0c22609447c1f982500e997ba663112ac66f5f9
---
include/wx/msw/arm.manifest | 22 ++++++++++++++++++++++
include/wx/msw/arm64.manifest | 22 ++++++++++++++++++++++
include/wx/msw/genrcdefs.h | 6 +++++-
include/wx/msw/rcdefs.h | 8 ++++++++
include/wx/msw/wx.rc | 4 ++++
5 files changed, 61 insertions(+), 1 deletion(-)
create mode 100644 include/wx/msw/arm.manifest
create mode 100644 include/wx/msw/arm64.manifest
diff --git a/include/wx/msw/arm.manifest b/include/wx/msw/arm.manifest
new file mode 100644
index 0000000..1879db7
--- /dev/null
+++ b/include/wx/msw/arm.manifest
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+ version="0.64.1.0"
+ processorArchitecture="arm"
+ name="Controls"
+ type="win32"
+/>
+<description>wxWindows application</description>
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="arm"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+</dependency>
+</assembly>
diff --git a/include/wx/msw/arm64.manifest b/include/wx/msw/arm64.manifest
new file mode 100644
index 0000000..abcad20
--- /dev/null
+++ b/include/wx/msw/arm64.manifest
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+ version="0.64.1.0"
+ processorArchitecture="arm64"
+ name="Controls"
+ type="win32"
+/>
+<description>wxWindows application</description>
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="arm64"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+</dependency>
+</assembly>
diff --git a/include/wx/msw/genrcdefs.h b/include/wx/msw/genrcdefs.h
index 809419b..50ce8d7 100644
--- a/include/wx/msw/genrcdefs.h
+++ b/include/wx/msw/genrcdefs.h
@@ -23,10 +23,14 @@ EMIT(#define wxUSE_RC_MANIFEST 1)
EMIT(#define WX_CPU_AMD64)
#endif
-#ifdef _M_ARM
+#if defined _M_ARM || defined __arm__
EMIT(#define WX_CPU_ARM)
#endif
+#if defined _M_ARM64 || defined __aarch64__
+EMIT(#define WX_CPU_ARM64)
+#endif
+
#if defined _M_IA64 || defined __ia64__
EMIT(#define WX_CPU_IA64)
#endif
diff --git a/include/wx/msw/rcdefs.h b/include/wx/msw/rcdefs.h
index 8b9ac71..ead5ec2 100644
--- a/include/wx/msw/rcdefs.h
+++ b/include/wx/msw/rcdefs.h
@@ -31,6 +31,14 @@
#ifndef WX_CPU_IA64
#define WX_CPU_IA64
#endif
+ #elif defined __arm__
+ #ifndef WX_CPU_ARM
+ #define WX_CPU_ARM
+ #endif
+ #elif defined __aarch64__
+ #ifndef WX_CPU_ARM64
+ #define WX_CPU_ARM64
+ #endif
#endif
#endif
diff --git a/include/wx/msw/wx.rc b/include/wx/msw/wx.rc
index 702861a..7ec9dd7 100644
--- a/include/wx/msw/wx.rc
+++ b/include/wx/msw/wx.rc
@@ -109,6 +109,10 @@ wxBITMAP_STD_COLOURS BITMAP "wx/msw/colours.bmp"
wxMANIFEST_ID 24 "wx/msw/amd64.manifest"
#elif defined(WX_CPU_IA64)
wxMANIFEST_ID 24 "wx/msw/ia64.manifest"
+#elif defined(WX_CPU_ARM)
+wxMANIFEST_ID 24 "wx/msw/arm.manifest"
+#elif defined(WX_CPU_ARM64)
+wxMANIFEST_ID 24 "wx/msw/arm64.manifest"
#elif defined(WX_CPU_X86)
wxMANIFEST_ID 24 "wx/msw/wx.manifest"
#else
--
2.35.1

View File

@@ -10,10 +10,10 @@ pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
provides=("${MINGW_PACKAGE_PREFIX}-wxmsw${_wx_basever}" "${MINGW_PACKAGE_PREFIX}-wxconfig")
pkgbase=mingw-w64-${_realname}
pkgver=${_wx_basever}.5.1
pkgrel=8
pkgrel=9
pkgdesc="A C++ library that lets developers create applications for Windows, Linux and UNIX (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
license=("custom:wxWindows")
url="https://www.wxwidgets.org/"
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
@@ -34,14 +34,18 @@ source=(https://github.com/wxWidgets/wxWidgets/releases/download/v${pkgver}/wxWi
"003-wxWidgets-3.0.2-fix-access-sample.patch"
"004-wxWidgets-3.0-clang-windows-link.patch"
"005-wxWidgets-3.0-gdiplus-math-min-max.patch"
"006-wxWidgets-3.0-Fix-c-11-narrowing-error.patch")
"006-wxWidgets-3.0-Fix-c-11-narrowing-error.patch"
"007-wxWidgets-3.0-Introduce-msw-arm64-support.patch"
"008-wxWidgets-3.0-Add-msw-manifests-for-arm-and-arm64-platforms.patch")
sha256sums=('440f6e73cf5afb2cbf9af10cec8da6cdd3d3998d527598a53db87099524ac807'
'03e157c427ff93c8c35b6036795e42fd980d4cb28d3ef1fef9ba6d6a9b7fff04'
'3138f7b84bf988892f62167afc6fa640ac154b629b243d86413f7c811e508713'
'b8684dca94b288a023a8a3d55ad56bce87570576ead71670a237d909ff1c3625'
'b8b49b1df4a7c53d72c7c117606ac9dc44589da474ca58f0806b107469f33dcb'
'4915d09f217270956cad3de7cf0e3fdaec4847cfda46d4b568bde26a8bd5f94a'
'043c24cab804b972a3fa710182b19f15aff8479a34e031694c17108a64e27d3f')
'043c24cab804b972a3fa710182b19f15aff8479a34e031694c17108a64e27d3f'
'a9f43fca5ab5c8bdcc60933a2bf00fc7ac0f9dfe715fe9eb9f426f413d0a162d'
'a209553f73193371087e421dcdd3eacf8e7de17ce4908fa0aeaebf1ba8666cb7')
prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
@@ -57,6 +61,16 @@ prepare() {
# https://github.com/wxWidgets/wxWidgets/commit/a195bf86a21e9334c68eb5e4a5b0973104553460
patch -p1 -i "${srcdir}"/005-wxWidgets-3.0-gdiplus-math-min-max.patch
patch -p1 -i "${srcdir}"/006-wxWidgets-3.0-Fix-c-11-narrowing-error.patch
# https://github.com/wxWidgets/wxWidgets/commit/f69dbaa1aebd72652dfb6246bdeaffce4d83933d
# with MSVC-specific build config and changes striped
patch -p1 -i "${srcdir}"/007-wxWidgets-3.0-Introduce-msw-arm64-support.patch
# https://github.com/wxWidgets/wxWidgets/commit/c0c22609447c1f982500e997ba663112ac66f5f9
patch -p1 -i "${srcdir}"/008-wxWidgets-3.0-Add-msw-manifests-for-arm-and-arm64-platforms.patch
# autoreconf to get updated libtool files, for aarch64 support
pushd src/tiff
autoreconf -fiv
popd
}
#check() {

View File

@@ -22,7 +22,7 @@ pkgver=${_wx_basever}.5
pkgrel=6
pkgdesc="A C++ library that lets developers create applications for Windows, Linux and UNIX (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url="https://wxwidgets.org/"
license=('custom:wxWindows')
makedepends=(