@@ -48,19 +48,35 @@ KERNEL ?=
#
STACK_CHECK ?= $(DEBUG)
+# Try to build without FSP code
+CONFIG_FSP?=1
+# Try to build without POWER8 support
+CONFIG_P8?=1
+
+# FSP (hservices) code does not work with LE at the moment.
+BIG_ENDIAN ?= $(CONFIG_FSP)
+ifeq ($(BIG_ENDIAN),1)
+LITTLE_ENDIAN = 0
+else
+LITTLE_ENDIAN ?= 1
+endif
+
#
# Experimental (unsupported) build options
#
-# Little-endian does not yet build. Include it here to set ELF ABI.
-LITTLE_ENDIAN ?= 0
-# ELF v2 ABI is more efficient and compact
+# ELF v2 ABI is more efficient and compact.
+# This can be set for big-endian builds. Clearing it for LE probably won't work.
ELF_ABI_v2 ?= $(LITTLE_ENDIAN)
+
+# FSP does not work with LE or ELFv2
+ifeq ($(ELF_ABI_v2),1)
+ifeq ($(CONFIG_FSP),1)
+$(error FSP support is incompatible with little-endian and ELFv2 build options)
+endif
+endif
+
# Discard unreferenced code and data at link-time
DEAD_CODE_ELIMINATION ?= 0
-# Try to build without FSP code
-CONFIG_FSP?=1
-# Try to build without POWER8 support
-CONFIG_P8?=1
#
# Where is the source directory, must be a full path (no ~)
Little-endian has a simpler calling convention, it's smaller, uses less stack, and is faster. With a new OPAL ABI, it can avoid heavy-weight endian flips when called from an LE OS. FSP code (namely hservice runtime interface calls and host interface callbacks) does not work with LE or ELFv2, so check for conflicting options and abort the build. This reduces skiboot.lid.xz size by 10KiB. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> --- Makefile | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-)