diff options
| author | Mike Pall <mike> | 2015-04-12 01:23:01 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2015-04-12 01:23:01 +0200 |
| commit | dec4acca9a2e06b565415d7be44506baa0a0fee0 (patch) | |
| tree | b3c15e8990573cdf721b6019d7dbb086304751a9 | |
| parent | 8002871619b21ac97673d50a46070d2f9338ea85 (diff) | |
| download | luajit-dec4acca9a2e06b565415d7be44506baa0a0fee0.tar.gz luajit-dec4acca9a2e06b565415d7be44506baa0a0fee0.tar.bz2 luajit-dec4acca9a2e06b565415d7be44506baa0a0fee0.zip | |
PPC: Fix cross-endian builds.
| -rw-r--r-- | src/Makefile | 5 | ||||
| -rw-r--r-- | src/lj_arch.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/Makefile b/src/Makefile index d7539fd5..903beedd 100644 --- a/src/Makefile +++ b/src/Makefile | |||
| @@ -221,6 +221,11 @@ ifneq (,$(findstring LJ_TARGET_ARM64 ,$(TARGET_TESTARCH))) | |||
| 221 | TARGET_LJARCH= arm64 | 221 | TARGET_LJARCH= arm64 |
| 222 | else | 222 | else |
| 223 | ifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH))) | 223 | ifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH))) |
| 224 | ifneq (,$(findstring LJ_LE 1,$(TARGET_TESTARCH))) | ||
| 225 | TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_LE | ||
| 226 | else | ||
| 227 | TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_BE | ||
| 228 | endif | ||
| 224 | TARGET_LJARCH= ppc | 229 | TARGET_LJARCH= ppc |
| 225 | else | 230 | else |
| 226 | ifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH))) | 231 | ifneq (,$(findstring LJ_TARGET_MIPS ,$(TARGET_TESTARCH))) |
diff --git a/src/lj_arch.h b/src/lj_arch.h index 61c7e19f..25c82fd0 100644 --- a/src/lj_arch.h +++ b/src/lj_arch.h | |||
| @@ -210,11 +210,13 @@ | |||
| 210 | 210 | ||
| 211 | #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC | 211 | #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC |
| 212 | 212 | ||
| 213 | #ifndef LJ_ARCH_ENDIAN | ||
| 213 | #if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__ | 214 | #if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__ |
| 214 | #define LJ_ARCH_ENDIAN LUAJIT_LE | 215 | #define LJ_ARCH_ENDIAN LUAJIT_LE |
| 215 | #else | 216 | #else |
| 216 | #define LJ_ARCH_ENDIAN LUAJIT_BE | 217 | #define LJ_ARCH_ENDIAN LUAJIT_BE |
| 217 | #endif | 218 | #endif |
| 219 | #endif | ||
| 218 | 220 | ||
| 219 | #if _LP64 | 221 | #if _LP64 |
| 220 | #define LJ_ARCH_BITS 64 | 222 | #define LJ_ARCH_BITS 64 |
