Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian@packages.debian.org
Usertags: pu
dosbox is broken in the default setting on a number of systems/DOS binaries
(see #857341). This got fixed in unstable back in September, but the patch
is also needed in stretch. Apart from debian/changelog, the debdiff the
only change applied to the package in unstable since the stretch release.
I've verified that with updated packages "Syndicate" now works fine.
Cheers,
Moritz
diff -Nru dosbox-0.74/debian/changelog dosbox-0.74/debian/changelog
--- dosbox-0.74/debian/changelog2015-10-13 16:55:00.0 +0200
+++ dosbox-0.74/debian/changelog2018-05-21 22:55:46.0 +0200
@@ -1,3 +1,10 @@
+dosbox (0.74-4.2+deb9u1) stretch; urgency=medium
+
+ * Non-maintainer upload:
+ * Fix crashes with core=dynamic (Closes: #857341)
+
+ -- Moritz Mühlenhoff Mon, 21 May 2018 22:55:46 +0200
+
dosbox (0.74-4.2) unstable; urgency=medium
* non-maintainer upload
diff -Nru dosbox-0.74/debian/patches/series dosbox-0.74/debian/patches/series
--- dosbox-0.74/debian/patches/series 2015-06-17 20:28:00.0 +0200
+++ dosbox-0.74/debian/patches/series 2018-05-21 22:55:31.0 +0200
@@ -3,3 +3,4 @@
fix-ftbfs-format-security.patch
wine-move-z-mount-svn3736.patch
wine-style-namemangling-svn3742.patch
+update-64bit-recompiler.patch
diff -Nru dosbox-0.74/debian/patches/update-64bit-recompiler.patch
dosbox-0.74/debian/patches/update-64bit-recompiler.patch
--- dosbox-0.74/debian/patches/update-64bit-recompiler.patch1970-01-01
01:00:00.0 +0100
+++ dosbox-0.74/debian/patches/update-64bit-recompiler.patch2018-05-21
22:55:22.0 +0200
@@ -0,0 +1,437 @@
+From: gulikoza
+Bug-Debian: https://bugs.debian.org/857341
+Description: Update 64bit dynamic recompiler to fix several bugs
+ This adds support for absolute 64bit addressing and fixes the
+ "Unhandled memory reference" crash. This comes from upstream SVN
+ r3951, and includes related patches r3674 and r3894. This patch also
+ contains an LLVM compile fix (r3990).
+Index: dosbox-0.74/src/cpu/core_dynrec/risc_x64.h
+===
+--- dosbox-0.74.orig/src/cpu/core_dynrec/risc_x64.h
dosbox-0.74/src/cpu/core_dynrec/risc_x64.h
+@@ -83,36 +83,106 @@ static void gen_mov_regs(HostReg reg_dst
+ cache_addb(0xc0+(reg_dst<<3)+reg_src);
+ }
+
++// move a 64bit constant value into a full register
++static void gen_mov_reg_qword(HostReg dest_reg,Bit64u imm) {
++ cache_addb(0x48);
++ cache_addb(0xb8+dest_reg); // mov dest_reg,imm
++ cache_addq(imm);
++}
+
+-static INLINE void gen_memaddr(HostReg reg,void* data) {
+- Bit64s diff = (Bit64s)data-((Bit64s)cache.pos+5);
+- if ((diff<0x8000LL) && (diff>-0x8000LL)) {
++
++// This function generates an instruction with register addressing and a
memory location
++static INLINE void gen_reg_memaddr(HostReg reg,void* data,Bit8u op,Bit8u
prefix=0) {
++ Bit64s diff = (Bit64s)data-((Bit64s)cache.pos+(prefix?7:6));
++//if ((diff<0x8000LL) && (diff>-0x8000LL)) { //clang messes
itself up on this...
++ if ( (diff>>63) == (diff>>31) ) { //signed bit extend, test to see if
value fits in a Bit32s
++ // mov reg,[rip+diff] (or similar, depending on the op) to
fetch *data
++ if(prefix) cache_addb(prefix);
++ cache_addb(op);
+ cache_addb(0x05+(reg<<3));
+ // RIP-relative addressing is offset after the instruction
+ cache_addd((Bit32u)(((Bit64u)diff)&0xLL));
+ } else if ((Bit64u)data<0x1LL) {
++ // mov reg,[data] (or similar, depending on the op) when
absolute address of data is <4GB
++ if(prefix) cache_addb(prefix);
++ cache_addb(op);
+ cache_addw(0x2504+(reg<<3));
+ cache_addd((Bit32u)(((Bit64u)data)&0xLL));
+ } else {
+- E_Exit("DRC64:Unhandled memory reference");
++ // load 64-bit data into tmp_reg and do mov reg,[tmp_reg] (or
similar, depending on the op)
++ HostReg tmp_reg = HOST_EAX;
++ if(reg == HOST_EAX) tmp_reg = HOST_ECX;
++
++ cache_addb(0x50+tmp_reg); // push rax/rcx
++ gen_mov_reg_qword(tmp_reg,(Bit64u)data);
++
++ if(prefix) cache_addb(prefix);
++ cache_addb(op);
++ cache_addb(tmp_reg+(reg<<3));
++
++ cache_addb(0x58+tmp_reg); // pop rax/rcx
+ }
+ }
+
++// Same as above, but with immediate addressing and a memory location
++static INLINE void gen_memaddr(Bitu modreg,void* data,Bitu off,Bitu imm,Bit8u
op,Bit8u prefix=0) {
++ Bit64s diff = (Bit64s)data-((Bit64s)cache.pos+off+(prefix?7:6));
++//if ((diff<0x8000LL) && (diff>-0x8000LL)) {
++ if ( (diff>>63) == (diff>>31) ) {
++