From 365f8630803b98cc842383304958be309b4af913 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 28 Jun 2012 16:21:24 -0600 Subject: [PATCH] disable constant offset check when cross-compiling for a different word size --- src/common.h | 4 ++++ src/compile.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/common.h b/src/common.h index 3bb319f767..12167e9a27 100644 --- a/src/common.h +++ b/src/common.h @@ -58,11 +58,13 @@ typedef int32_t intptr_t; typedef uint32_t uintptr_t; # define UINT64_C(x) x##LL # define ARCH_x86_32 +@ define BYTES_PER_WORD 4 # elif defined _M_X64 typedef int64_t intptr_t; typedef uint64_t uintptr_t; # define UINT64_C(x) x##L # define ARCH_x86_64 +@ define BYTES_PER_WORD 8 # else # error "unsupported architecture" # endif @@ -77,6 +79,8 @@ typedef intptr_t intptr_alias_t; # include "stdint.h" +# define BYTES_PER_WORD __SIZEOF_POINTER__ + # define LIKELY(v) __builtin_expect((v) != 0, true) # define UNLIKELY(v) __builtin_expect((v) != 0, false) diff --git a/src/compile.cpp b/src/compile.cpp index d1518871d3..4949bed3ce 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -8614,6 +8614,8 @@ class MyProcessor: public Processor { t->codeImage = codeImage; t->thunkTable = thunkTable; +#if TARGET_BYTES_PER_WORD == BYTES_PER_WORD + int mismatches = checkConstant(t, TARGET_THREAD_EXCEPTION, &Thread::exception, "TARGET_THREAD_EXCEPTION") + checkConstant(t, TARGET_THREAD_EXCEPTIONSTACKADJUSTMENT, &MyThread::exceptionStackAdjustment, "TARGET_THREAD_EXCEPTIONSTACKADJUSTMENT") + @@ -8635,6 +8637,8 @@ class MyProcessor: public Processor { abort(t); } +#endif + t->init(); return t;