]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Mac OS X compatibility fixes
authorAleksey Demakov <ademakov@gmail.com>
Sun, 23 Nov 2008 09:15:24 +0000 (09:15 +0000)
committerAleksey Demakov <ademakov@gmail.com>
Sun, 23 Nov 2008 09:15:24 +0000 (09:15 +0000)
ChangeLog
jit/jit-apply-x86.h
tools/gen-apply-macosx.h
tools/gen-apply.c

index 2985e9e2967babbc573bba21daa4aa6164c3d8a8..c6a892d146f2edda8e38b03ffc9e645c43575ab4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-23  Arto Bendiken <arto.bendiken@gmail.com>
+
+       * jit/jit-apply-x86.h, tools/gen-apply.c, tools/gen-apply-macosx.h:
+       Mac OS X compatibility fixes.
+
 2008-11-04  Klaus Treichel  <ktreichel@web.de>
 
        * jit/jit-apply-x86-64.h (jit_builtin_apply): Use r11 for calling
index 7ee461a157752d042947256126c2864585caf108..6e224a5503d444b3f284886698239e0337d1098a 100644 (file)
 #if !defined(__CYGWIN__) && !defined(__CYGWIN32__) && \
        !defined(_WIN32) && !defined(WIN32)
 
+/* Mac OS X prefixes static symbols with an underscore, and external symbol
+   references are late-bound through a PIC stub by the dynamic linker */
+#ifndef JIT_MEMCPY
+# if defined(__APPLE__) && defined(__MACH__)
+#  define JIT_MEMCPY "L_memcpy$stub"
+# else
+#  define JIT_MEMCPY "memcpy"
+# endif
+#endif
+
 #define        jit_builtin_apply(func,args,size,return_float,return_buf)       \
                do { \
                        void *__func = (void *)(func); \
@@ -54,7 +64,7 @@
                                "pushl %2\n\t" \
                                "pushl %%ecx\n\t" \
                                "pushl %%eax\n\t" \
-                               "call memcpy\n\t" \
+                               "call " JIT_MEMCPY "\n\t" \
                                "addl $12, %%esp\n\t" \
                                "movl %1, %%ecx\n\t" \
                                "movl %0, %%eax\n\t" \
index 99e6e0e4a95b9d24b3db130ec39f0a385f8c2bf0..3acbfab1f638d88a445e62af4939f19e1c7cbd9d 100644 (file)
@@ -62,6 +62,13 @@ extern "C" {
 #define JIT_APPLY_X86_POP_STRUCT_RETURN 0
 #define JIT_APPLY_PAD_FLOAT_REGS 1
 
+#define JIT_APPLY_NUM_DOUBLE_REGS 0
+#define JIT_APPLY_NUM_NFLOAT_REGS 0
+#define JIT_APPLY_DOUBLES_IN_WORD_REGS 0
+#define JIT_APPLY_NFLOATS_IN_WORD_REGS 0
+#define JIT_APPLY_RETURN_DOUBLES_AFTER 0
+#define JIT_APPLY_RETURN_NFLOATS_AFTER 0
+
 #ifdef __cplusplus
 };
 #endif
index b469e98576e15afa9ce9f7377f115fa479393811..3117a26e910ddee9511dc75aa9ddb6f40d248643 100644 (file)
 
 #include <jit/jit-arch.h>
 #include <jit/jit-defs.h>
-#define        JIT_MEMCPY              "mem_copy"
+
+#if defined(__APPLE__) && defined(__MACH__)
+# define       JIT_MEMCPY      "_mem_copy"
+#else
+# define       JIT_MEMCPY      "mem_copy"
+#endif
+
 #include "jit-apply-func.h"
 #include <stdio.h>
 #include <config.h>