[Skiboot] [PATCH 4/4] Build skiboot little-endian by default when FSP=0

Nicholas Piggin npiggin at gmail.com
Sat Apr 9 01:31:37 AEST 2022


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 at gmail.com>
---
 Makefile | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index f3942c442..610f039f3 100644
--- a/Makefile
+++ b/Makefile
@@ -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 ~)
-- 
2.23.0



More information about the Skiboot mailing list