]> git.unchartedbackwaters.co.uk Git - francis/libjit.git/commitdiff
Add support for multi os archs. Fix jit_builtin_apply for x86_64 by adding
authorKlaus Treichel <ktreichel@web.de>
Sun, 16 Dec 2007 11:46:53 +0000 (11:46 +0000)
committerKlaus Treichel <ktreichel@web.de>
Sun, 16 Dec 2007 11:46:53 +0000 (11:46 +0000)
r10 and r11 to the clobber list. Fix compiler warnings in
_JIT_ALIGN_CHECK_TYPE.

configure.in
jit/jit-apply-x86-64.h
jit/jit-internal.h

index becebded591f187fb42bf7694d9a091905169393..aa00e4ad2404b49d0798469abebb3683f6bf5d57 100644 (file)
@@ -428,6 +428,16 @@ AC_TRY_COMPILE([], [
 ], AC_DEFINE(HAVE_PIC_COMPUTED_GOTO, 1, [Define if you have PIC support for computed gotos]) piccompgoto=yes, piccompgoto=no)
 AC_MSG_RESULT($piccompgoto)
 
+dnl Check for building on a multi os system
+if test x$GCC = xyes ; then
+       multi_os_directory=`$CC -print-multi-os-directory`
+       case $multi_os_directory in
+         .) ;; # Avoid trailing /.
+         *) libdir=$libdir/$multi_os_directory ;;
+       esac
+fi
+AC_SUBST(libdir)
+
 dnl Checks for library functions.
 if test "x$suppress_libm" = "xno" ; then
        AC_CHECK_LIB(m, sin)
index 61bb000a6a7784c8722f00ad571db579a3f18fae..6ec4b770ffac483c50d43fa78e414643e861d3cb 100644 (file)
 #define        JIT_MEMCPY      "jit_memcpy@PLT"
 #endif
 
+/*
+ * We have to add all registers not saved by the caller to the clobber list
+ * and not only the registers used for parameter passing because we do
+ * function calls.
+ * Maybe we should add the xmm* registers too?
+ */
 #define        jit_builtin_apply(func,args,size,return_float,return_buf)       \
                do { \
                        void *__func = (void *)(func); \
@@ -86,6 +92,7 @@
                                "addq %%rdx, %%rsp\n\t" \
                                : : "m"(__func), "m"(__args), "m"(__size), "m"(__return_buf) \
                                : "rax", "rcx", "rdx", "rdi", "rsi", "r8", "r9", \
+                                 "r10", "r11", \
                                  "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", \
                                  "xmm5", "xmm6", "xmm7" \
                        ); \
index 91d1828857f6a9306cf5af31e569fc89b26993b0..bfc266312a68f56c15eae92fd7af73dd94731b02 100644 (file)
@@ -66,7 +66,7 @@ extern        "C" {
        }
 
 #define        _JIT_ALIGN_FOR_TYPE(name)       \
-       ((unsigned)(&(((struct _JIT_align_##name *)0)->field)))
+       ((jit_nuint)(&(((struct _JIT_align_##name *)0)->field)))
 
 #define        _JIT_ALIGN_MAX(a,b)     \
        ((a) > (b) ? (a) : (b))