summaryrefslogtreecommitdiff
path: root/unix/gccollect.c
diff options
context:
space:
mode:
authorJan Pochyla <jpochyla@gmail.com>2016-06-02 19:10:39 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-11-02 00:42:04 +0300
commitffb04a5845d2b24b99260d72ea8b99d9425ee1b4 (patch)
tree73eaf2997c1286b888281dcb7f8ab239ed5d6ae4 /unix/gccollect.c
parenta6c9060d818c38a72ba2758dfaeadd722f2294b8 (diff)
unix: fix symbol references for x86 Mac
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 397c4ffe1..4ec8c2bf5 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;