summaryrefslogtreecommitdiff
path: root/user/dosbox/gcc8-pmmx.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/dosbox/gcc8-pmmx.patch')
-rw-r--r--user/dosbox/gcc8-pmmx.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/user/dosbox/gcc8-pmmx.patch b/user/dosbox/gcc8-pmmx.patch
new file mode 100644
index 000000000..3b86802ed
--- /dev/null
+++ b/user/dosbox/gcc8-pmmx.patch
@@ -0,0 +1,32 @@
+From 771f1c8304253fcb95aef54da739f43712aea726 Mon Sep 17 00:00:00 2001
+From: Jonathan Campbell <jonathan@castus.tv>
+Date: Sun, 20 May 2018 19:30:58 -0700
+Subject: [PATCH] Suddenly MinGW GCC 7.3.0 does not allow the dynamic core to
+ declare EBP clobbered. Fix dynamic core entry appropriately
+
+---
+ src/cpu/core_dyn_x86/risc_x86.h | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/cpu/core_dyn_x86/risc_x86.h b/src/cpu/core_dyn_x86/risc_x86.h
+index dea5ae0ca..d2a847a4f 100644
+--- a/src/cpu/core_dyn_x86/risc_x86.h
++++ b/src/cpu/core_dyn_x86/risc_x86.h
+@@ -130,13 +130,15 @@ static BlockReturn gen_runcode(Bit8u * code) {
+ #else
+ register Bit32u tempflags=reg_flags & FMASK_TEST;
+ __asm__ volatile (
++ "pushl %%ebp \n"
+- "call 1f ; 1: addl $run_return_adress-.,(%%esp) \n"
++ "pushl $(run_return_adress) \n"
+ "pushl %2 \n"
+ "jmp *%3 \n"
+ "run_return_adress: \n"
++ "popl %%ebp \n"
+ :"=a" (retval), "=c" (tempflags)
+ :"r" (tempflags),"r" (code)
+- :"%edx","%ebx","%edi","%esi","%ebp","cc","memory"
++ :"%edx","%ebx","%edi","%esi"/*,"%ebp"*/,"cc","memory" /* NTS: GCC 7.3.0 MinGW suddenly will not allow this code to declare EBP clobbered */
+ );
+ reg_flags=(reg_flags & ~FMASK_TEST) | (tempflags & FMASK_TEST);
+ #endif