Sfoglia il codice sorgente

ARM64: Compatibility fixes for Clang.

Mike Pall 10 anni fa
parent
commit
e1261a07bf
2 ha cambiato i file con 14 aggiunte e 2 eliminazioni
  1. 10 0
      src/lj_arch.h
  2. 4 2
      src/vm_arm64.dasc

+ 10 - 0
src/lj_arch.h

@@ -300,6 +300,16 @@
 #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 2)
 #error "Need at least GCC 4.2 or newer"
 #endif
+#elif LJ_TARGET_ARM64
+#if __clang__
+#if (__clang_major__ < 3) || ((__clang_major__ == 3) && __clang_minor__ < 5)
+#error "Need at least Clang 3.5 or newer"
+#endif
+#else
+#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 8)
+#error "Need at least GCC 4.8 or newer"
+#endif
+#endif
 #elif !LJ_TARGET_PS3
 #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)
 #error "Need at least GCC 4.3 or newer"

+ 4 - 2
src/vm_arm64.dasc

@@ -3594,7 +3594,8 @@ static void emit_asm_debug(BuildCtx *ctx)
     for (i = 19; i <= 28; i++)  /* offset x19-x28 */
       fprintf(ctx->fp, "\t.byte 0x%x\n\t.uleb128 %d\n", 0x80+i, cf-i+17);
     for (i = 8; i <= 15; i++)  /* offset d8-d15 */
-      fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 0x%x, %d\n", 64+i, cf-i-4);
+      fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 0x%x\n\t.uleb128 %d\n",
+	      64+i, cf-i-4);
     fprintf(ctx->fp,
 	"\t.align 3\n"
 	".LEFDE0:\n\n");
@@ -3634,7 +3635,8 @@ static void emit_asm_debug(BuildCtx *ctx)
     for (i = 19; i <= 28; i++)  /* offset x19-x28 */
       fprintf(ctx->fp, "\t.byte 0x%x\n\t.uleb128 %d\n", 0x80+i, cf-i+17);
     for (i = 8; i <= 15; i++)  /* offset d8-d15 */
-      fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 0x%x, %d\n", 64+i, cf-i-4);
+      fprintf(ctx->fp, "\t.byte 5\n\t.uleb128 0x%x\n\t.uleb128 %d\n",
+	      64+i, cf-i-4);
     fprintf(ctx->fp,
 	"\t.align 3\n"
 	".LEFDE2:\n\n");