diff options
| author | Mike Pall <mike> | 2012-06-10 01:38:44 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2012-06-10 02:01:25 +0200 |
| commit | b8f5727ab4ab5656b19cdb2c71a92611836b5458 (patch) | |
| tree | afff6234da61ae8d3a513359a68c88cdb7b6159c /src/host | |
| parent | 37be8a54785b893f531679adb0b479a426938504 (diff) | |
| download | luajit-b8f5727ab4ab5656b19cdb2c71a92611836b5458.tar.gz luajit-b8f5727ab4ab5656b19cdb2c71a92611836b5458.tar.bz2 luajit-b8f5727ab4ab5656b19cdb2c71a92611836b5458.zip | |
CONSOLE: Fix PS3 build.
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/buildvm_asm.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/host/buildvm_asm.c b/src/host/buildvm_asm.c index f975eadc..5fc31287 100644 --- a/src/host/buildvm_asm.c +++ b/src/host/buildvm_asm.c | |||
| @@ -141,6 +141,24 @@ static void emit_asm_label(BuildCtx *ctx, const char *name, int size, int isfunc | |||
| 141 | { | 141 | { |
| 142 | switch (ctx->mode) { | 142 | switch (ctx->mode) { |
| 143 | case BUILD_elfasm: | 143 | case BUILD_elfasm: |
| 144 | #if LJ_TARGET_PS3 | ||
| 145 | if (!strncmp(name, "lj_vm_", 6)) { | ||
| 146 | fprintf(ctx->fp, | ||
| 147 | "\n\t.globl %s\n" | ||
| 148 | "\n\t.section \".opd\",\"aw\"\n" | ||
| 149 | "%s:\n" | ||
| 150 | "\t.long .%s,.TOC.@tocbase32\n" | ||
| 151 | "\t.size %s,8\n" | ||
| 152 | "\t.previous\n" | ||
| 153 | "\t.globl .%s\n" | ||
| 154 | "\t.hidden .%s\n" | ||
| 155 | "\t.type .%s, " ELFASM_PX "function\n" | ||
| 156 | "\t.size .%s, %d\n" | ||
| 157 | ".%s:\n", | ||
| 158 | name, name, name, name, name, name, name, name, size, name); | ||
| 159 | break; | ||
| 160 | } | ||
| 161 | #endif | ||
| 144 | fprintf(ctx->fp, | 162 | fprintf(ctx->fp, |
| 145 | "\n\t.globl %s\n" | 163 | "\n\t.globl %s\n" |
| 146 | "\t.hidden %s\n" | 164 | "\t.hidden %s\n" |
| @@ -196,7 +214,7 @@ void emit_asm(BuildCtx *ctx) | |||
| 196 | if (ctx->mode != BUILD_machasm) | 214 | if (ctx->mode != BUILD_machasm) |
| 197 | fprintf(ctx->fp, ".Lbegin:\n"); | 215 | fprintf(ctx->fp, ".Lbegin:\n"); |
| 198 | 216 | ||
| 199 | #if LJ_TARGET_ARM && defined(__GNUC__) && !defined(LUAJIT_NO_UNWIND) | 217 | #if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND |
| 200 | /* This should really be moved into buildvm_arm.dasc. */ | 218 | /* This should really be moved into buildvm_arm.dasc. */ |
| 201 | fprintf(ctx->fp, | 219 | fprintf(ctx->fp, |
| 202 | ".fnstart\n" | 220 | ".fnstart\n" |
| @@ -210,8 +228,7 @@ void emit_asm(BuildCtx *ctx) | |||
| 210 | for (i = rel = 0; i < ctx->nsym; i++) { | 228 | for (i = rel = 0; i < ctx->nsym; i++) { |
| 211 | int32_t ofs = ctx->sym[i].ofs; | 229 | int32_t ofs = ctx->sym[i].ofs; |
| 212 | int32_t next = ctx->sym[i+1].ofs; | 230 | int32_t next = ctx->sym[i+1].ofs; |
| 213 | #if LJ_TARGET_ARM && defined(__GNUC__) && !defined(LUAJIT_NO_UNWIND) && \ | 231 | #if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND && LJ_HASFFI |
| 214 | LJ_HASFFI | ||
| 215 | if (!strcmp(ctx->sym[i].name, "lj_vm_ffi_call")) | 232 | if (!strcmp(ctx->sym[i].name, "lj_vm_ffi_call")) |
| 216 | fprintf(ctx->fp, | 233 | fprintf(ctx->fp, |
| 217 | ".globl lj_err_unwind_arm\n" | 234 | ".globl lj_err_unwind_arm\n" |
| @@ -246,7 +263,7 @@ void emit_asm(BuildCtx *ctx) | |||
| 246 | #endif | 263 | #endif |
| 247 | } | 264 | } |
| 248 | 265 | ||
| 249 | #if LJ_TARGET_ARM && defined(__GNUC__) && !defined(LUAJIT_NO_UNWIND) | 266 | #if LJ_TARGET_ARM && defined(__GNUC__) && !LJ_NO_UNWIND |
| 250 | fprintf(ctx->fp, | 267 | fprintf(ctx->fp, |
| 251 | #if !LJ_HASFFI | 268 | #if !LJ_HASFFI |
| 252 | ".globl lj_err_unwind_arm\n" | 269 | ".globl lj_err_unwind_arm\n" |
| @@ -262,7 +279,7 @@ void emit_asm(BuildCtx *ctx) | |||
| 262 | #if LJ_TARGET_PPCSPE | 279 | #if LJ_TARGET_PPCSPE |
| 263 | /* Soft-float ABI + SPE. */ | 280 | /* Soft-float ABI + SPE. */ |
| 264 | fprintf(ctx->fp, "\t.gnu_attribute 4, 2\n\t.gnu_attribute 8, 3\n"); | 281 | fprintf(ctx->fp, "\t.gnu_attribute 4, 2\n\t.gnu_attribute 8, 3\n"); |
| 265 | #elif LJ_TARGET_PPC | 282 | #elif LJ_TARGET_PPC && !LJ_TARGET_PS3 |
| 266 | /* Hard-float ABI. */ | 283 | /* Hard-float ABI. */ |
| 267 | fprintf(ctx->fp, "\t.gnu_attribute 4, 1\n"); | 284 | fprintf(ctx->fp, "\t.gnu_attribute 4, 1\n"); |
| 268 | #endif | 285 | #endif |
