diff options
| author | Mike Pall <mike> | 2015-03-06 03:47:45 +0100 |
|---|---|---|
| committer | Mike Pall <mike> | 2015-03-06 03:47:45 +0100 |
| commit | 361827c8f986a73cdccfc98ad16fe9f33ed6fb25 (patch) | |
| tree | 06b31d2ed5972c8d60e378d80a86b89992a4d2e0 /src/host | |
| parent | c821e0aded3973b0c43cddf55709cd3ad42a95d1 (diff) | |
| download | luajit-361827c8f986a73cdccfc98ad16fe9f33ed6fb25.tar.gz luajit-361827c8f986a73cdccfc98ad16fe9f33ed6fb25.tar.bz2 luajit-361827c8f986a73cdccfc98ad16fe9f33ed6fb25.zip | |
PPC64: Add build infrastructure.
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/buildvm.c | 2 | ||||
| -rw-r--r-- | src/host/buildvm_asm.c | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/host/buildvm.c b/src/host/buildvm.c index c3e7dad2..324dd263 100644 --- a/src/host/buildvm.c +++ b/src/host/buildvm.c | |||
| @@ -114,7 +114,7 @@ static const char *sym_decorate(BuildCtx *ctx, | |||
| 114 | else | 114 | else |
| 115 | *p = '\0'; | 115 | *p = '\0'; |
| 116 | #elif LJ_TARGET_PPC && !LJ_TARGET_CONSOLE | 116 | #elif LJ_TARGET_PPC && !LJ_TARGET_CONSOLE |
| 117 | /* Keep @plt. */ | 117 | /* Keep @plt etc. */ |
| 118 | #else | 118 | #else |
| 119 | *p = '\0'; | 119 | *p = '\0'; |
| 120 | #endif | 120 | #endif |
diff --git a/src/host/buildvm_asm.c b/src/host/buildvm_asm.c index fe1b589a..9b7ae53a 100644 --- a/src/host/buildvm_asm.c +++ b/src/host/buildvm_asm.c | |||
| @@ -140,6 +140,14 @@ static void emit_asm_wordreloc(BuildCtx *ctx, uint8_t *p, int n, | |||
| 140 | fprintf(ctx->fp, "\t%s %d, %d, " TOCPREFIX "%s\n", | 140 | fprintf(ctx->fp, "\t%s %d, %d, " TOCPREFIX "%s\n", |
| 141 | (ins & 1) ? "bcl" : "bc", (ins >> 21) & 31, (ins >> 16) & 31, sym); | 141 | (ins & 1) ? "bcl" : "bc", (ins >> 21) & 31, (ins >> 16) & 31, sym); |
| 142 | } else if ((ins >> 26) == 18) { | 142 | } else if ((ins >> 26) == 18) { |
| 143 | #if LJ_ARCH_PPC64 | ||
| 144 | const char *suffix = strchr(sym, '@'); | ||
| 145 | if (suffix && suffix[1] == 'h') { | ||
| 146 | fprintf(ctx->fp, "\taddis 11, 2, %s\n", sym); | ||
| 147 | } else if (suffix && suffix[1] == 'l') { | ||
| 148 | fprintf(ctx->fp, "\tld 12, %s\n", sym); | ||
| 149 | } else | ||
| 150 | #endif | ||
| 143 | fprintf(ctx->fp, "\t%s " TOCPREFIX "%s\n", (ins & 1) ? "bl" : "b", sym); | 151 | fprintf(ctx->fp, "\t%s " TOCPREFIX "%s\n", (ins & 1) ? "bl" : "b", sym); |
| 144 | } else { | 152 | } else { |
| 145 | fprintf(stderr, | 153 | fprintf(stderr, |
| @@ -237,6 +245,9 @@ void emit_asm(BuildCtx *ctx) | |||
| 237 | int i, rel; | 245 | int i, rel; |
| 238 | 246 | ||
| 239 | fprintf(ctx->fp, "\t.file \"buildvm_%s.dasc\"\n", ctx->dasm_arch); | 247 | fprintf(ctx->fp, "\t.file \"buildvm_%s.dasc\"\n", ctx->dasm_arch); |
| 248 | #if LJ_ARCH_PPC64 | ||
| 249 | fprintf(ctx->fp, "\t.abiversion 2\n"); | ||
| 250 | #endif | ||
| 240 | fprintf(ctx->fp, "\t.text\n"); | 251 | fprintf(ctx->fp, "\t.text\n"); |
| 241 | emit_asm_align(ctx, 4); | 252 | emit_asm_align(ctx, 4); |
| 242 | 253 | ||
