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))) TARGET_LJARCH= arm64 else ifneq (,$(findstring LJ_TARGET_PPC ,$(TARGET_TESTARCH))) + ifneq (,$(findstring LJ_LE 1,$(TARGET_TESTARCH))) + TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_LE + else + TARGET_ARCH= -DLJ_ARCH_ENDIAN=LUAJIT_BE + endif TARGET_LJARCH= ppc else 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 @@ #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC +#ifndef LJ_ARCH_ENDIAN #if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__ #define LJ_ARCH_ENDIAN LUAJIT_LE #else #define LJ_ARCH_ENDIAN LUAJIT_BE #endif +#endif #if _LP64 #define LJ_ARCH_BITS 64