Yocto 2.3

Move OpenBMC to Yocto 2.3(pyro).

Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I50744030e771f4850afc2a93a10d3507e76d36bc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Resolves: openbmc/openbmc#2461
diff --git a/common/recipes-bsp/u-boot/files/default-gcc.patch b/common/recipes-bsp/u-boot/files/default-gcc.patch
new file mode 100644
index 0000000..04184df
--- /dev/null
+++ b/common/recipes-bsp/u-boot/files/default-gcc.patch
@@ -0,0 +1,39 @@
+OE needs to be able to change the default compiler. If we pass in HOSTCC
+through the make command, it overwrites not only this setting but also the 
+setting in tools/Makefile wrapped in ifneq ($(CROSS_BUILD_TOOLS),) which 
+breaks the build.
+
+We therefore use override to ensure the value of HOSTCC is overwritten when
+needed.
+
+RP: Updated the patch to the version being submitted to upstream u-boot
+
+Upstream-Status: Submitted [emailed to Masahiro Yamada for discussion]
+RP 2017/3/11
+
+Index: git/tools/Makefile
+===================================================================
+--- git.orig/tools/Makefile
++++ git/tools/Makefile
+@@ -262,7 +262,7 @@ $(LICENSE_H): $(obj)/bin2header $(srctre
+ subdir- += env
+ 
+ ifneq ($(CROSS_BUILD_TOOLS),)
+-HOSTCC = $(CC)
++override HOSTCC = $(CC)
+ 
+ quiet_cmd_crosstools_strip = STRIP   $^
+       cmd_crosstools_strip = $(STRIP) $^; touch $@
+Index: git/tools/env/Makefile
+===================================================================
+--- git.orig/tools/env/Makefile
++++ git/tools/env/Makefile
+@@ -8,7 +8,7 @@
+ # fw_printenv is supposed to run on the target system, which means it should be
+ # built with cross tools. Although it may look weird, we only replace "HOSTCC"
+ # with "CC" here for the maximum code reuse of scripts/Makefile.host.
+-HOSTCC = $(CC)
++override HOSTCC = $(CC)
+ 
+ # Compile for a hosted environment on the target
+ HOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
diff --git a/common/recipes-bsp/u-boot/u-boot-common.inc b/common/recipes-bsp/u-boot/u-boot-common_2016.07.inc
similarity index 100%
rename from common/recipes-bsp/u-boot/u-boot-common.inc
rename to common/recipes-bsp/u-boot/u-boot-common_2016.07.inc
diff --git a/common/recipes-bsp/u-boot/u-boot-fw-utils_2016.07.bb b/common/recipes-bsp/u-boot/u-boot-fw-utils_2016.07.bb
index e5a9036..2631499 100644
--- a/common/recipes-bsp/u-boot/u-boot-fw-utils_2016.07.bb
+++ b/common/recipes-bsp/u-boot/u-boot-fw-utils_2016.07.bb
@@ -1,10 +1,12 @@
+require u-boot-common_${PV}.inc
+
+SRC_URI += "file://default-gcc.patch"
+
 SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
 DEPENDS = "mtd-utils"
 
-require u-boot-common.inc
-
 INSANE_SKIP_${PN} = "already-stripped"
-EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" V=1'
 EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
 
 inherit uboot-config
diff --git a/common/recipes-bsp/u-boot/u-boot_2016.07.bb b/common/recipes-bsp/u-boot/u-boot_2016.07.bb
index 0df7f2b..05b1c89 100644
--- a/common/recipes-bsp/u-boot/u-boot_2016.07.bb
+++ b/common/recipes-bsp/u-boot/u-boot_2016.07.bb
@@ -1,4 +1,4 @@
+require u-boot-common_${PV}.inc
 require recipes-bsp/u-boot/u-boot.inc
-require u-boot-common.inc
 
 DEPENDS += "dtc-native"