From cf1b7c9c2bcebfd72618ee6efa4ff9df0ce05389 Mon Sep 17 00:00:00 2001 From: xtkoba <69125751+xtkoba@users.noreply.github.com> Date: Sun, 10 Oct 2021 00:58:32 +0900 Subject: [PATCH] bochs: avoid unaligned memory accesses for arm (#456) --- x11-packages/bochs/bochs.h.patch | 20 ++++++++++++++++++++ x11-packages/bochs/build.sh | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 x11-packages/bochs/bochs.h.patch diff --git a/x11-packages/bochs/bochs.h.patch b/x11-packages/bochs/bochs.h.patch new file mode 100644 index 000000000..2ff0fecf1 --- /dev/null +++ b/x11-packages/bochs/bochs.h.patch @@ -0,0 +1,20 @@ +--- a/bochs.h ++++ b/bochs.h +@@ -530,7 +530,7 @@ + *((Bit16u*)(hostPtr)) = (nativeVar16) + #define WriteHostDWordToLittleEndian(hostPtr, nativeVar32) \ + *((Bit32u*)(hostPtr)) = (nativeVar32) +-#ifdef ANDROID ++#if defined ANDROID || (defined __ANDROID__ && defined __arm__) + // Resolve problems with unaligned access + #define WriteHostQWordToLittleEndian(hostPtr, nativeVar64) { \ + ((Bit8u *)(hostPtr))[0] = (Bit8u) (nativeVar64); \ +@@ -550,7 +550,7 @@ + (nativeVar16) = *((Bit16u*)(hostPtr)) + #define ReadHostDWordFromLittleEndian(hostPtr, nativeVar32) \ + (nativeVar32) = *((Bit32u*)(hostPtr)) +-#ifdef ANDROID ++#if defined ANDROID || (defined __ANDROID__ && defined __arm__) + // Resolve problems with unaligned access + #define ReadHostQWordFromLittleEndian(hostPtr, nativeVar64) { \ + (nativeVar64) = ((Bit64u) ((Bit8u *)(hostPtr))[0]) | \ diff --git a/x11-packages/bochs/build.sh b/x11-packages/bochs/build.sh index 3344ddf28..6cf8fe588 100644 --- a/x11-packages/bochs/build.sh +++ b/x11-packages/bochs/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=http://bochs.sourceforge.net/ TERMUX_PKG_DESCRIPTION="Bochs is a highly portable open source IA-32 (x86) PC emulator and debugger written in C++." TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_VERSION=2.6.9 -TERMUX_PKG_REVISION=17 +TERMUX_PKG_REVISION=18 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/bochs/bochs-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=ee5b677fd9b1b9f484b5aeb4614f43df21993088c0c0571187f93acb0866e98c TERMUX_PKG_DEPENDS="atk, fontconfig, freetype, gdk-pixbuf, glib, gtk2, libc++, libcairo, libgraphite, libx11, libxpm, libxrandr, ncurses, pango, readline"