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/configs/blackbird_defconfig b/openpower/configs/blackbird_defconfig
index 8ddd7c2..5e723f2 100644
--- a/openpower/configs/blackbird_defconfig
+++ b/openpower/configs/blackbird_defconfig
@@ -49,6 +49,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="blackbird.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="blackbird-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="e782e30829e0d6bea1018740d695633c29f53e75"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="blackbird.xml"
diff --git a/openpower/configs/mihawk_defconfig b/openpower/configs/mihawk_defconfig
index f35518b..d112532 100644
--- a/openpower/configs/mihawk_defconfig
+++ b/openpower/configs/mihawk_defconfig
@@ -49,6 +49,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="mihawk.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="mihawk-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="b1fc7ca4456b9b375b37ab2f06567698f36de0b0"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="mihawk.xml"
diff --git a/openpower/configs/mowgli_defconfig b/openpower/configs/mowgli_defconfig
index d622e64..3d42239 100644
--- a/openpower/configs/mowgli_defconfig
+++ b/openpower/configs/mowgli_defconfig
@@ -48,6 +48,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="mowgli.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="mowgli-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="59f387892e37b5eef5b97b4d0634a62eb63f76b7"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="mowgli.xml"
diff --git a/openpower/configs/nicole_defconfig b/openpower/configs/nicole_defconfig
index 6eed784..90aa06d 100644
--- a/openpower/configs/nicole_defconfig
+++ b/openpower/configs/nicole_defconfig
@@ -44,6 +44,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="nicole.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="nicole-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="37c6311469bfe4e9669f8fedc780719888c075d4"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="nicole.xml"
diff --git a/openpower/configs/p9dsu_defconfig b/openpower/configs/p9dsu_defconfig
index 0f51cf2..84b77ae 100644
--- a/openpower/configs/p9dsu_defconfig
+++ b/openpower/configs/p9dsu_defconfig
@@ -49,6 +49,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="p9dsu.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="p9dsu-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="32ce616ef80f5cc3f128b3aa08fe50954a087888"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="p9dsu.xml"
diff --git a/openpower/configs/romulus_defconfig b/openpower/configs/romulus_defconfig
index a2211d7..02d94e0 100644
--- a/openpower/configs/romulus_defconfig
+++ b/openpower/configs/romulus_defconfig
@@ -48,6 +48,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="romulus.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="romulus-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="5b3fbcaa256eb3638a2ccd09973019efb3c4cddc"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="romulus.xml"
diff --git a/openpower/configs/swift_defconfig b/openpower/configs/swift_defconfig
index 54e4db6..7249f4c 100644
--- a/openpower/configs/swift_defconfig
+++ b/openpower/configs/swift_defconfig
@@ -48,6 +48,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="swift.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="swift-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="14a1bec7d32fabf990338cc6c7a33df99d86f499"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="swift.xml"
diff --git a/openpower/configs/witherspoon_defconfig b/openpower/configs/witherspoon_defconfig
index d42d791..cbf6ad9 100644
--- a/openpower/configs/witherspoon_defconfig
+++ b/openpower/configs/witherspoon_defconfig
@@ -49,6 +49,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="witherspoon.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="witherspoon-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="0f9b3666becbd5a94d31ff39a2f2a81260c961ed"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="witherspoon.xml"
diff --git a/openpower/configs/zaius_defconfig b/openpower/configs/zaius_defconfig
index 16cf547..dba9819 100644
--- a/openpower/configs/zaius_defconfig
+++ b/openpower/configs/zaius_defconfig
@@ -48,6 +48,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 BR2_HOSTBOOT_CONFIG_FILE="zaius.config"
+BR2_HOSTBOOT_USE_ALTERNATE_GCC=y
 BR2_OPENPOWER_MACHINE_XML_GITHUB_PROJECT_VALUE="zaius-xml"
 BR2_OPENPOWER_MACHINE_XML_VERSION="6f6b5efd327958bf5ee7cc51a493d7b3d6f7cefe"
 BR2_OPENPOWER_MACHINE_XML_FILENAME="zaius.xml"
diff --git a/openpower/configs/zz_defconfig b/openpower/configs/zz_defconfig
index 61ca9bb..a72b1ab 100644
--- a/openpower/configs/zz_defconfig
+++ b/openpower/configs/zz_defconfig
@@ -46,6 +46,7 @@
 BR2_OPENPOWER_PLATFORM=y
 BR2_OPENPOWER_POWER9=y
 # BR2_PACKAGE_PPE42_TOOLCHAIN is not set
+BR2_PACKAGE_ALTERNATE_GCC=y
 # BR2_PACKAGE_HOST_OPENPOWER_FFS is not set
 # BR2_PACKAGE_HOSTBOOT is not set
 # BR2_PACKAGE_HOSTBOOT_BINARIES is not set
diff --git a/openpower/package/Config.in b/openpower/package/Config.in
index be50a3e..eee16f4 100755
--- a/openpower/package/Config.in
+++ b/openpower/package/Config.in
@@ -1,3 +1,5 @@
+source "$BR2_EXTERNAL_OP_BUILD_PATH/package/alternate-binutils/Config.in"
+source "$BR2_EXTERNAL_OP_BUILD_PATH/package/alternate-gcc/Config.in"
 source "$BR2_EXTERNAL_OP_BUILD_PATH/package/openpower-ffs/Config.in"
 source "$BR2_EXTERNAL_OP_BUILD_PATH/package/hostboot/Config.in"
 source "$BR2_EXTERNAL_OP_BUILD_PATH/package/hostboot-binaries/Config.in"
diff --git a/openpower/package/alternate-binutils/Config.in b/openpower/package/alternate-binutils/Config.in
new file mode 100644
index 0000000..cb8c182
--- /dev/null
+++ b/openpower/package/alternate-binutils/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_ALTERNATE_BINUTILS
+		bool "alternate-binutils"
+		select BR2_CPP
+		help
+		  Build Binutils for an Alternate Toolchain, for use in
+		  certain packages
+
+if BR2_PACKAGE_ALTERNATE_BINUTILS
+
+config BR2_ALTERNATE_BINUTILS_VERSION
+		string "Alternate Toolchain Binutils Version"
+		default "2.31.1"
+
+config BR2_ALTERNATE_BINUTILS_EXTRA_CONFIG_OPTIONS
+		string "Extra configure options for Alternate Toolchain binutils"
+		default BR2_BINUTILS_EXTRA_CONFIG_OPTIONS
+		help
+		  Any extra options to the Alternate Toolchain's binutils
+		  configure script. The default is taken from
+		  BINUTILS_EXTRA_CONFIG_OPTIONS
+
+endif
diff --git a/openpower/package/alternate-binutils/alternate-binutils.mk b/openpower/package/alternate-binutils/alternate-binutils.mk
new file mode 100644
index 0000000..f916815
--- /dev/null
+++ b/openpower/package/alternate-binutils/alternate-binutils.mk
@@ -0,0 +1,56 @@
+################################################################################
+#
+# alternate-binutils
+#
+################################################################################
+
+#
+# Based on buildroot/package/binutils/binutils.mk
+#
+
+ALTERNATE_BINUTILS_VERSION = $(call qstrip,$(BR2_ALTERNATE_BINUTILS_VERSION))
+ALTERNATE_BINUTILS_SITE ?= $(BR2_GNU_MIRROR)/binutils
+ALTERNATE_BINUTILS_SOURCE ?= binutils-$(ALTERNATE_BINUTILS_VERSION).tar.xz
+
+ALTERNATE_BINUTILS_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES)
+ALTERNATE_BINUTILS_MAKE_OPTS = LIBS=$(TARGET_NLS_LIBS)
+ALTERNATE_BINUTILS_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_ALTERNATE_BINUTILS_EXTRA_CONFIG_OPTIONS))
+ALTERNATE_BINUTILS_CONF_ENV += MAKEINFO=true
+ALTERNATE_BINUTILS_MAKE_OPTS += MAKEINFO=true
+BINUTILS_INSTALL_OPTS += MAKEINFO=true install
+
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+ALTERNATE_BINUTILS_DEPENDENCIES += zlib
+endif
+
+HOST_ALTERNATE_BINUTILS_CONF_OPTS = \
+	--disable-multilib \
+	--disable-werror \
+	--prefix="$(HOST_DIR)/alternate-toolchain" \
+	--target=$(GNU_TARGET_NAME) \
+	--disable-shared \
+	--enable-static \
+	--with-sysroot=$(STAGING_DIR) \
+	--enable-poison-system-directories \
+	$(ALTERNATE_BINUTILS_EXTRA_CONFIG_OPTIONS)
+
+ALTERNATE_BINUTILS_MAKE_ENV = $(TARGET_CONFIGURE_ARGS)
+
+define ALTERNATE_BINUTILS_INSTALL_HOST_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR="$(HOST_DIR)/alternate-toolchain" install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/opcodes DESTDIR="$(HOST_DIR)/alternate-toolchain" install
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libiberty DESTDIR="$(HOST_DIR)/alternate-toolchain" install
+endef
+
+ALTERNATE_BINUTILS_TOOLS = ar as ld ld.bfd nm objcopy objdump ranlib readelf strip
+define HOST_ALTERNATE_BINUTILS_FIXUP_HARDLINKS
+	$(foreach tool,$(ALTERNATE_BINUTILS_TOOLS),\
+		rm -f $(HOST_DIR)/alternate-toolchain/$(GNU_TARGET_NAME)/bin/$(tool) && \
+		cp -a $(HOST_DIR)/alternate-toolchain/bin/$(GNU_TARGET_NAME)-$(tool) \
+			$(HOST_DIR)/alternate-toolchain/$(GNU_TARGET_NAME)/bin/$(tool)
+	)
+endef
+HOST_ALTERNATE_BINUTILS_POST_INSTALL_HOOKS += HOST_ALTERNATE_BINUTILS_FIXUP_HARDLINKS
+
+$(eval $(host-autotools-package))
+
diff --git a/openpower/package/alternate-gcc/Config.in b/openpower/package/alternate-gcc/Config.in
new file mode 100644
index 0000000..fbbd7b2
--- /dev/null
+++ b/openpower/package/alternate-gcc/Config.in
@@ -0,0 +1,22 @@
+config BR2_PACKAGE_ALTERNATE_GCC
+		bool "alternate-gcc"
+		select BR2_PACKAGE_ALTERNATE_BINUTILS
+		help
+		  Build gcc for an Alternate Toolchain, for use in
+		  certain packages.
+
+
+if BR2_PACKAGE_ALTERNATE_GCC
+
+config BR2_ALTERNATE_GCC_VERSION
+		string "Alternate gcc version"
+		default "8.4.0"
+
+config BR2_ALTERNATE_GCC_EXTRA_CONFIG_OPTIONS
+		string "Extra configure options for Alternate Toolchain GCC"
+		default BR2_EXTRA_GCC_CONFIG_OPTIONS
+		help
+		  Any extra options to the Alternate Toolchain's gcc configure script
+		  The default is taken from EXTRA_GCC_CONFIG_OPTIONS
+
+endif
diff --git a/openpower/package/alternate-gcc/alternate-gcc.mk b/openpower/package/alternate-gcc/alternate-gcc.mk
new file mode 100644
index 0000000..a2d8ecb
--- /dev/null
+++ b/openpower/package/alternate-gcc/alternate-gcc.mk
@@ -0,0 +1,65 @@
+################################################################################
+#
+# alternate-gcc
+#
+################################################################################
+
+#
+# Based on buildroot/package/gcc/*.mk, but trying to simplify since we're not
+# (yet) going for a general scenario here
+#
+
+ALTERNATE_GCC_VERSION = $(call qstrip,$(BR2_ALTERNATE_GCC_VERSION))
+ALTERNATE_GCC_SITE = $(BR2_GNU_MIRROR:/=)/gcc/gcc-$(ALTERNATE_GCC_VERSION)
+ALTERNATE_GCC_SOURCE = gcc-$(ALTERNATE_GCC_VERSION).tar.xz
+
+HOST_ALTERNATE_GCC_SUBDIR = build
+
+HOST_ALTERNATE_GCC_DEPENDENCIES = \
+	host-alternate-binutils \
+	host-gmp \
+	host-mpc \
+	host-mpfr \
+	$(BR_LIBC)
+
+HOST_ALTERNATE_GCC_EXCLUDES = \
+	libjava/* libgo/*
+
+define HOST_ALTERNATE_GCC_CONFIGURE_SYMLINK
+	mkdir -p $(@D)/build
+	ln -sf ../configure $(@D)/build/configure
+endef
+
+HOST_ALTERNATE_GCC_CONF_OPTS += \
+	$(call qstrip,$(BR2_ALTERNATE_GCC_EXTRA_CONFIG_OPTIONS))
+
+define  HOST_ALTERNATE_GCC_CONFIGURE_CMDS
+	(cd $(HOST_ALTERNATE_GCC_SRCDIR) && rm -rf config.cache; \
+		CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
+		CXXFLAGS_FOR_TARGET="$(TARGET_CXXFLAGS)" \
+		CFLAGS="$(HOST_CFLAGS)" \
+		LDFLAGS="$(HOST_LDFLAGS)" \
+		MAKEINFO=missing \
+		./configure \
+		--prefix="$(HOST_DIR)/alternate-toolchain" \
+		--enable-static \
+		--target=$(GNU_TARGET_NAME) \
+		--with-sysroot=$(STAGING_DIR) \
+		--enable-__cxa_atexit \
+		--with-gnu-ld \
+		--disable-libssp \
+		--disable-multilib \
+		--disable-decimal-float \
+		--with-gmp=$(HOST_DIR) \
+		--with-mpc=$(HOST_DIR) \
+		--with-mpfr=$(HOST_DIR) \
+		--enable-languages="c,c++" \
+		--with-build-time-tools=$(HOST_DIR)/alternate-toolchain/$(GNU_TARGET_NAME)/bin \
+		--enable-shared \
+		$(QUIET) $(HOST_ALTERNATE_GCC_CONF_OPTS) \
+	)
+endef
+
+HOST_ALTERNATE_GCC_PRE_CONFIGURE_HOOKS += HOST_ALTERNATE_GCC_CONFIGURE_SYMLINK
+
+$(eval $(host-autotools-package))
diff --git a/openpower/package/hostboot/Config.in b/openpower/package/hostboot/Config.in
index be08096..bbb7281 100644
--- a/openpower/package/hostboot/Config.in
+++ b/openpower/package/hostboot/Config.in
@@ -35,5 +35,13 @@
         help
             String used to define hw specific make config file
 
-endif
 
+config BR2_HOSTBOOT_USE_ALTERNATE_GCC
+		bool "use Alternate GCC to build hostboot"
+		default n
+		select BR2_PACKAGE_ALTERNATE_GCC
+		help
+		  Select to enable using an alternate version of GCC
+		  to build hostboot.
+
+endif
diff --git a/openpower/package/hostboot/hostboot.mk b/openpower/package/hostboot/hostboot.mk
index d83f073..7913643 100644
--- a/openpower/package/hostboot/hostboot.mk
+++ b/openpower/package/hostboot/hostboot.mk
@@ -14,10 +14,20 @@
 HOSTBOOT_INSTALL_IMAGES = YES
 HOSTBOOT_INSTALL_TARGET = NO
 
+ifeq ($(BR2_HOSTBOOT_USE_ALTERNATE_GCC),y)
+HOSTBOOT_TARGET_CROSS = $(HOST_DIR)/alternate-toolchain/bin/$(GNU_TARGET_NAME)-
+HOSTBOOT_BINUTILS_DIR = $(HOST_ALTERNATE_BINUTILS_DIR)
+HOSTBOOT_DEPENDENCIES = host-alternate-binutils host-alternate-gcc
+else
+HOSTBOOT_TARGET_CROSS = $(TARGET_CROSS)
+HOSTBOOT_BINUTILS_DIR = $(HOST_BINUTILS_DIR)
+HOSTBOOT_DEPENDENCIES = host-binutils
+endif
+
 HOSTBOOT_ENV_VARS=$(TARGET_MAKE_ENV) PERL_USE_UNSAFE_INC=1 \
     CONFIG_FILE=$(BR2_EXTERNAL_OP_BUILD_PATH)/configs/hostboot/$(BR2_HOSTBOOT_CONFIG_FILE) \
-    OPENPOWER_BUILD=1 CROSS_PREFIX="$(CCACHE) $(TARGET_CROSS)" HOST_PREFIX="" HOST_BINUTILS_DIR=$(HOST_BINUTILS_DIR) \
-    HOSTBOOT_VERSION=`cat $(HOSTBOOT_VERSION_FILE)`
+    OPENPOWER_BUILD=1 CROSS_PREFIX="$(CCACHE) $(HOSTBOOT_TARGET_CROSS)" HOST_PREFIX="" \
+    HOST_BINUTILS_DIR=$(HOSTBOOT_BINUTILS_DIR) HOSTBOOT_VERSION=`cat $(HOSTBOOT_VERSION_FILE)`
 
 define HOSTBOOT_BUILD_CMDS
         $(HOSTBOOT_ENV_VARS) bash -c 'cd $(@D) && source ./env.bash && $(MAKE)'
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)