Introduce Alternate Toolchain gcc and binutils
Hostboot, OCC and potentially other packages are *VERY* sensitive to
GCC+binutils combinations (specially due to the use of libbfd to feed
the custom linker/loader script). That means that the default buildroot
toolchain can't be easily upgraded without risking hard-to-debug build
and runtime issues that might be caused by the change of the compiler +
binutils combination.
Address this by creating (yet another) GCC + Binutils host packages pair
that can be used, as an alternative to the one provided by buildroot.
Doing so would allow such packages to stay (indefinitely) using their
choice of gcc+binutils, while still allowing buildroot (and the Skiroot
environment) to evolve and use newer versions / releases.
Signed-off-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
diff --git a/openpower/package/occ/Config.in b/openpower/package/occ/Config.in
index b55a58a..1959cc0 100644
--- a/openpower/package/occ/Config.in
+++ b/openpower/package/occ/Config.in
@@ -48,5 +48,13 @@
default BR2_OCC_CUSTOM_VERSION_VALUE \
if BR2_OCC_CUSTOM_VERSION
+config BR2_OCC_USE_ALTERNATE_GCC
+ bool "use Alternate gcc to build occ"
+ default n
+ select BR2_PACKAGE_ALTERNATE_GCC
+ help
+ Select to enable using an alternate version of gcc
+ to build occ.
+
endif
diff --git a/openpower/package/occ/occ.mk b/openpower/package/occ/occ.mk
index 7d8c582..61bce5b 100644
--- a/openpower/package/occ/occ.mk
+++ b/openpower/package/occ/occ.mk
@@ -18,18 +18,26 @@
OCC_IMAGE_BIN_PATH = obj/image.bin
-OCC_DEPENDENCIES = host-binutils host-ppe42-toolchain
+OCC_DEPENDENCIES = host-ppe42-gcc
ifeq ($(BR2_OCC_GPU_BIN_BUILD),y)
OCC_DEPENDENCIES += hostboot-binaries
endif
+ifeq ($(BR2_OCC_USE_ALTERNATE_GCC),y)
+OCC_TARGET_CROSS = $(HOST_DIR)/alternate-toolchain/bin/$(GNU_TARGET_NAME)-
+OCC_DEPENDENCIES += host-alternate-gcc
+else
+OCC_TARGET_CROSS = $(TARGET_CROSS)
+OCC_DEPENDENCIES += host-binutils
+endif
+
define OCC_BUILD_CMDS
if [ "$(BR2_OCC_GPU_BIN_BUILD)" == "y" ]; then \
cd $(@D)/src && \
- make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib GPE1_BIN_IMAGE_PATH=$(STAGING_DIR)/hostboot_binaries/ OPOCC_GPU_SUPPORT=1 all; \
+ make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(OCC_TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib GPE1_BIN_IMAGE_PATH=$(STAGING_DIR)/hostboot_binaries/ OPOCC_GPU_SUPPORT=1 all; \
else \
cd $(@D)/src && \
- make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib all; \
+ make PPE_TOOL_PATH=$(PPE42_GCC_BIN) OCC_OP_BUILD=1 CROSS_PREFIX=$(OCC_TARGET_CROSS) LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib all; \
fi;
endef
OCC_BUILD_CMDS ?= $(OCC_BUILD_CMDS_P9)