summaryrefslogtreecommitdiff
path: root/gc.h
diff options
context:
space:
mode:
authorSergey Fedorov <vital.had@gmail.com>2022-10-19 18:49:45 +0800
committerGitHub <noreply@github.com>2022-10-19 23:49:45 +1300
commit567725ed303b6738493c80efaf93dc4c1e65a9c9 (patch)
tree75f141047050eee63c05d613491595a7a9380afa /gc.h
parentfc3137ef54562c3c3290245c0f62e0bb193c3145 (diff)
Fix and improve coroutines for Darwin (macOS) ppc/ppc64. (#5975)
Notes
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'gc.h')
-rw-r--r--gc.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/gc.h b/gc.h
index 3d863fce8a..e1ce802095 100644
--- a/gc.h
+++ b/gc.h
@@ -6,10 +6,12 @@
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movq\t%%rsp, %0" : "=r" (*(p)))
#elif defined(__i386) && defined(__GNUC__)
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("movl\t%%esp, %0" : "=r" (*(p)))
-#elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && !defined(_AIX)
+#elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && !defined(_AIX) && !defined(__APPLE__) // Not Apple is NEEDED to unbreak ppc64 build on Darwin. Don't ask.
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr\t%0, %%r1" : "=r" (*(p)))
#elif (defined(__powerpc__) || defined(__powerpc64__)) && defined(__GNUC__) && defined(_AIX)
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mr %0,1" : "=r" (*(p)))
+#elif defined(__POWERPC__) && defined(__APPLE__) // Darwin ppc and ppc64
+#define SET_MACHINE_STACK_END(p) __asm__ volatile("mr %0, r1" : "=r" (*(p)))
#elif defined(__aarch64__) && defined(__GNUC__)
#define SET_MACHINE_STACK_END(p) __asm__ __volatile__ ("mov\t%0, sp" : "=r" (*(p)))
#else