summaryrefslogtreecommitdiffstatshomepage
path: root/unix/gccollect.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/gccollect.c')
-rw-r--r--unix/gccollect.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/unix/gccollect.c b/unix/gccollect.c
index 397c4ffe1c..4ec8c2bf54 100644
--- a/unix/gccollect.c
+++ b/unix/gccollect.c
@@ -80,6 +80,18 @@ STATIC void gc_helper_get_regs(regs_t arr) {
register long esi asm ("esi");
register long edi asm ("edi");
register long ebp asm ("ebp");
+#ifdef __clang__
+ // TODO:
+ // This is dirty workaround for Clang. It tries to get around
+ // uncompliant (wrt to GCC) behavior of handling register variables.
+ // Application of this patch here is random, and done only to unbreak
+ // MacOS build. Better, cross-arch ways to deal with Clang issues should
+ // be found.
+ asm("" : "=r"(ebx));
+ asm("" : "=r"(esi));
+ asm("" : "=r"(edi));
+ asm("" : "=r"(ebp));
+#endif
arr[0] = ebx;
arr[1] = esi;
arr[2] = edi;