Browse Source

Fix PS3 build.

Mike Pall 12 years ago
parent
commit
e434ab505e
2 changed files with 9 additions and 3 deletions
  1. 8 2
      src/host/buildvm_asm.c
  2. 1 1
      src/lj_arch.h

+ 8 - 2
src/host/buildvm_asm.c

@@ -147,10 +147,12 @@ static void emit_asm_label(BuildCtx *ctx, const char *name, int size, int isfunc
   switch (ctx->mode) {
   switch (ctx->mode) {
   case BUILD_elfasm:
   case BUILD_elfasm:
 #if LJ_TARGET_PS3
 #if LJ_TARGET_PS3
-    if (!strncmp(name, "lj_vm_", 6)) {
+    if (!strncmp(name, "lj_vm_", 6) &&
+	strcmp(name, ctx->beginsym) &&
+	!strstr(name, "hook")) {
       fprintf(ctx->fp,
       fprintf(ctx->fp,
 	"\n\t.globl %s\n"
 	"\n\t.globl %s\n"
-	"\n\t.section \".opd\",\"aw\"\n"
+	"\t.section \".opd\",\"aw\"\n"
 	"%s:\n"
 	"%s:\n"
 	"\t.long .%s,.TOC.@tocbase32\n"
 	"\t.long .%s,.TOC.@tocbase32\n"
 	"\t.size %s,8\n"
 	"\t.size %s,8\n"
@@ -215,7 +217,11 @@ void emit_asm(BuildCtx *ctx)
   fprintf(ctx->fp, "\t.text\n");
   fprintf(ctx->fp, "\t.text\n");
   emit_asm_align(ctx, 4);
   emit_asm_align(ctx, 4);
 
 
+#if LJ_TARGET_PS3
+  emit_asm_label(ctx, ctx->beginsym, ctx->codesz, 0);
+#else
   emit_asm_label(ctx, ctx->beginsym, 0, 0);
   emit_asm_label(ctx, ctx->beginsym, 0, 0);
+#endif
   if (ctx->mode != BUILD_machasm)
   if (ctx->mode != BUILD_machasm)
     fprintf(ctx->fp, ".Lbegin:\n");
     fprintf(ctx->fp, ".Lbegin:\n");
 
 

+ 1 - 1
src/lj_arch.h

@@ -209,7 +209,7 @@
 #else
 #else
 #define LJ_ARCH_VERSION		0
 #define LJ_ARCH_VERSION		0
 #endif
 #endif
-#if __PPC64__ || __powerpc64__ || LJ_TARGET_XBOX360
+#if __PPC64__ || __powerpc64__ || LJ_TARGET_CONSOLE
 #define LJ_ARCH_PPC64		1
 #define LJ_ARCH_PPC64		1
 #define LJ_ARCH_NOFFI		1
 #define LJ_ARCH_NOFFI		1
 #endif
 #endif