+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
#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); \
"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" \
#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
#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>