-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa13350
commit 5b98ea6
Showing
5 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
python/py-greenlet/files/0001-switch_ppc_macosx.h-fix-wrong-assembler.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From fd27352ba171d49b709db30d5e5a0e460a31ab8c Mon Sep 17 00:00:00 2001 | ||
From: Sergey Fedorov <[email protected]> | ||
Date: Wed, 28 Aug 2024 23:18:42 +0800 | ||
Subject: [PATCH 1/3] switch_ppc_macosx.h: fix wrong assembler | ||
|
||
Fixes: https://github.com/python-greenlet/greenlet/issues/418 | ||
--- | ||
src/greenlet/platform/switch_ppc_macosx.h | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git src/greenlet/platform/switch_ppc_macosx.h src/greenlet/platform/switch_ppc_macosx.h | ||
index d6e5a03..bd414c6 100644 | ||
--- src/greenlet/platform/switch_ppc_macosx.h | ||
+++ src/greenlet/platform/switch_ppc_macosx.h | ||
@@ -49,7 +49,7 @@ slp_switch(void) | ||
int err; | ||
int *stackref, stsizediff; | ||
__asm__ volatile ("" : : : REGS_TO_SAVE); | ||
- __asm__ ("; asm block 2\n\tmr %0, r1" : "=g" (stackref) : ); | ||
+ __asm__ ("; asm block 2\n\tmr %0, r1" : "=r" (stackref) : ); | ||
{ | ||
SLP_SAVE_STATE(stackref, stsizediff); | ||
__asm__ volatile ( | ||
@@ -58,7 +58,7 @@ slp_switch(void) | ||
"\tadd r1, r1, r11\n" | ||
"\tadd r30, r30, r11\n" | ||
: /* no outputs */ | ||
- : "g" (stsizediff) | ||
+ : "r" (stsizediff) | ||
: "r11" | ||
); | ||
SLP_RESTORE_STATE(); |
31 changes: 31 additions & 0 deletions
31
python/py-greenlet/files/0002-switch_ppc_unix.h-fix-the-same-bug.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 4d38954377e91d30c213fb198b5cf2fcae403ba3 Mon Sep 17 00:00:00 2001 | ||
From: Sergey Fedorov <[email protected]> | ||
Date: Wed, 28 Aug 2024 23:26:30 +0800 | ||
Subject: [PATCH 2/3] switch_ppc_unix.h: fix the same bug | ||
|
||
--- | ||
src/greenlet/platform/switch_ppc_unix.h | 4 ++-- | ||
1 file changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git src/greenlet/platform/switch_ppc_unix.h src/greenlet/platform/switch_ppc_unix.h | ||
index ca590a5..bb18808 100644 | ||
--- src/greenlet/platform/switch_ppc_unix.h | ||
+++ src/greenlet/platform/switch_ppc_unix.h | ||
@@ -50,7 +50,7 @@ slp_switch(void) | ||
int err; | ||
int *stackref, stsizediff; | ||
__asm__ volatile ("" : : : REGS_TO_SAVE); | ||
- __asm__ ("mr %0, 1" : "=g" (stackref) : ); | ||
+ __asm__ ("mr %0, 1" : "=r" (stackref) : ); | ||
{ | ||
SLP_SAVE_STATE(stackref, stsizediff); | ||
__asm__ volatile ( | ||
@@ -58,7 +58,7 @@ slp_switch(void) | ||
"add 1, 1, 11\n" | ||
"add 30, 30, 11\n" | ||
: /* no outputs */ | ||
- : "g" (stsizediff) | ||
+ : "r" (stsizediff) | ||
: "11" | ||
); | ||
SLP_RESTORE_STATE(); |
22 changes: 22 additions & 0 deletions
22
python/py-greenlet/files/0003-slp_platformselect.h-fix-PowerPC-macro-for-Apple.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
From ff0d5973d89dd86b17a48f1fb847a57df28db914 Mon Sep 17 00:00:00 2001 | ||
From: Sergey Fedorov <[email protected]> | ||
Date: Wed, 28 Aug 2024 23:29:10 +0800 | ||
Subject: [PATCH 3/3] slp_platformselect.h: fix PowerPC macro for Apple | ||
|
||
--- | ||
src/greenlet/slp_platformselect.h | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git src/greenlet/slp_platformselect.h src/greenlet/slp_platformselect.h | ||
index c959f0f..22330ee 100644 | ||
--- src/greenlet/slp_platformselect.h | ||
+++ src/greenlet/slp_platformselect.h | ||
@@ -21,7 +21,7 @@ extern "C" { | ||
# include "platform/switch_ppc64_linux.h" /* gcc on PowerPC 64-bit */ | ||
#elif defined(__GNUC__) && defined(__PPC__) && (defined(__linux__) || defined(__FreeBSD__)) | ||
# include "platform/switch_ppc_linux.h" /* gcc on PowerPC */ | ||
-#elif defined(__GNUC__) && defined(__ppc__) && defined(__APPLE__) | ||
+#elif defined(__GNUC__) && defined(__POWERPC__) && defined(__APPLE__) | ||
# include "platform/switch_ppc_macosx.h" /* Apple MacOS X on PowerPC */ | ||
#elif defined(__GNUC__) && defined(__powerpc64__) && defined(_AIX) | ||
# include "platform/switch_ppc64_aix.h" /* gcc on AIX/PowerPC 64-bit */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- src/greenlet/slp_platformselect.h 2023-01-28 22:19:23.000000000 +0800 | ||
+++ src/greenlet/slp_platformselect.h 2024-08-28 23:43:43.000000000 +0800 | ||
@@ -20,7 +20,7 @@ | ||
#include "platform/switch_ppc64_linux.h" /* gcc on PowerPC 64-bit */ | ||
#elif defined(__GNUC__) && defined(__PPC__) && (defined(__linux__) || defined(__FreeBSD__)) | ||
#include "platform/switch_ppc_linux.h" /* gcc on PowerPC */ | ||
-#elif defined(__GNUC__) && defined(__ppc__) && defined(__APPLE__) | ||
+#elif defined(__GNUC__) && defined(__POWERPC__) && defined(__APPLE__) | ||
#include "platform/switch_ppc_macosx.h" /* Apple MacOS X on PowerPC */ | ||
#elif defined(__GNUC__) && defined(__powerpc64__) && defined(_AIX) | ||
#include "platform/switch_ppc64_aix.h" /* gcc on AIX/PowerPC 64-bit */ | ||
|
||
--- src/greenlet/platform/switch_ppc_macosx.h 2023-01-28 22:19:23.000000000 +0800 | ||
+++ src/greenlet/platform/switch_ppc_macosx.h 2024-08-28 23:42:43.000000000 +0800 | ||
@@ -49,7 +49,7 @@ | ||
register int err; | ||
register int *stackref, stsizediff; | ||
__asm__ volatile ("" : : : REGS_TO_SAVE); | ||
- __asm__ ("; asm block 2\n\tmr %0, r1" : "=g" (stackref) : ); | ||
+ __asm__ ("; asm block 2\n\tmr %0, r1" : "=r" (stackref) : ); | ||
{ | ||
SLP_SAVE_STATE(stackref, stsizediff); | ||
__asm__ volatile ( | ||
@@ -58,7 +58,7 @@ | ||
"\tadd r1, r1, r11\n" | ||
"\tadd r30, r30, r11\n" | ||
: /* no outputs */ | ||
- : "g" (stsizediff) | ||
+ : "r" (stsizediff) | ||
: "r11" | ||
); | ||
SLP_RESTORE_STATE(); | ||
|
||
--- src/greenlet/platform/switch_ppc_unix.h 2023-01-28 22:19:23.000000000 +0800 | ||
+++ src/greenlet/platform/switch_ppc_unix.h 2024-08-28 23:42:43.000000000 +0800 | ||
@@ -50,7 +50,7 @@ | ||
register int err; | ||
register int *stackref, stsizediff; | ||
__asm__ volatile ("" : : : REGS_TO_SAVE); | ||
- __asm__ ("mr %0, 1" : "=g" (stackref) : ); | ||
+ __asm__ ("mr %0, 1" : "=r" (stackref) : ); | ||
{ | ||
SLP_SAVE_STATE(stackref, stsizediff); | ||
__asm__ volatile ( | ||
@@ -58,7 +58,7 @@ | ||
"add 1, 1, 11\n" | ||
"add 30, 30, 11\n" | ||
: /* no outputs */ | ||
- : "g" (stsizediff) | ||
+ : "r" (stsizediff) | ||
: "11" | ||
); | ||
SLP_RESTORE_STATE(); |