Fix iOS build.

This commit is contained in:
Mike Pall 2011-06-27 01:33:50 +02:00
parent 113f8e9ac2
commit db22ce2ba8
4 changed files with 22 additions and 8 deletions

View File

@ -191,7 +191,8 @@ void emit_asm(BuildCtx *ctx)
if (ctx->mode != BUILD_machasm)
fprintf(ctx->fp, ".Lbegin:\n");
#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(__symbian__)
#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(__symbian__) && \
!LJ_TARGET_OSX
/* This should really be moved into buildvm_arm.dasc. */
fprintf(ctx->fp,
".fnstart\n"
@ -227,7 +228,8 @@ void emit_asm(BuildCtx *ctx)
#endif
}
#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(__symbian__)
#if LJ_TARGET_ARM && defined(__GNUC__) && !defined(__symbian__) && \
!LJ_TARGET_OSX
fprintf(ctx->fp,
".globl lj_err_unwind_arm\n"
".personality lj_err_unwind_arm\n"

View File

@ -859,19 +859,23 @@ static uint32_t ir_khash(IRIns *ir)
return hashrot(lo, hi);
}
#if !LJ_TARGET_X86ORX64 && LJ_TARGET_OSX
void sys_icache_invalidate(void *start, size_t len);
#endif
/* Flush instruction cache. */
static void asm_cache_flush(MCode *start, MCode *end)
{
VG_INVALIDATE(start, (char *)end-(char *)start);
#if LJ_TARGET_X86ORX64
UNUSED(start); UNUSED(end);
#else
#if defined(__GNUC__)
#elif LJ_TARGET_OSX
sys_icache_invalidate(start, end-start);
#elif defined(__GNUC__)
__clear_cache(start, end);
#else
#error "Missing builtin to flush instruction cache"
#endif
#endif
}
/* -- Allocations --------------------------------------------------------- */

View File

@ -178,7 +178,8 @@ static void *err_unwind(lua_State *L, void *stopcf, int errcode)
/* -- External frame unwinding -------------------------------------------- */
#if defined(__GNUC__) && !defined(__symbian__)
#if defined(__GNUC__) && !defined(__symbian__) && \
!(LJ_TARGET_ARM && LJ_TARGET_OSX)
#ifdef __clang__
/* http://llvm.org/bugs/show_bug.cgi?id=8703 */

View File

@ -182,8 +182,6 @@ LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
#define softfp_f2d __aeabi_f2d
#define softfp_d2i __aeabi_d2iz
#define softfp_d2ui __aeabi_d2uiz
#define softfp_d2l __aeabi_d2lz
#define softfp_d2ul __aeabi_d2ulz
#define softfp_d2f __aeabi_d2f
#define softfp_i2f __aeabi_i2f
#define softfp_ui2f __aeabi_ui2f
@ -191,8 +189,17 @@ LJ_DATA const CCallInfo lj_ir_callinfo[IRCALL__MAX+1];
#define softfp_ul2f __aeabi_ul2f
#define softfp_f2i __aeabi_f2iz
#define softfp_f2ui __aeabi_f2uiz
#if LJ_TARGET_OSX
#define softfp_d2l __fixdfdi
#define softfp_d2ul __fixunsdfdi
#define softfp_f2l __fixsfdi
#define softfp_f2ul __fixunssfdi
#else
#define softfp_d2l __aeabi_d2lz
#define softfp_d2ul __aeabi_d2ulz
#define softfp_f2l __aeabi_f2lz
#define softfp_f2ul __aeabi_f2ulz
#endif
#else
#error "Missing soft-float definitions for target architecture"
#endif