Yocto 2.5

Move OpenBMC to Yocto 2.5(sumo)

Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Change-Id: I5c5ad6904a16e14c1c397f0baf10c9d465594a78
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc b/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc
index a1ef9ec..983118c 100644
--- a/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu.inc
@@ -17,6 +17,8 @@
 
 BINCONFIG = "${bindir}/icu-config"
 
+ICU_MAJOR_VER = "${@d.getVar('PV').split('.')[0]}"
+
 inherit autotools pkgconfig binconfig
 
 # ICU needs the native build directory as an argument to its --with-cross-build option when
@@ -26,6 +28,8 @@
 EXTRA_OECONF_class-native = ""
 EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
 
+EXTRA_OECONF_append_class-target = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' --with-data-packaging=archive', '', d)}"
+TARGET_CXXFLAGS_append = "${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'be', ' -DICU_DATA_DIR=\\""${datadir}/${BPN}/${PV}\\""', '', d)}"
 
 # strtod_l() is not supported by musl; also xlocale.h is missing
 # It is not possible to disable its use via configure switches or env vars
@@ -34,6 +38,15 @@
     sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' ${S}/configure.ac
 }
 
+do_compile_prepend_class-target () {
+	# Make sure certain build host references do not end up being compiled
+	# in the image. This only affects libicutu and icu-dbg
+	sed  \
+	    -e 's,DU_BUILD=,DU_BUILD_unused=,g' \
+	    -e '/^CPPFLAGS.*/ s,--sysroot=${STAGING_DIR_TARGET},,g' \
+	    -i ${B}/tools/toolutil/Makefile
+}
+
 PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
 do_install_append_class-native() {
 	mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config
@@ -44,6 +57,23 @@
 	cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE}
 }
 
+do_install_append_class-target() {
+    # The native pkgdata can not generate the correct data file.
+    # Use icupkg to re-generate it.
+    if [ "${SITEINFO_ENDIANNESS}" = "be" ] ; then
+        rm -f ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat
+        icupkg -tb ${S}/data/in/icudt${ICU_MAJOR_VER}l.dat ${D}/${datadir}/${BPN}/${PV}/icudt${ICU_MAJOR_VER}b.dat
+    fi
+	
+	# Remove build host references...
+	sed -i  \
+	    -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
+	    -e 's|${DEBUG_PREFIX_MAP}||g' \
+	    -e 's:${HOSTTOOLS_DIR}/::g' \
+	    ${D}/${bindir}/icu-config ${D}/${libdir}/${BPN}/${PV}/Makefile.inc \
+	    ${D}/${libdir}/${BPN}/${PV}/pkgdata.inc
+}
+
 PACKAGES =+ "libicudata libicuuc libicui18n libicutu libicuio"
 
 FILES_${PN}-dev += "${libdir}/${BPN}/"
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch b/import-layers/yocto-poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch
index add0d76..f0c49e1 100644
--- a/import-layers/yocto-poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu/0001-i18n-Drop-include-xlocale.h.patch
@@ -1,31 +1,34 @@
-From c4254fd8ff1888ca285e3242b812010357ce2b3e Mon Sep 17 00:00:00 2001
+From d6b57c1b4eb9a24d9d95342a961c93946539c93b Mon Sep 17 00:00:00 2001
 From: Khem Raj <raj.khem@gmail.com>
 Date: Sat, 24 Jun 2017 22:52:40 -0700
-Subject: [PATCH] i18n: Drop include <xlocale.h>
+Subject: [PATCH 3/4] i18n: Drop include <xlocale.h>
 
 glibc 2.26 drops this header
 
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
 Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
- i18n/digitlst.cpp | 6 +-----
+---
+ source/i18n/digitlst.cpp | 6 +-----
  1 file changed, 1 insertion(+), 5 deletions(-)
 
-Index: source/i18n/digitlst.cpp
-===================================================================
---- source.orig/i18n/digitlst.cpp
-+++ source/i18n/digitlst.cpp
-@@ -61,11 +61,7 @@
+diff --git a/source/i18n/digitlst.cpp b/source/i18n/digitlst.cpp
+index 8e86fa7..0bdbb2c 100644
+--- a/i18n/digitlst.cpp
++++ b/i18n/digitlst.cpp
+@@ -62,11 +62,7 @@
  #endif
  
  #if U_USE_STRTOD_L
--# if U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CYGWIN
--#   include <locale.h>
--# else
+-# if U_HAVE_XLOCALE_H
 -#   include <xlocale.h>
+-# else
+-#   include <locale.h>
 -# endif
 +# include <locale.h>
  #endif
  
  // ***************************************************************************
+-- 
+2.14.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu/CVE-2017-14952.patch b/import-layers/yocto-poky/meta/recipes-support/icu/icu/CVE-2017-14952.patch
deleted file mode 100644
index f759efc..0000000
--- a/import-layers/yocto-poky/meta/recipes-support/icu/icu/CVE-2017-14952.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From fc83cd832725d3968011f118637b9f5d212e8717 Mon Sep 17 00:00:00 2001
-From: Ovidiu Panait <ovidiu.panait@windriver.com>
-Date: Fri, 10 Nov 2017 16:51:25 +0200
-Subject: [PATCH] Removed redundant UVector entry clean up function call.
-
-Upstream-Status: Backport
-CVE: CVE-2017-14952
-
-Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
----
- i18n/zonemeta.cpp | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/i18n/zonemeta.cpp b/i18n/zonemeta.cpp
-index 84a9657..e163b00 100644
---- a/i18n/zonemeta.cpp
-+++ b/i18n/zonemeta.cpp
-@@ -690,7 +690,6 @@ ZoneMeta::createMetazoneMappings(const UnicodeString &tzid) {
-                     mzMappings = new UVector(deleteOlsonToMetaMappingEntry, NULL, status);
-                     if (U_FAILURE(status)) {
-                         delete mzMappings;
--                        deleteOlsonToMetaMappingEntry(entry);
-                         uprv_free(entry);
-                         break;
-                     }
--- 
-2.10.2
-
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu/fix-install-manx.patch b/import-layers/yocto-poky/meta/recipes-support/icu/icu/fix-install-manx.patch
index ec63f50..8186fb4 100644
--- a/import-layers/yocto-poky/meta/recipes-support/icu/icu/fix-install-manx.patch
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu/fix-install-manx.patch
@@ -1,3 +1,8 @@
+From 3063a9211669bee673840ee81f81d30699b9b702 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Fri, 9 Oct 2015 17:50:41 +0100
+Subject: [PATCH 2/4] icu: fix install race
+
 The generic recursive target calls target-local so also adding it to the
 dependency list results in races due to install-local being executed twice in
 parallel.  For example, install-manx can fail if the two install processes race
@@ -9,12 +14,15 @@
 Upstream-Status: Pending
 Signed-off-by: Ross Burton <ross.burton@intel.com>
 
+---
+ source/Makefile.in | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
 
-diff --git a/Makefile.in b/Makefile.in
-index 9db6c52..3441afa 100644
+diff --git a/source/Makefile.in b/source/Makefile.in
+index c1db15b..4948deb 100644
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -71,7 +71,7 @@ EXTRA_DATA =
+@@ -73,7 +73,7 @@ EXTRA_DATA =
  
  ## List of phony targets
  .PHONY : all all-local all-recursive install install-local install-udata install-udata-files install-udata-dlls		\
@@ -23,7 +31,7 @@
  distclean-local distclean-recursive doc dist dist-local dist-recursive	\
  check check-local check-recursive clean-recursive-with-twist install-icu \
  doc install-doc tests icu4j-data icu4j-data-install update-windows-makefiles xcheck-local xcheck-recursive xperf xcheck xperf-recursive \
-@@ -82,10 +82,10 @@ check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
+@@ -84,9 +84,9 @@ check-exhaustive check-exhaustive-local check-exhaustive-recursive releaseDist
  
  ## List of standard targets
  all: all-local all-recursive
@@ -31,13 +39,11 @@
 +install: install-recursive
  clean: clean-recursive-with-twist clean-local
 -distclean : distclean-recursive distclean-local
--dist: dist-recursive dist-local
 +distclean : distclean-recursive
-+dist: dist-recursive
+ dist: dist-recursive
  check: all check-recursive
  check-recursive: all
- xcheck: all xcheck-recursive
-@@ -352,7 +352,7 @@ config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
+@@ -350,7 +350,7 @@ config.status: $(srcdir)/configure $(srcdir)/common/unicode/uvernum.h
  
  install-manx: $(MANX_FILES)
  	$(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man$(SECTION)
@@ -46,3 +52,6 @@
  
  config/%.$(SECTION): $(srcdir)/config/%.$(SECTION).in
  	cd $(top_builddir) \
+-- 
+2.14.2
+
diff --git a/import-layers/yocto-poky/meta/recipes-support/icu/icu_59.1.bb b/import-layers/yocto-poky/meta/recipes-support/icu/icu_60.2.bb
similarity index 75%
rename from import-layers/yocto-poky/meta/recipes-support/icu/icu_59.1.bb
rename to import-layers/yocto-poky/meta/recipes-support/icu/icu_60.2.bb
index 9fb1be8..585a92b 100644
--- a/import-layers/yocto-poky/meta/recipes-support/icu/icu_59.1.bb
+++ b/import-layers/yocto-poky/meta/recipes-support/icu/icu_60.2.bb
@@ -1,6 +1,6 @@
 require icu.inc
 
-LIC_FILES_CHKSUM = "file://../LICENSE;md5=fe9e1f2c500466d8f18df2cd068e4b74"
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=675f2d069434d8a1e4e6b0dcf4379226"
 
 def icu_download_version(d):
     pvsplit = d.getVar('PV').split('.')
@@ -17,14 +17,13 @@
            file://icu-pkgdata-large-cmd.patch \
            file://fix-install-manx.patch \
            file://0001-i18n-Drop-include-xlocale.h.patch \
-           file://CVE-2017-14952.patch \
            "
 
 SRC_URI_append_class-target = "\
            file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
           "
-SRC_URI[md5sum] = "54923fa9fab5b2b83f235fb72523de37"
-SRC_URI[sha256sum] = "7132fdaf9379429d004005217f10e00b7d2319d0fea22bdfddef8991c45b75fe"
+SRC_URI[md5sum] = "43861b127744b3c0b9d7f386f4b9fa40"
+SRC_URI[sha256sum] = "f073ea8f35b926d70bb33e6577508aa642a8b316a803f11be20af384811db418"
 
 UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
 UPSTREAM_CHECK_URI = "http://download.icu-project.org/files/icu4c/"